Hi Marshall,
The Data between different component is Nv private structure(NvBuferSurface), which wrap the GPU buffer’s pointer.
Buffer between different component is GPU buffer, make sure your library is GPU buffer based.
Are you wanting to draw some special shape in the probe function of nvosd’s src sink?
Could you give a detail about what you want to do, then I can give you some advice about how to do.
Hi Wayne,
I want to draw a polygonal box (no need to be filled with color) on top of the video to show the region of interest.
Just like how nvosd can draw bounding boxes of the object, I thought it might be possible to pass the ROI data through a new NvDsMeta structure into nvosd. I failed while attempting this which lead me trying a different method by using the Gstreamer plug-in.
I am not sure about the cairo overlay plug-in buffer type
were you able to get it to work? I’m also trying to draw shapes and other textures on top of a video output and am having a bit of trouble figuring out where to start.
sorry for the late reply, I still haven’t managed to make it work while trying it. And since then Deepstream 3.0 was released and it seems that it has the ability to draw areas on screen using GPS positioning. You might want to see if it satisfies your project’s needs.
Deepstream 3.0 shows an example of drawing ROI for smart parking. But this solution is look like specific to smart parking use case with GPS positioning and the information of line input is not mentioned in the example. Is there any simple method to draw a line or ROI on top video?
you might want to look at the gstreamer plug-in I mentioned on the first post. Waynezhu had kindly explained what needs to be done to make it work together with Deepstream, which sadly, I still haven’t managed to get it work.
Please keep in mind this is just a suggestion and there might be better alternatives.
add a probe on src/sink pad of exisiting plugins and extract the NvBuffSurface to get raw frame data, and draw your shapes with lib like opencv;
write a custom plugin (derived from GstBaseTransform) and extract the NvBuffSurface structure in transform_ip function, also get the raw frame data, draw your shapes with lib like opencv.
the source code in gstdsexample(DeepStream 3.0 Release folder) has show you how to convert raw frame data into cv::Mat :
// Process to get the output
output = DsExampleProcess (dsexample->dsexamplelib_ctx,dsexample->cvmat->data);
you can pass the cv::Mat into a custom library from your custom plugin. it is very easy.