YUV420 to BGR image from pixel pointers
I am capturing raw output from a decoder which is YUV420. I have got three pointers: Y(1920*1080), U(960*540) and V(960*540) separately. I want to save the image as JPEG using OpenCV. I tried using cvtcolor of opencv cv::Mat i_image(cv::Size(columns, rows), CV_8UC3, dataBuffer); cv::Mat i_image_BGR(cv::Size(columns, rows), CV_8UC3); cvtColor(i_image, i_image_BGR, cv::COLOR_YCrCb2BGR); cv::imwrite("/data/data/org.myproject.debug/files/pic1.jpg", i_image_BGR); But, here is the output image which is saved: Can someone please suggest what is the proper way of saving the image? YUV Binary files for