Change bounding box color according to object position

• Hardware Platform (Jetson / GPU) NVIDIA-Jetson-Orin-Nano-Developer-kit
• DeepStream Version 6.3
• JetPack Version (valid for Jetson only) JetPack 5.1.2

Hello i’m trying to change the color of detected objects that are inside the region of interest in the deepstream-test5 , is there a way to implement this?

Thanks in advance

You need add a probe function to find this bbox and reconfigure its variables.

typedef struct _NvOSD_RectParams {
...
  NvOSD_ColorParams border_color;
                                /**< Holds the box's border color. */
....
} NvOSD_RectParams;

Thanks for your reply. I’m working on the deepstream-test5 example app. Is there a similar example that I can follow with a similar approach ?

We have similar implementations in our open-source code that you can refer to. You can refer to the bbox-border-color0 field in the source4_1080p_dec_infer-resnet_tracker_sgie_tiled_display_int8.txt file and the parsed code in the deepstream_config_file_parser.c.

I wanted to change the color of the bounding box everytime a detected object enters the roi, i have implemented inside the gie_processing_done_buf_prob Probe function, since i wasn’t able to add a probe directly in the deepstream-test5

	if (appCtx[i]->config.dsanalytics_config.enable){
	    GstPad *src_pad = NULL;
	    GstElement *nvdosd = appCtx[i]->pipeline.common_elements.osd_bin.nvosd;
		src_pad = gst_element_get_static_pad(nvdosd, "src");
	    if (!src_pad)
	    g_print ("Unable to get osd source pad\n");
	    else
	    {
	    gst_pad_add_probe (src_pad, GST_PAD_PROBE_TYPE_BUFFER,
	    osd_sink_pad_buffer_probe, NULL, NULL);
	    gst_object_unref (src_pad);
	    }
	    }
	

1)I was unable to get the osd pad, I think i might be working on the wrong pad?

2)Another question is there a way to access the detected objects inside the roi directly ? or do i have to compare the coordinates of the detected of the objects to the roi box coordinates?

Thanks for the support!

As I attached before, deepstream-test5 is using deepstream-app. You can directly use the probe function in the sample_apps\deepstream-app\deepstream_app.c file.

No. You need to access that with the coordinates or you can set some metadata by yourself to access that.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.