Skip to content

MO_MIN_AREA_PX is not the area of the rectangle #168

@SamDecrock

Description

@SamDecrock

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions