displaying classification image
2 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Sean de Wolski
2011-12-20
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Blue 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!