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
{{ message }}
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.
The ROI should be abstracted using a class. The class will implement a point_in_roi method that accepts a single x,y location and returns a boolean. We can keep a list of ROI on the image processing entity, then just iterate over them to filter each object. Pillow implements various shapes so stick to these:
rectangle - two xy points, defining the top left and bottom right of the box
Note that shapely includes the required methods to implement point_in_roi but shapely itself has many C dependencies and we dont want to make this a new HA dependency
The text was updated successfully, but these errors were encountered:
This is only worth doing if we are going to add the polygon support, and since that is going to be quite complex to configure (probably requiring a dedicated tool to assist) need to think carefully about this
The ROI should be abstracted using a class. The class will implement a
point_in_roi
method that accepts a singlex,y
location and returns a boolean. We can keep a list of ROI on the image processing entity, then just iterate over them to filter each object. Pillow implements various shapes so stick to these:Since we are always defining points as xy pairs, perhaps change the config to be a list of points like:
The rectangle and circle are then just defined by two points, and a polygon by an arbitrary number of points.
Alternatively could adopt the approach of frigate, where a ROI (frigate calls them masks) is defined as a list of xy points, e.g.
This results in much more succinct config.
A nice compromise might be to combine approaches, so we have config like:
This allows validation of the number of points.
Note that shapely includes the required methods to implement
point_in_roi
but shapely itself has many C dependencies and we dont want to make this a new HA dependencyThe text was updated successfully, but these errors were encountered: