Ask Your Question

Revision history [back]

CV_8UC3 pixel format question

I'm working on a project where I receive an image in the CV_8UC3 pixel format. According to the documentation, this would be described as 3 channel unsigned char with 8 bit depth.

My question is this: I need this image in a YUV pixel format in order for things further down the line to be happy. Can this be done using OpenCV? If not, can someone elaborate on the CV_8UC3 definition as I would need to be able to determine the FFmpeg equivalent pixel format or how to do this conversion.

tl;dr Need to go CV_8UC3 -> YUV, can't find a way to use OpenCV to do it

CV_8UC3 pixel format question

I'm working on a project where I receive an image in Thanks to berak's answer I've been able to get something going with OpenCV that uses much less code than the CV_8UC3 pixel format. According to the documentation, this would be described as 3 channel unsigned char with 8 bit depth.FFmpeg equivalent.

My question new problem is this: I need this that the resultant YUV image in a YUV pixel format in order doesn't look correct. Following tutorials for things further down saving/showing the line to be happy. Can this be done using OpenCV? If not, can someone elaborate on image, it looks like the CV_8UC3 definition as I would need to be able to determine the FFmpeg equivalent pixel format or how to do this conversion.Y and/or U component are missing.

tl;dr Need to go CV_8UC3 -> YUV, can't find a way to use OpenCV to do itBoth images: Original first, YUV second

CV_8UC3 pixel format questionquestion 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

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