How could I add colors to regions in a global map?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Robert
am 21 Okt. 2018
Beantwortet: Image Analyst
am 21 Okt. 2018
Hi,
Wondering if is an easy and quick way to add colors to regions in a global map (matrix)?
Like this...(attached figure).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192231/image.png)
I would like to make a "mask map" with different numbers for the regions (colors) (e.g. South Pacific = 1, North Pacific = 2, etc) and then extract from a global map (matrix) the values for South Pacific = 1, North Pacific =2, etc.
In this case, the global map is a matrix with ocean temperature data.
1 Kommentar
Akzeptierte Antwort
Image Analyst
am 21 Okt. 2018
If you have an image where each region is separated by solid black lines, you can identify each region with bwlabel(), then use label2rgb() to make a colored image
labeledImage = bwlabel(binaryImage);
rgbImage = label2rgb(labeledImage, yourColorMap);
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Geodesy and Mapping finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!