Draw rectangle


How can I draw rectangle on frame. I run deepstream-app sample (/opt/nvidia/deepstream/deepstream-4.0/sources/apps/sample_apps/deepstream-app)


I would suggest you to upgrade to DS 5.0.
For your question, refer gstnvinfer_meta_utils.cpp-> attach_metadata_detector
and https://docs.nvidia.com/metropolis/deepstream/dev-guide/DeepStream_Development_Guide/baggage/struct__NvOSD__RectParams.html

Hi @bcao ,

I have some reason so I can not use DS 5.0 now.
I run my application on deepstream-app sample for detect object. But I just want to detect obj in small area on frame, so I draw something (like rectangle) in other area on frame before start inference processing.
I tried to refer gstnvinfer_meta_utils.cpp-> attach_metadata_detector and draw rectangle in “attach_metadata_detector” function, but it’s seem to be after inference processing.

So where can I add code draw rectangle before inference processing?


You can install a probe before nvinfer and do similar logic in the probe.