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

5 次查看(过去 30 天)
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.

回答(1 个)

Walter Roberson
Walter Roberson 2020-9-23
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()

类别

Help CenterFile Exchange 中查找有关 Colormaps 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by