I have an image in matlab that is color coded, using hsv, with clim values ranging from -90 to 90. What I now want to do is convert the rgb image into a matrix with the associated values from the cmap (ie the cmap labels). Could anyone explain how do do this?
I think I can use the rgb2ind to index back into my colormap and then get the associated label, but I'm not sure if this is the best way to go about it.
Step 1: You can convert the RGB to grayscale or just choose a single color channel. Step 2: Use imagesc
to plot that matrix. Step 3: Use colormap
to adjust the colorscale to be from -90 to 90.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.