Plotting rectangle on image in Deepstream

I am facing this issue for more than 3-4 months and still don’t have way to solve the issue.
No engineer from Deepstream group can give me proper suggestion.

I have a few posts regarding this issue.
https://forums.developer.nvidia.com/t/issue-with-plotting-on-image-in-deepstream-app/185932
https://forums.developer.nvidia.com/t/plot-rectangle-on-image/185701/11
https://forums.developer.nvidia.com/t/add-data-to-draw-mask-in-deepstream/187416/5
Still issue is not solved yet.

Basically I like to plot rectangle on image display.
For example, I have illegal parking detection. Vehicle detection gie gives me bounding box. Using those boxes, I have one more layer of illegal parking detection. The illegal parking detection is implemented in gst-dsexample plugin.
After detection, I need to highlight the vehicle. My requirement is very meaningful.

But so far no engineer from Deepstream can pin point me what api to use.

In the attached image, green boxes are vehicle detection gie draws boxes.
After illegal parking detection in gst-dsexample, I need to highlight, this car is illegally parked car (like yellow box drawn manually).
How can I draw box in deepstream?

I used Opencv to draw box, but Opencv has moemory leak in Deepstream to draw boxes.

Suppose DS samples can draw BB. If you want to change BB, can you check display_meta->rect_params? Please refer below source code.

/opt/nvidia/deepstream/deepstream-6.0/sources/apps/sample_apps/deepstream-test1/deepstream_test1_app.c

Yes thanks I can change color like the following.

for (l_obj = frame_meta->obj_meta_list; l_obj != NULL; l_obj = l_obj->next) {
            obj_meta = (NvDsObjectMeta *) (l_obj->data);
            if (obj_meta->class_id == PGIE_CLASS_ID_VEHICLE) {
                vehicle_count++;
                num_rects++;
                obj_meta->rect_params.border_color.red = 0.0;
                obj_meta->rect_params.border_color.green = 1.0;
                obj_meta->rect_params.border_color.blue = 0.0;
                obj_meta->rect_params.border_color.alpha = 1.0;
                obj_meta->rect_params.border_width = 15;
            }
            if (obj_meta->class_id == PGIE_CLASS_ID_PERSON) {
                person_count++;
                num_rects++;
            }
        }
1 Like

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