MATLAB彩色图像处理二

RGB = imread(‘board.tif’);%读取图像
NTSC = rgb2ntsc(RGB);%转换到NTSC空间
RGB2 = ntsc2rgb(NTSC);%转换到RGB彩色空间
figure,
subplot(121); imshow(NTSC);%显示NTSC空间的图像
subplot(122); imshow(RGB2)%显示RGB彩色空间的图像
在这里插入图片描述
RGB = imread(‘board.tif’);%读取图像
YCBCR = rgb2ycbcr(RGB);%把RGB彩色空间图像转换到YCbCr空间
figure,
subplot(121); imshow(RGB); %显示RGB空间图像
subplot(122); imshow(YCBCR); %显示YCbCr空间图像
在这里插入图片描述
I_rgb = imread(‘peppers.png’);%读取图像
C = makecform(‘srgb2xyz’);%创建色彩变换结构
I_xyz = applycform(I_rgb,C);%应用色彩变换结构
figure;
subplot(121); imshow(I_rgb); subplot(122); imshow(I_xyz);
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/m0_38127487/article/details/115259317