image overlay

Hi team,

How can we add image overlay? example logo?

any code samples?

Hi,
For more information, you would like to put a logo in JPG/PNG( such as https://en.wikipedia.org/wiki/File:Nvidia_image_logo.svg ) on top-left( or other position ) of the screen?

Hi Dane,

Logo yes, also in our case, we detect a red car, etc, we would like to display on the screen.

Hi,
The nvosd plugin should be able to mark detected red car in rectangle. Is it not good in your usecase?

we need to crop the image and display it on the live screen.

but if you can provide an example of image overlay, we will figure out rest.

Hi,
There is no existing implementation for this. We suggest you use NvBufSurface APIs. The APIs offer complete access to the buffers. Please check

deepstream_sdk_v4.0.1_jetson\sources\includes\nvbufsurface.h
deepstream_sdk_v4.0.1_jetson\sources\includes\nvbufsurftransform.h

There is examples of using the APIs in dsexample. Also 2, 5 in FAQ. 2 is a sample of cropping the objects and saving into JPGs. For instant display, maybe you can try to replace cv::imwrite() with cv2.imgshow().

This too

Hi,
NvBufSurfTransformComposite() can be called to composite a logo on video frames.

You can call cv::imread() to decode JPG/PNG, and put it into a NvBufSurface buffer.

//create a NvBufSurface buffer
NvBufSurfaceCreate();
// get CPU pointer
NvBufSurfaceMap();
cv::Mat source = cv::imread();
/* copy cv::Mat source to the NvBufSurface */
NvBufSurfaceSyncForDevice();
NvBufSurfaceUnMap();

Configure NvBufSurfTransformCompositeParams and call NvBufSurfTransformComposite().