matlab 灰度图与索引图

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Rem_little_fan_boy/article/details/81088517
P=imread('lem.jpg')
subplot(2,2,1)
imshow(P)
title('原版雷姆')
L=rgb2gray(P)
subplot(2,2,2)
imshow(L)
title('灰灰的雷姆')
[X,map]=gray2ind(P)
subplot(2,2,3)
imshow(X)
title('灰度图到索引图的X矩阵')
subplot(2,2,4)
imshow(map)
title('灰度图转化为索引图的调色板')

运行结果:

猜你喜欢

转载自blog.csdn.net/Rem_little_fan_boy/article/details/81088517