Ask Your Question
0

I Am Trying To Do Face-recognition With Python But I Am Getting This Error: cv2.error: OpenCV(4.2.0) /Users/travis/build/skvark/opencv-python/opencv/modules/imgproc/src/resize.cpp:4045: error: (-215:Assertion failed) !ssize.empty() in function 'resize'

asked 2020-06-13 01:56:34 -0600

Please Help Me With This

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-06-13 02:03:20 -0600

berak gravatar image

updated 2020-06-13 02:13:58 -0600

this is the most common error for python users, your io failed (camera did not open, image path wrong, etc) and you DID NOT CHECK, so you get problems in the NEXT lines with invalid images.

again, you HAVE to check if imread() returns None , the ret val from capture.read(), and all that, opencv won't throw any exceptions here, and it's your responsibility to check.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-06-13 01:56:34 -0600

Seen: 4,812 times

Last updated: Jun 13 '20