-
-
. . word.zl
close all
RGB=imread('flowers.tif');
[R_i1,map]=rgb2ind(RGB,8);%RGB图像转换为 8 色的索引图像
[R_i2,map]=rgb2ind(RGB,32);%RGB图像转换为 32 色的索引图像
[R_i3,map]=rgb2ind(RGB,256);%RGB图像转换为 256色的索引图像
[R_i4,map]=rgb2ind(RGB,1024);%RGB图像转换为 1024色的索引图像
Subplot(221);imshow(R_i1,map);title('8色的索引图像 ');
Subplot(222);imshow(R_i2,map);title('32色的索引图像 ');
Subplot(223);imshow(R_i3,map);title('256色的索引图像 ');
Subplot(224);imshow(R_i4,map);title('1024色的索引图像 ');
结论:随着索引值的增加图像的质量也有增加,更加清晰,色彩也更加鲜明。但
不是不是颜色值越多越好。 当索引值过高时, 会出现无法识别而致模糊的情况出