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

3 ビュー (過去 30 日間)
Manuel Guzman
Manuel Guzman 2020 年 9 月 23 日
回答済み: Walter Roberson 2020 年 9 月 23 日
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 Center および File ExchangeColormaps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by