0

I m new in image processing field. I have worked with bmp images but currently i have a problem at hand which needs image to be converted into YCbCr color space before further processing. I have read about YCbCr and conversion process but the problem is i have no idea how i will store the YCbCr data in image format and which image format will support it.

i mean in bmp images rgb components are stored in bgr format, bytes should be multiples of 4 etc, but what about YCbCr? how they are represented?

i m sorry if this sounds very lame. I googled it a little but the thing is i don't think i m going in right direction. Actually this is for my final project and i m running out of time.

Update: actually there is no need to store it in some image container although tiff and jpeg can be used. i get around it by just converting rgb to YCbCr processing it and then converting it back to rgb pixel by pixel.

Mat
  • 202,337
  • 40
  • 393
  • 406
jack43
  • 1
  • 2
  • There is no standard image format that stores uncompressed YCbCr so just make up your own. 3 bytes will do, one for Y, one for Cb and one for Cr. Might as well apply the JPEG transform: http://en.wikipedia.org/wiki/Ycbcr#JPEG_conversion – Hans Passant Jul 14 '12 at 15:30

1 Answers1

0

Both the formats only need three bytes for each pixel. So, as long as you store your pixels in some uncompressed format such as ppm, you do not need to bother about the conversion. When you are writing, put the Y into R, Cb int G and Cr into the blue bytes respectively. When you read in the values, it is up to to your program to interpret them - the default interpretation of most image processing programs is to treat them as RGB, but you can tell it to read them in as YCbCr

If you choose to store it in some compressed format such as jpeg, the values that you read back might not be the same as the ones that you store, but the decision depends on the accuracy that you need.

go4sri
  • 1,490
  • 2
  • 15
  • 29