Nvdsanalytics element - ROI - strange behaviour

I’m using the analytics plugin and in general its working great however I’ve noticed some strange behaviour that I’m hoping someone can explain.

I have frame size 1920 x 1080.

If provide this polygon:

0;0;0;320;920;0;0;0 inverse TRUE

It works well. This polygon is just a triangle in the top-left of the frame. As I have inverse=true it should ignore all objects inside the triangle.

This works well. bboxes are ignore only if they are “completely” inside the triangle. When ignored they are drawn red. If a little of the bbox is outside the triangle the bbox turns blue and its a valid detection.

Now if I try this polygon:

68;335;488;751;956;326;646;85;68;335 inverse TRUE

This is roughly a rectangular area in the middle of the frame.

With this polygon bboxes that are only 50% inside the polygon are red and ignored. Thats weird right? Based on the previous polygon the bbox had to be completely 100% inside the polygon for it to be ignored.

So why are bboxes that are only partially inside this polygon ignored?? (note they should be ignored because I have set inverse=true).

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Xavier NX / Nano
• DeepStream Version 5.0dp

1 Like

This is because the bbox bottom center is considered for ROI intersection,
as based on camera position the bbox might not be tight enough for the object

1 Like

Thanks @bcao,

Can you please explain that a little more… Are you saying the ROI algorithm only checks if the center of the bottom bounding box line is in or out of the ROI ?

Hmmm… Would be nice if this could be changed if thats correct. For creating “privacy regions” on a frame (a privacy region being an ROI with inverse=1) this only really works for areas at the top of the frame then.
Because if you have an area near the bottom - or even center of the frame, almost the entire object can be outside the region yet it will be flagged as if its inside if just the bottom 1 pixel of the bbox in in the ROI.

I was hoping you were using an algorithm to detect if the enter bbox was inside (or outside) the region of interest.

Correct.

enter bbox–>you mean the entire bbox?

We will discuss about it internally, and to see if we can support it and maybe we can add a config to switch the entire bbox mode or bottom center mode

Yes the entire bbox. If this was enabled then you can use this functionality to have “privacy regions” (or alternatively activity regions - where you only want to count/use bboxes in a region).

For example it is very common when detecting objects to want to ignore a certain area - ie a road in the distance at the top-right of the frame for example. But it relies on the entire bounding box being considered and not just the bottom.
For a convex polygon it would not be much additional logic - you would need to just check the 4 points of the bbox rectangle.
However if its concave (star-shaped for example) then its more difficult. From what I’ve read - in this convex case you need to do a line intersection test from each line in the bbox with every line in the polygon…

Thanks for your suggestions, yeah, we will discuss internally and give you a response.

1 Like