LCD-OCR icon indicating copy to clipboard operation
LCD-OCR copied to clipboard

Error cv::contourArea

Open khacson opened this issue 6 years ago • 2 comments

$ python code.py Traceback (most recent call last): File "code.py", line 47, in if cv2.contourArea(c) < 600: cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\imgproc\src\shapedescr.cpp:274: error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function 'cv::contourArea'

[ WARN:1] terminating async callback

khacson avatar May 23 '19 03:05 khacson

This is happening because of version issues. You may find some solutions here

DevashishPrasad avatar May 30 '19 11:05 DevashishPrasad

Please go through the following link https://stackoverflow.com/questions/39475125/compatibility-issue-with-contourarea-in-opencv-3

In Opencv 3 API version the cv2.findContours() returns 3 objects

Check you Opencv version

DevashishPrasad avatar Jun 19 '20 06:06 DevashishPrasad