Answers for "cv2.error: opencv(4.5.5) d:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\demosaicing.cpp:1699: error: (-215:assertion failed) scn == 1 && dcn == 1 in function 'cv::demosaicing'"

-1

cv2.error: OpenCV(4.3.0) /io/opencv/modules/imgproc/src/drawing.cpp:2374: error: (-215:Assertion failed) p.checkVector(2, CV_32S) >= 0 in function 'fillPoly'

new_img = cv2.fillPoly(blank_img,[cnt],color =(255,255,255))

I was facing error in this line.

so The solution is make sure "cnt" must be int not float.

CHANGES:
cnt = np.array([[50,50], [50,150], [150,150], [150,50]],dtype=np.int32)
Posted by: Guest on May-26-2021

Code answers related to "cv2.error: opencv(4.5.5) d:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\demosaicing.cpp:1699: error: (-215:assertion failed) scn == 1 && dcn == 1 in function 'cv::demosaicing'"

Browse Popular Code Answers by Language