Feature request for nvdsanalytics element

I’ve been using the nvdsanalytics plugin and so far it’s working great, but I’ve got two feature requests which I think are must haves to be usable in production environments…

(1) shading of ROI. Please allow us to set a color and opacity for the ROI polygons.
This would allow us to shade areas that we wish to ignore - like a privacy area. Eg. you have a camera looking at a car park near a road but want to ignore the cars on the road. Would be handy to visualise this with shading instead of just yellow lines as the plugin does now.

(2) instead of using the bottom center of a bounding box as the test point to see if it’s in or out of an ROI; test whether the entire bbox is in or out of the ROI.
For a convex polygon (Convex polygon - Wikipedia) this is easy and you just perform the same test that you are doing already, but for all four bbox corners.
For a concave polygon it’s a bit harder as you need to perform a line crossing test between each line in the bbox and each line in the polygon.
Just convex polygons would be good enough. Concave is for weird regions that are star-shaped for example.

• Hardware Platform (Jetson / GPU) ALL
• DeepStream Version 5.0dp

Hey Jason,
For 1, currently you can do it by accessing display meta in probe, and we will discuss internally if we will support it in the plugin
For 2, we had discussed it in Nvdsanalytics element - ROI - strange behaviour , and we will support this feature in later release not the upcoming release.

Hi @bcao Thankyou for that info…

Great news about point (2) - looking forward to it.

Can you explain point (1) in a bit more detail for me? How would I I shade the ROI in the display meta structure? Any examples available?

I know how to add text and lines to the frame using display_meta - but here I am talking about shading the ROI used by the nvdsanalytics plugin…

Hey Jason, try bellow code, the alpha can change the visibility, transperency, it should work.

   rect_params->has_bg_color = 1;
    rect_params->bg_color.red = 0.8;
    rect_params->bg_color.green = 0.2;
    rect_params->bg_color.blue = 0.2;
    rect_params->bg_color.alpha = 0.9;

Thanks again… but I don’t understand. I know how to use display_meta. I already use it in my apps to draw on frames.

But I’m talking about the nvdsanalytics plugin.
When you use this plugin and configure it with an ROI it is drawn on each frame in yellow.
I’m wanting to shade this ROI which is drawn by the plugin.

Maybe it’s possible to search for existing display_meta and modify it.

Yeah, currently we don’t support it by setting the plugin’s config

@bcao How is the display meta setup and attached to the frame to find the ROI drawn by the nvdsanalytics element?

display_meta contains NvOSD_LineParams but these describe single lines with no way to color the area contained in an ROI.

Oh, currently we only support shading rectangle as my previous comment, for shading the ROI(polygon), we need to add the support in OSD plugin, so pls wait for later release.

ok thankyou…

@bcao an option to hide the polygon would be good too so you don’t see it drawn on each frame in yellow…

We had added the feature in our roadmap.

1 Like