Visualize output data with OpenCV

I am using a modified version of default deepstream-app code and gstdsexample code to build my pipeline. I am using a single RTSP sourcer as input. Now, my input data has to be reshaped after inference and then needs to be rendered on screen. Since deepstream pipeline in itself doesn’t support reshaping of data as discussed in here. I thought of making a copy of the original data in a separate cv::Mat , perform resdhaping and then render that matrix on screen using cv::imshow. I tried doing thisd both inside gstdsexample and gie_primary_processing_done_buf_prob. I am able to successfully copy and reshape the new cv::Mat but when I do imshow, nothing happens and it seems my pipeline stops working. How to achieve this? I have limited knowledge in workings of gstreamer and prefer OpenCV functions anyday. KIndly help.

Note: I am not doing cv::imshow on a separate thread. All the functional calls are serial.

It should not work to run imshow in gstdsexample since it is in middle of the pipeline. The pipeline has nvoverlaysink or nveglglessink already. The working case is to link with appsink and call imshow(). Below is a reference sample:

1 Like