What's the best way to rotate image 180 degrees in Libargus?

I wish to rotate the collected images by 180 degrees. I’m using Libargus example 09_argus_camera_jpeg with Orin Nano with devkit 35.3.1 and a Sony IMX296 sensor.

I tried transforming the surface using the following Transform parameters, but it didn’t work. What would be a good alternative? Is there any good documentation on this?

    NvBufSurf::NvCommonTransformParams transform_params = {
        .src_width = width,
        .src_height = height,
        .src_top = 0,
        .src_left = 0,
        .dst_width = width,
        .dst_height = height,
        .dst_top = 0,
        .dst_left = 0,
        .flag = NVBUFSURF_TRANSFORM_FILTER,
        .flip = NvBufSurfTransform_Rotate180,
        .filter = NvBufSurfTransformInter_Algo3, 
    };

You can try the flip-method of the nvvidconv or program sensor REG for it.

@ShaneCCC Like I said, I’m not using Gstreamer for this. I would like to extend the Argus example 09 to be able to flip the image. Is there a reason why transforming with the NvCommonTransformParams won’t work?

Also, can you show/explain which sensor register to program?

You need consult with sensor vendor for the REG setting due to each sensor is different REG setting.
Also you can try below API.

https://docs.nvidia.com/jetson/l4t-multimedia/group__V4L2Conv.html#ga3a54aa5b2a122cd5212926a59aae0eab

Hi,
Please try the setting:

        .flag = NVBUFSURF_TRANSFORM_FILTER | NVBUFSURF_TRANSFORM_FLIP,

That worked! Thank you @DaneLLL.

One addition:
I also needed to cast the rvalue to NvBufSurfTransform_Transform_Flag like so

.flag = (NvBufSurfTransform_Transform_Flag)(NVBUFSURF_TRANSFORM_FILTER |
                                                        NVBUFSURF_TRANSFORM_FLIP),
1 Like

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