Nvdsanalytics roi filtering issues

I’ve previously been told in a forum post that the ROI filtering is calculated by testing whether the centre pixel on the bottom of a bounding box is inside or outside the region.

Is this still the case with DS5.0+ ?

I have the following config file:





Just looking at the ROI for stream 0 in the file above:


The inverse flag is set so this means that if the bottom centre pixel of any classes bounding box is INSIDE or ON that region it should be ignored.

Can you please confirm this logic?

Because… I’m finding that it works except when objects are on the bottom edge of the frame like this example:

Here is a photo of what the region of interest looks like superimposed on a camera.

Here is an example video showing the ROI not working.

At about 3.5 seconds into the clip a red shaded bounding box is shown for one frame. This was correctly detected as in the inverse ROI so should be ignored (to do so I have coloured the box red to show).

But then the very next frame is a problem. The box is not shaded which means the ROI checking has failed. This box should be ignored as the bottom centre point is within the inverse ROI area.

What I do notice however is that the box coordinates are right at the bottom and left of the screen. So the y-coordinate of the bottom centre point being checked is 1080 (1080p video feed).

Could this be an off-by-one error in the nvdsanalytics code that checks whether a point is inside an ROI or not? If its not a bug how can I handle this situation because it means any bbox that touches the bottom of the frame does not with with ROI filtering?

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Nana and Xavier NX
• DeepStream Version 5.0.1
• Issue Type( questions, new requirements, bugs) Potential bug
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)

To reproduce this issue just run a pipeline using the nvdsanalytics element and checks its ROI filtering on bboxes that are resting on the bottom of the frame. Left of the frame seems to work but bottom of frame does not.

Hey Jason, we will check it, BTW, the video you shared cannot be opened, could you help to confirm, thanks!

Thanks @bcao . I can play the video as its embedded into this devtalk site. If you still can’t play it can you let me know an alternative way I could send it to you?

Hey Jason, yeah, you can send it to me or share it via google drive since I really cannot play it.

Hi @bcao I have uploaded the example video file to google drive now and shared to anyone that has this link:

Let me know if that works.

Yeah, thanks, I can access it now, will check it and update you ASAP.

Hey Jason,
the problem here shuold be the point is on the ROI boundary and in that scenario if its normal ROI it would be considered in but in case of inverse roi its not of in, so the boundary is not included in that scenario.


1 Like

Thanks @bcao thats helps.

So to confirm if it’s a normal ROI then the line IS included.
If it’s an Inverse ROI then it excludes the line.

Yeah, exactly.