Ask Your Question

the1evilgenius's profile - activity

2020-06-14 15:31:02 -0600 received badge  Popular Question (source)
2013-05-22 15:27:41 -0600 received badge  Scholar (source)
2013-04-26 15:40:24 -0600 commented answer CV_8UC3 pixel format question Update

This does the trick. Would you happen to know why the resultant yuv mat looks like the Y' and maybe the U components are missing?

2013-04-26 14:21:57 -0600 commented question CV_8UC3 pixel format question Update

cv::Mat input_image = cv::imread("CustomInput.jpg"); cv::Mat output_image; cv::cvtColor(input_image, output_image, CV_BGR2YUV); cv::imwrite("/home/nmenne/hri/trunk/dsat/dsat_lsa/CustomOutput.jpg", output_image);

2013-04-26 14:20:25 -0600 received badge  Editor (source)
2013-04-26 10:59:25 -0600 commented answer CV_8UC3 pixel format question Update

YUV420 would be the desired constant, i think.

Do you know where this is documented? The cvtColor documentation doesn't have any of the YUV options listed.

2013-04-26 10:39:25 -0600 received badge  Supporter (source)
2013-04-26 09:01:56 -0600 asked a question CV_8UC3 pixel format question Update

Thanks to berak's answer I've been able to get something going with OpenCV that uses much less code than the FFmpeg equivalent.

My new problem is that the resultant YUV image doesn't look correct. Following tutorials for saving/showing the image, it looks like the Y and/or U component are missing.

Both images: Original first, YUV second