is there a way to debug this?

Viewed 30
sorted_ctrs = sorted(cnts, key=lambda ctr: cv2.boundingRect(ctr)[0] + cv2.boundingRect(ctr)[1] * image.shape[1] )

output:

Traceback (most recent call last)
Input In [10], in <cell line: 1>()
----> 1 sorted_ctrs = sorted(cnts, key=lambda ctr: cv2.boundingRect(ctr[0]) + cv2.boundingRect(ctr[1]) * image.shape[1] )

Input In [10], in <lambda>(ctr)
----> 1 sorted_ctrs = sorted(cnts, key=lambda ctr: cv2.boundingRect(ctr[0]) + cv2.boundingRect(ctr[1]) * image.shape[1] )

error: OpenCV(4.6.0) /io/opencv/modules/imgproc/src/shapedescr.cpp:874: error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function 'pointSetBoundingRect'
0 Answers
Related