Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MO_MIN_AREA_PX is not the area of the rectangle #168

Open
SamDecrock opened this issue Mar 23, 2024 · 0 comments
Open

MO_MIN_AREA_PX is not the area of the rectangle #168

SamDecrock opened this issue Mar 23, 2024 · 0 comments

Comments

@SamDecrock
Copy link

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):

INFO     speed_camera  Add - 3/7 xy(195,183) 7.05 kph D=6/250 C=23 375x238=89250 sqpx L2R

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant