How can an color image can be changed have only four color in desire area.
1 次查看(过去 30 天)
显示 更早的评论
Hello , i am doing with image segmentation and have an gray image segmented with only four different intensity level .Now how can be it convert to four different color rgb format.
0 个评论
采纳的回答
Walter Roberson
2012-10-21
[indimg, map] = rgb2ind(YourImage, 4);
newimg = ind2rgb(indimg, map);
2 个评论
Image Analyst
2012-10-21
You can create up any colormap you want to assign any graylevel range you want to the color you want. Then pass it in to ind2rgb to make a new rgb image, or just call colormap if you want to not create a new RGB image and just view your grayscale image in a pseudocolor image on the display. Do you just want to view it in color with colormap, or do you actually need a new variable in your program that represents the RGB image?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Modify Image Colors 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!