different colours for images

I have an image in which i need different colours for each regions
for example my original image is
i need as
please help

답변 (2개)

Walter Roberson
Walter Roberson 2012년 5월 14일

0 개 추천

Convert the RGB image to indexed. Change the colormap.

댓글 수: 3

Pat
Pat 2012년 5월 14일
Walter i tried
I=imread('imagesh1.bmp');
imshow(I)
[IND,map] = rgb2ind(I,4);
imagesc(IND)
colormap(jet)
bu did not get the figure as i posted above in link,please help
Image Analyst
Image Analyst 2012년 5월 15일
That's because your image has already been pseudocolored. What you did will work but essentially is just random colors. You need the original multispectral images - a set of monochrome images taken at each wavelength. Then see my color classification demos in my File Exchange. But even that won't do it because there is more than just color classification going on, as you can see from a careful inspection of the image. Why don't you replicate the method used in the paper?
Pat
Pat 2012년 5월 15일
Can u please say how to replicate that method used in paper please
Image Analyst
Image Analyst 2012년 5월 14일

0 개 추천

You need to do color classification on the image. Look in each spectral band and do whatever you need to do to get a classified image. This could be gray level segmentation, texture segmentation, or some higher level conceptual classification (trees, buildings, etc.). Once you have a gray level image where each number represents a class (e.g. 0=water, 1=forest, 2=road, 3=buildings), then you can apply a colormap to make it more visually distinct. Go here for articles on classification: http://iris.usc.edu/Vision-Notes/bibliography/contentscartog.html#Cartography,%20Aerial%20Images,%20Remote%20Sensing,%20Buildings,%20Roads,%20Terrain,%20ATR

댓글 수: 1

Pat
Pat 2012년 5월 15일
Walter i lookes at it ,but could not understand how to start with,can u write codes for me please

이 질문은 마감되었습니다.

질문:

Pat
2012년 5월 14일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by