How to access NvDsAnalytics ROIInfo object

• Hardware Platform (Jetson / GPU) Jetson
• DeepStream Version 6.3
• JetPack Version (valid for Jetson only) 5.1.3
• Issue Type( questions, new requirements, bugs) Question
• Requirement details

Hello,

I am building an application using the nvdsanalytics plugin with roi-filtering-stream module.

I have two questions regarding this, one specific to the plugin and one that is more generic.

Specific question

Using the roi-filtering-stream, i want to retrieve the value of the inverse-roi property.
From my researches, i have to access to the ROIInfo element to retrieve the information.

The way to access this object can be : GstNvDsAnalyticsStreamInfoROIInfo.

I am trying to access the information from the process_buffer(GstBuffer * buf, AppCtx * appCtx, guint index) function but I can’t access the elements I need.
Do you have any insight on how to access it ?

Generic question

I always find the information needed using the SDK documentation but it always takes me long to figure how to retrieve these objects or information from the process_buffer or process_metafunctions.

Do you have an efficient way to make the link between the SDK documentation and the code to know which path (i.e which object sequence) use to retrieve the required information and how to access them ?

If you have any information on these subjects, I’d be very interested !

Hello,

I manage to get access to the information needed in a way.

  1. I Modified the gst-nvdsanalytics plugin and more precisely the gstnvdsanalytics.cpp file.
    It is possible to retrieve the inverse-roi data from the attach_framemeta_analytics_metadata function. Then, I used the misc_frame_info in NvDsFrameMeta to store the status (1 if inversed) of the ROI.
    image.
    → frame_meta->misc_frame_info[0] = 1;

  2. I can retrieve this information in the process_meta function using :
    → frame_meta->misc_frame_info[0];

  • Can you tell me if it is a common way to achieve the goal ? If not what are other possibilities ?
  • Are the misc_info fields designed for this kind of use ?
  • Is there a reason why the misc_info can only contain gint64 (whether it is frame_meta, batch_meta, …)

Once again, if there is any useful tool to quickly know how to access a specific element, it would greatly helps !

Tell me if you need more information, i would be happy to share them.

  1. nvanalytics plugin is opensource from DS6.3, inverse-roi is saved in nvdsanalytics->stream_analytics_info ->roi_info.
  2. please refer to nvanalytics plugin code. please refer to sample deepstream-nvdsanalytics-test for how to get analytics results from meta data.

Hello,

Thanks for your reply !

As explained, i already found on the documentation that the inverse-roi is saved in nvdsanalytics->stream_analytics_info ->roi_info.

My question was more about if the way i modify the plugin and the use of frame_meta->misc_frame_info was correct or not ?

Afterwards, i was wondering if there were an easy way to know which part of the code to modify in order to have access to a parameter or another (depending of the needs) because i am often search for a long time to find the right place.

Thanks in advance,

/** Holds additional user-defined frame information. */
gint64 misc_frame_info[MAX_USER_FIELDS];
you are right. as the comment shown, it is for user-defined frame information.
the more genareal method is add user meta for frameframe. if using user meta, there is not data length limitaion. please refer to deepstream-user-metadata-test for how to add user meta.