【发布时间】:2017-06-05 20:18:17
【问题描述】:
如何将减少的颜色 imshow 存储在图像对象中,以便进一步将其用于其他分析。
来源:
I = imread('C:\eg.jpg');
[X_no_dither,map]= rgb2ind(I,8,'nodither');
figure, imshow(X_no_dither,map)
【问题讨论】:
如何将减少的颜色 imshow 存储在图像对象中,以便进一步将其用于其他分析。
来源:
I = imread('C:\eg.jpg');
[X_no_dither,map]= rgb2ind(I,8,'nodither');
figure, imshow(X_no_dither,map)
【问题讨论】:
您可以使用ind2rgb 将其返回转换为使用新索引图像和颜色图的 RGB 图像
rgb_image = ind2rgb(X_no_dither, map);
如果需要,您可以将生成的图像保存到带有imwrite 的文件中
imwrite(rgb_image, 'newimage.png')
【讨论】: