Skip to content
Advertisement

Tag: computer-vision

OpenCV(4.1.2) error: (-215:Assertion failed) !ssize.empty() in function ‘cv::resize’

I am recieving this error when running this line of code: OpenCV(4.1.2) C:projectsopencv-pythonopencvmodulesimgprocsrcresize.cpp:3720: error: (-215:Assertion failed) !ssize.empty() in function ‘cv::resize’ Answer Your img variable is empty, you probably didn’t load the image correctly. Try printing your img.shape after you load your image. Then have a look at the path you specified, there is probably something wrong with it. (Either you

Understanding contour hierarchies: How to distinguish filled circle/contour and unfilled circle/contour in OpenCV?

I am unable to differentiate between the below two contours. cv2.contourArea() is giving the same value for both. Is there any function to distinguish them in Python? How do I use contour hierarchies to determine the difference? Answer To distinguish between a filled contour and unfilled contour, you can use contour hierarchy when finding contours with cv2.findContours(). Specifically, you can

Advertisement