How to black out regions of interest (ROI) in a stream before processing in the pipeline?

• Hardware Platform (Jetson / GPU) Jetson
• DeepStream Version 6.3
• JetPack Version (valid for Jetson only) 5.1.2 / 6
• Issue Type( questions, new requirements, bugs) questions

Could you describe your scenario in detail?

Sure, So my requirement is that I am running a deepstream pipeline to detect persons and vehicles and I need to mask specific regions in a stream from detecting objects due to privacy reasons. So the stream needs to be blacked out on the specified regions before we send that into the pipeline for processing.

Something like this blacking out needs to be done for the incoming stream,

OK. You can get the NvDsObjectMeta in the probe function and set the obj_meta->rect_params.bg_color to the colors you need.

Does NVIDIA provides any plugin or anything out of the box solution to this?
Any references?

This feature can be handled within the probe function and does not require a plugin.

  1. you can refer to our sources\apps\sample_apps\deepstream-test4\deepstream_test4_app.c to get the bbox
osd_sink_pad_buffer_metadata_probe
...
obj_meta->rect_params
...
  1. set the background color to the bbox
//black background color
obj_meta->rect_params.bg_color=(0,0,0,1)

Yeah, but I want to black out a specific polygon region in the input stream even before processing it with the model in the pipeline.

I think this has to be done in one of the following plugins,
“rtsp-source-> h264-depay → tee-> queue → decoder ->nvstreammux”

OK. We don’t support the polygon region for your feature. You can only try to use nvdspreprocess to implement the rectangle region for that.

Any reference example application available for using nvdspreprocess ?

We have many demos for nvdspreprocess. You can refer to deepstream-pose-classification first.

  1. nvdspreprocess_lib is the lib for writing your own algorithms.
  2. config_preprocess_bodypose_classification.txt is the config file.

Do these contain the configuration I expect? that is changing the colour inside an ROI before running the inference?

No. This is just a demo of how to use nvdspreprocess. You need to setup your own configuration according to your model and implement your own algorithms to change the colour of your ROI.

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

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