What can I do with NvBufSurfTransform?

• Hardware Platform (Jetson / GPU) Jetson Nano
• DeepStream Version 5.0
• JetPack Version (valid for Jetson only) 4.4-b144
• TensorRT Version 7.1.3
• Issue Type( questions, new requirements, bugs) question


I am wondering what is possible to do by exploiting NvBufSurfTransform.
Looking at this page: NVIDIA DeepStream SDK API Reference: Image Transformation and Compositing API there are a number of possibilities, for example:

id description
NvBufSurfTransform_None Specifies no video flip.
NvBufSurfTransform_Rotate90 Specifies rotating 90 degrees clockwise.
NvBufSurfTransform_Rotate180 Specifies rotating 180 degree clockwise.
NvBufSurfTransform_Rotate270 Specifies rotating 270 degree clockwise.
NvBufSurfTransform_FlipX Specifies video flip with respect to the X-axis.
NvBufSurfTransform_FlipY Specifies video flip with respect to the Y-axis.
NvBufSurfTransform_Transpose Specifies video flip transpose.
NvBufSurfTransform_InvTranspose Specifies video flip inverse transpose.

But I also see:

id description
NVBUFSURF_TRANSFORM_CROP_SRC Specifies a transform to crop the source rectangle.
NVBUFSURF_TRANSFORM_CROP_DST Specifies a transform to crop the destination rectangle.
NVBUFSURF_TRANSFORM_FILTER Specifies a transform to set the filter type.
NVBUFSURF_TRANSFORM_FLIP Specifies a transform to set the flip method.


I am asking this because I would like to multiply every single pixel of a buffer by a matrix that is mixing the colors.
new_pixel(i,j) = M * pixel(i,j)
Something that I can obtain in OpenCV with cv.transform API: Operations on Arrays — OpenCV documentation

Finally, is there any example of this API: NvBufSurfTransformCompositeBlend ?

Thank you very much!!

its for scaling and conversion

For NvBufSurfTransformCompositeBlend, currently we don’t have a sample yet.