Ask Your Question
0

Convert NV12 to RGB

asked 2016-08-25 13:35:48 -0600

Karthikgowda gravatar image
        Mat yuv(720,1280, CV_8UC3);//I am reading NV12 format from a camera
         Mat rgb;

        cvtColor(yuv,rgb,CV_YUV2RGB_NV12);
       The resolution of rgb after conversion is 480X720

        cvtColor(yuv,rgb,CV_YCrCb2RGB);
       The resolution of rgb after conversion is 720X1280

However, using the above conversion I am not able to display a proper view of the images

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-06-10 05:34:45 -0600

Tuomx gravatar image

I make it with this answer from stackoverflow(https://stackoverflow.com/questions/18737842/creating-a-mat-object-from-a-yv12-image-buffer/44472269#44472269)

Understanding the nv12 format will help you to understand the code.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-08-25 13:35:48 -0600

Seen: 16,187 times

Last updated: Jun 10 '17