YCbCr input directly from jpeg loader

1k views Asked by At

I need to extract CbCr chroma data from JPEG images, for image analysis. (in C/C++)

  1. As I understand it, the JPEG "raw data" is compressed YCbCr. Am I correct in this assumption? How can I verify this for a given image?

  2. I am currently using TubroJpeg lib. The documentation of tjDecompressToYUV says that it:

Decompress a JPEG image to a YUV planar image. This function performs JPEG but leaves out the color conversion step, so a planar YUV is generated instead of an RGB image.

I am a bit confused as to the output of this function. I thought that YUV and YCbCr were slightly different color spaces. Does this mean that for UV chroma I'd need to manipulate the output, and that the output "UV" components are actually CbCr components ?

1

There are 1 answers

1
user3344003 On BEST ANSWER

The JPEG standard has no knowledge of color spaces. It simply compresses color components.

If is the specific file format (e.g. JFIF, EXIF, ADOBE) that specifies the color format. In most cases it is YCbCR. In some cases it is not (some adobe).

This link may explained the confusion

http://en.wikipedia.org/wiki/Yuv#Confusion_with_Y.27CbCr

YUV and YCbCR are similar, but different. If there is no color conversion, I have to believe that they have confused YUV and YCbCr.