Use a different colormap for two images

3 次查看(过去 30 天)
Hi! I have two different images which I want to display on top of each other. I want to use two different colormaps. (They have different intensity ranges). I know that colormap is a property of the figure. I could not manage to do that so I decided that displaying the contour of the second image on top of the first would also work.
h = imshow(I);colormap(jet)
hold on
[C,hc]=contour(I2);
child_handles = get(hc,'Children');
Contour has the same colormap with the image as well. I wanted to control the color property of the contour by accessing the handles of each patch object. I can specify a color for each patch if necessary (but there are many patches) but I could not manage to define a colormap.
I would appreciate any help on this. Thanks, Gokcen.

回答(2 个)

Laura Proctor
Laura Proctor 2011-5-11
Each figure has its own colormap, so you wouldn't be able to have two images in the same figure with one colormap. You may have some luck by converting the images to true color images. Use the IND2RGB function to achieve this. The input values are your indexed image along with the colormap, and then the output will be a true-color image.

Walter Roberson
Walter Roberson 2011-5-11

类别

Help CenterFile Exchange 中查找有关 Orange 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by