필터 지우기
필터 지우기

Use a different colormap for two images

조회 수: 5 (최근 30일)
Gökçen
Gökçen 2011년 5월 11일
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에서 Red에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by