Matlab里面关于colormap的问题
答案:2 悬赏:0
解决时间 2021-02-12 14:20
- 提问者网友:✐ۖ﹏ℳ๓北风
- 2021-02-12 01:52
Matlab里面关于colormap的问题
最佳答案
- 二级知识专家网友:悲观垃圾
- 2021-02-12 02:41
clear;clc;
cmap=[0 0 0;1 1 1;1 0 0;0 1 0;0 0 1];
A=randint(5,5,[1,4])
image(A);colorbar;colormap(cmap);
figure;
imagesc(A);colorbar;colormap(cmap);
figure;
B=unifrnd(1,4,5)
imagesc(B);colorbar;colormap(cmap);
cmap=[0 0 0;1 1 1;1 0 0;0 1 0;0 0 1];
A=randint(5,5,[1,4])
image(A);colorbar;colormap(cmap);
figure;
imagesc(A);colorbar;colormap(cmap);
figure;
B=unifrnd(1,4,5)
imagesc(B);colorbar;colormap(cmap);
全部回答
- 1楼网友:哥在撩妹请勿打扰
- 2021-02-12 02:47
那要看你的用imread函数读出的img是什么类型的数据
如果得到的img是个三维的int8矩阵,表示img是用rgb三通道表示的矩阵
需要转为灰度图再画图,并更改colormap,如下
i = rgb2gray(img);
imagesc(i);
colormap(jet);
如果得到的图像就是二维的int8,或者是二维的0到1之间的浮点数直接用
imagesc(img);
colormap(jet);
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯