RGB1 = imread(‘autumn.tif’);%读取图像
RGB2 = imread(‘peppers.png’);%读取图像
X1 = rgb2ind(RGB1,colorcube(128));%转化为索引图像
X2 = rgb2ind(RGB2,colorcube(128));%转化为索引图像
subplot(121); imshow(X1); subplot(122); imshow(X2);%显示图像
load trees
[Y,newmap] = imapprox(X,map,64); %近似匹配
imshow(Y, newmap); %显示近似匹配后的图像
rgb=imread(‘onion.png’); %读取图像
figure; imshow(rgb);%显示原图像
[X_no_dither,map]= rgb2ind(rgb,8,‘nodither’);%不使用抖动转化图像
figure, subplot(121), imshow(X_no_dither,map);
[X_dither,map]=rgb2ind(rgb,8,‘dither’);%使用抖动转化图像
subplot(122), imshow(X_dither,map);
MATLAB彩色图像处理
于 2021-03-27 08:11:02 首次发布