MATLAB rgb2ycbcr | MATLAB YCbCr
ConvertImagefromRGBtoYCbCrReadanRGBimageintotheworkspace.RGB=imread(board.tif);ConverttheimagetoYCbCr.Displaytheoriginalimageandthenewimagefigureimshow(RGB);title(ImageinRGBColorSpace);figureimshow(YCBCR);title(ImageinYCbCrColorSpace);ConvertColormapfromRGBtoYCbCr.Loadanindexedimageintotheworkspace.ThecolormapisinRGBcolorspace.[I,map]=imread(forest.tif);ConvertthecolormaptoYCbCr.Displaythegrayscaleimagewiththeoriginalmapandwiththenewmap.figureimshow(I,map)title(IndexedImagewithRGBColormap);f...
Convert Image from RGB to YCbCr
Read an RGB image into the workspace.
RGB = imread(board.tif);Convert the image to YCbCr.
Display the original image and the new image
figure imshow(RGB); title(Image in RGB Color Space);figure imshow(YCBCR); title(Image in YCbCr Color Space);Convert Colormap from RGB to YCbCr.
Load an indexed image into the workspace. The colormap is in RGB colorspace.
[I,map] = imread(forest.tif);Convert the colormap to YCbCr.
Display the grayscale image with the original map and with the new map.
figure imshow(I,map) title(Indexed Image with RGB Colormap);figure imshow(I,newmap) title(Indexed Image with YCbCr Colormap);