Extracting Z values from a colormap given a specified X,Y coordinate range

5 views (last 30 days)
For the attached image (concentration.jpg), how would I extract the Z values (concentration values in this case) from the colormap along the line that I have drawn, which has coordinates of (60μm, 120μm) as the starting point and (60μm, -430μm) as the ending point? I have tried using CData to obtain the x,y,z values, but I a bit stuck on how to get the Z values on the line I just defined. The line is in turqouise. Thanks.

Answers (1)

Walter Roberson
Walter Roberson on 23 Sep 2020
It looks to me as if that is colormap jet.
ind = rgb2ind(YourRGBImage, jet(256));
relative_intensity = im2double(ind);
concentration = minimum_concentration + relative_intensity * (maximum_concentration - minium_concentration);
concentration will be a 2D map of estimated concentration, same size as the original image. If you want to take a line across it, you can do that with indexing (for vertical or horizontal lines), or with improfile()

Categories

Find more on Colormaps in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!