Gst-dsexample plugin can't crop and extract detection

Please provide complete information as applicable to your setup.

• Hardware Platform (GPU)
• DeepStream Version 5.1.0
• JetPack Version (valid for Jetson only)
• TensorRT Version 7.2.2.2
• NVIDIA GPU Driver Version (465.19.01)
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

I was trying to implement the Gst-dsexample plugin to crop and extract the detection in each frame. I was following this post tutorial:

So basically in the get_converted_mat() method, the following code were added:

...
  // Use openCV to remove padding and convert RGBA to BGR. Can be skipped if
  // algorithm can handle padded RGBA data.
  in_mat =
      cv::Mat (dsexample->processing_height, dsexample->processing_width,
      CV_8UC4, dsexample->inter_buf->surfaceList[0].mappedAddr.addr[0],
      dsexample->inter_buf->surfaceList[0].pitch);

#if (CV_MAJOR_VERSION >= 4)
  cv::cvtColor (in_mat, *dsexample->cvmat, cv::COLOR_RGBA2BGR);
#else
  cv::cvtColor (in_mat, *dsexample->cvmat, CV_RGBA2BGR);
#endif

  std::string IMpath = "/home/img/";
  IMpath = IMpath + std::to_string(dsexample->frame_num) +"_new" + ".png";
  cv::imwrite(IMpath, *dsexample->cvmat);

But when I run the following pipeline, I always couldn’t get the cropped images in the predefined path, what’s wrong?

The blog is not published by Nvidia. You can ask the author for support.

If you have found anything wrong with deepstream, please tell us how to reproduce the problem.

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