How to show different colours as different regions (by assigning different grey level values to each region corresponding to a particular colour)
3 views (last 30 days)
Show older comments
Accepted Answer
Walter Roberson
on 9 May 2017
Use a labeled array and ind2rgb()
2 Comments
Walter Roberson
on 9 May 2017
Start with (for example) http://blogs.mathworks.com/steve/2006/11/17/labeling-labeled-objects/ . Once you have the L matrix, pass it to ind2rgb() along with a colormap; see https://www.mathworks.com/help/matlab/ref/ind2rgb.html
More Answers (0)
See Also
Categories
Find more on Colormaps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!