| Image Processing Toolbox™ | ![]() |
ycbcrmap = rgb2ycbcr(map)
YCBCR = rgb2ycbcr(RGB)
ycbcrmap = rgb2ycbcr(map) converts the RGB values in map to the YCbCr color space. map must be an M-by-3 array. ycbcrmap is an M-by-3 matrix that contains the YCbCr luminance (Y) and chrominance (Cb and Cr) color values as columns. Each row in ycbcfmap represents the equivalent color to the corresponding row in the RGB colormap, map.
YCBCR = rgb2ycbcr(RGB) converts the truecolor image RGB to the equivalent image in the YCbCr color space. RGB must be a M-by-N-by-3 array.
If the input is uint8, YCBCR is uint8, where Y is in the range [16 235], and Cb and Cr are in the range [16 240]. If the input is a double, Y is in the range [16/255 235/255] and Cb and Cr are in the range [16/255 240/255]. If the input is uint16, Y is in the range [4112 60395] and Cb and Cr are in the range [4112 61680].
If the input is an RGB image, it can be of class uint8, uint16, or double. If the input is a colormap, it must be double. The output image is of the same class as the input image.
Convert RGB image to YCbCr.
RGB = imread('board.tif');
YCBCR = rgb2ycbcr(RGB);Convert RGB color space to YCbCr.
map = jet(256); newmap = rgb2ycbcr(map);
For a full list of the toolbox color space conversion functions, see Color Space Conversions.
[1] Poynton, C. A.A Technical Introduction to Digital Video, John Wiley & Sons, Inc., 1996, p. 175.
[2] Rec. ITU-R BT.601-5, Studio Encoding Parameters of Digital Television for Standard 4:3 and Wide-screen 16:9 Aspect Ratios, (1982-1986-1990-1992-1994-1995), Section 3.5.
![]() | rgb2ntsc | roicolor | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |