frigate icon indicating copy to clipboard operation
frigate copied to clipboard

Visualize / exaggerate the single pixel at the bottom of the detection box used for zones

Open bagobones opened this issue 1 year ago • 6 comments

Describe what you are trying to accomplish and why in non technical terms The documentation states that zones are determined only by a single pixel at the bottom of the object. I suggest adding a dot/square/crosshair at the bottom of every detection bounding box to help call this out.

Describe the solution you'd like I suggest adding a dot/square/crosshair at the bottom of every detection bounding box to help show how a zone detection was made.

I personally keep forgetting that the zone needs to basically be at the FEET of the object to work and at various camera angles this creates some interesting problems where I wish zone detection was based on the box clipping the object instead of a single pixel.

bagobones avatar Sep 23 '22 17:09 bagobones

Yeah that's probably a good idea to be a reminder.

I also have a PR up that adds configuration to make it the top center, left center, right center, or bottom center

NickM-27 avatar Sep 23 '22 17:09 NickM-27

I also have a PR up that adds configuration to make it the top center, left center, right center, or bottom center

Even more important to visualize it then.. Sounds like a nice option to have.

Is a center of object also possible? It would be useful for heavily overhead views.

bagobones avatar Sep 23 '22 23:09 bagobones

I wish zone detection was based on the box clipping the object instead of a single pixel.

I agree. It would likely be more accurate considering that bounding boxes don't always perfectly align with objects. For example, we could set it to only record events if a zone covers a quarter (or a third, or option in settings) of the detected object. This method would simplify masking as well. Currently, an event can be triggered if even one pixel goes outside the mask

andrey-skat avatar Feb 04 '24 09:02 andrey-skat

It would likely be more accurate considering that bounding boxes don't always perfectly align with objects. For example, we could set it to only record events if a zone covers a quarter (or a third, or option in settings) of the detected object

This would be far less precise and almost impossible to use for cameras mounted at a front door. It started this way and it was almost useless.

blakeblackshear avatar Feb 04 '24 14:02 blakeblackshear

In my case it ends up something like this :) изображение изображение

Maybe it can be per-camera setting? Something like in_zone_method: [bottom_center_point|area_fill]? The center of the object is also good, but it seems like this is a specific case of 25-50% object filling

andrey-skat avatar Feb 04 '24 16:02 andrey-skat

It would likely be more accurate considering that bounding boxes don't always perfectly align with objects. For example, we could set it to only record events if a zone covers a quarter (or a third, or option in settings) of the detected object

This would be far less precise and almost impossible to use for cameras mounted at a front door. It started this way and it was almost useless.

For me the easiest solution to understand from the end user's point of view would be to be able to use the center point of the entire area surrounded by the bounding box (not a point on the bounding box). The cat example above makes this clear. It should also be inexpensive to calculate from the perspective of CPU cycles consumed. For a possible modification https://github.com/blakeblackshear/frigate/pull/3263 I would vote to allow this choice. Anyway, congratulations on the great work you do!

arunes11 avatar Feb 10 '24 10:02 arunes11