hello community,
I have a classified image with class labels 1, to 5. I want to display it with different colors. I can do that with choosing a particular colormap like jet. But the problem is i dont have a complete control over colors that colormap assings to the image. What i meant, is lets say i want to display 1 as green, and 2 as blue so that it represent true class color.
So my questions is how to have a complete control of colors that is used in colormaps ?Is there any interactive way of do this, say assign green for 1, blue for 2, something like class mapping in ENVI ?
thanks sukuchha

 채택된 답변

Sean de Wolski
Sean de Wolski 2011년 12월 20일

0 개 추천

Use label2rgb with custom built colormap:
for blue green red
Limage = your_label_image;
map = [0 0 1; 0 1 0; 1 0 0]; %etc nx3 colormap of RGB triplets
I = labelrgb(Limage,map)
You could use the lines() function to generate a random colormap as well.
doc lines
doc label2rgb

댓글 수: 4

Sukuchha
Sukuchha 2011년 12월 21일
thanks,
i got your point, implemented with label2rgb way ! So there is no interactive way to do it ? with some sort of color picker ?
Sean de Wolski
Sean de Wolski 2011년 12월 21일
Something like colormapeditor to make the colormap?
doc colormapeditor
Sukuchha
Sukuchha 2011년 12월 22일
thanks sean,
thats what i wanted to have!
have a wonderful x-mas and new year !
T
T 2018년 7월 26일
if we have set of images how to do that?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Blue에 대해 자세히 알아보기

질문:

2011년 12월 20일

댓글:

T
T
2018년 7월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by