akshaybahadur21/QuickDraw

cv2.error: OpenCV(4.1.1) 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'

saikumarvaddepally15 opened this issue · 3 comments

In opencv 4.1.1, cv2.findContours return 2 values
let try it
contours,hierarchy = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
https://stackoverflow.com/questions/54273763/assertion-error-215-npoints-0-and-error-while-extracting-letters-from-capt

@saikumarnani0304 Fasing same issue. After adding hierarchy it is giving error like :
Expected Ptr<cv::UMat> for argument '%s'.
My code looks like this!!

Capture

that is not an opencv issue it seems to be that problems with camera. no access to it. try different camera or try to change videoinput from 0 to 1.