ageitgey / ageitgey/face_recognition
OpenCV Error: Assertion failed (ssize.width > 0 && ssize.height > 0) in resize, file /io/opencv/modules/imgproc/src/resize.cpp, line 3289
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 56.8k
- Forks
- 13.7k
- PR merge metrics
- No merged PRs in 30d
Description
- face_recognition version : last version
- Python version : 3.5
- Operating System : linux
I try to read images from folders by using this litle code :
def Split_path_image():
for i in range(len(Image_path)):
Name_list.append(Image_path[i].split("/")[-1])
return Name_list
def Split_name():
for name in Name_list:
Nsplit = str(name).split('.')
NameSplit.append(Nsplit)
return NameSplit
NameSplit = Loading.Split_name()
Name_list=Loading.Split_path_image()
for iname, path_name in zip(NameSplit, Name_list):
known_faces = []
path=os.path.join('images', path_name)
if os.path.exists(path):
name = face_recognition.load_image_file(path)
name_face_encoding = face_recognition.face_encodings(name)[0]
known_faces.append(name_face_encoding)
names.append(iname[0])
when I run the project I get this problem :
VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
Unable to stop the stream: Device or resource busy
OpenCV Error: Assertion failed (ssize.width > 0 && ssize.height > 0) in resize, file /io/opencv/modules/imgproc/src/resize.cpp, line 3289
Called with args:
Namespace(image_height=1080, image_width=1920, rtsp_latency=200, rtsp_uri=None, use_rtsp=False, use_usb=False, video_dev=1)
OpenCV version: 3.3.1
Traceback (most recent call last):
File "/home/hamza/um6p_project/Face_recognition/Face_Recognition_demo2.py", line 101, in <module>
small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25)
cv2.error: /io/opencv/modules/imgproc/src/resize.cpp:3289: error: (-215) ssize.width > 0 && ssize.height > 0 in function resize
please help me to solve this problem :
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at Face_Recognition_demo2.py line 101, where frame is passed to cv2.resize, and inspect how the camera frame is acquired with video_dev=1. Reproduce the V4L2 errors and verify whether the input frame is empty before resize. Done means the camera input issue is understood and resize no longer receives an empty frame.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- opencv, python
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100