Matlab figure flashes back and forth between black&white and color

瘦欲@ 提交于 2019-12-12 00:23:10

问题


I'm trying to display a color disparity map, but it first displays black and white until I do 'colormap jet' then it's in color.

How can black and white image be suppressed?

            imshow(disparityMap, DisparityRange ); 
            title('DISPARITY MAP');
            colormap jet;

回答1:


Specify the colormap parameter to imshow.

imshow(disparityMap, DisparityRange, 'colormap', jet);

Example use

im = imread('cameraman.tif');
imshow(im, [60,200], 'colormap', hsv);

We get this image:



来源:https://stackoverflow.com/questions/31975182/matlab-figure-flashes-back-and-forth-between-blackwhite-and-color

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!