You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, doing some debugging revealed that the MO_MIN_AREA_PX is compared to cv2.contourArea(c) wheares the sqpx in the debug statement is based on the response from cv2.boundingRect(c).
cv2.contourArea measures the actual area within the contour, while cv2.boundingRect provides the dimensions of the smallest rectangle that can enclose the contour. Thus cv2.contourArea can be a lot smaller as it uses the real contours, not a rectangle.
So I guess it would be better to also debug the contourArea so users have something to base their MO_MIN_AREA_PX on?
The text was updated successfully, but these errors were encountered:
Just a note, and maybe this should be added to the documentation or even to the debug statements:
I was using the sqpx in the following line to base the minimum
MO_MIN_AREA_PX
on (89250
in this example):However, doing some debugging revealed that the
MO_MIN_AREA_PX
is compared tocv2.contourArea(c)
wheares the sqpx in the debug statement is based on the response fromcv2.boundingRect(c)
.cv2.contourArea
measures the actual area within the contour, whilecv2.boundingRect
provides the dimensions of the smallest rectangle that can enclose the contour. Thuscv2.contourArea
can be a lot smaller as it uses the real contours, not a rectangle.So I guess it would be better to also debug the contourArea so users have something to base their
MO_MIN_AREA_PX
on?The text was updated successfully, but these errors were encountered: