Ask Your Question

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 -0500

Please Help Me With This

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

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

berak gravatar image

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

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, 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


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

Seen: 763 times

Last updated: Jun 13 '20