フィルターのクリア

How to find out location where temperature is high based on color graph using Matlab?

1 回表示 (過去 30 日間)
ARUN V
ARUN V 2018 年 1 月 14 日
コメント済み: Image Analyst 2022 年 5 月 29 日
Sir, Need your help. It's a sea shore image. I have to find out the location where the sea surface temperature is high based on color value variation (color graph is attached with the image), from the rgb image.
(ie, if an area contains high red value then the sst is 33.5 which is very high in this particular location)
Note: The color scale displayed beneath the image just relates the colors in the image. which is just a color scale which defines---> if this color then this will be the temperature value.
(eg: if blue color in the rgb image,it will just aware us that the temperature is low).
  5 件のコメント
Antony Joseph
Antony Joseph 2018 年 8 月 2 日
@Rik- Could you please help me?
Antony Joseph
Antony Joseph 2018 年 8 月 2 日
my temperature range: 20-degree Celcius - 713.07-degree Celcius

サインインしてコメントする。

回答 (4 件)

Jan
Jan 2018 年 1 月 14 日
編集済み: Jan 2018 年 1 月 14 日
If you have an RGB image and a colormap (which seems to be the case), you can convert it to an indexed image:
IndexImage = rgb2ind(RGB, map)
Now IndexImage is a a 2D matrix containing the indices related to the color map. Now simply search the maximum value:
[maxIndex, pos] = max(IndexImage);
[y, x] = ind2sub(size(IndexImage), pos);
Or you can create a mask for values above a threshold:
mask = IndexImage > 75; % Example
figure;
imagesc(mask)
If you want to set the limit to 33.5 degree, you have to find out to which index of the colormap this value belongs. For an explicit suggestion, we need to know how your colormap is defined.
  2 件のコメント
ARUN V
ARUN V 2018 年 1 月 14 日
% code
RGB = imread('i.png');
figure
imagesc(RGB)
axis image
% zoom(4)
[IND,map] = rgb2ind(RGB,32);
figure
imagesc(IND)
colormap(map)
axis image
% zoom(4)
[i,j]=ind2sub(map,IND);
But sir, output of this code produced didn't match the output expected.. I am new to matlab, need help...
Jan
Jan 2018 年 1 月 14 日
Please attach the input data and explain, what you expect. Maybe the Matlab code works reliably and only your expectations are the problem?

サインインしてコメントする。


Rik
Rik 2018 年 1 月 14 日
  1. crop to the relevant part (remove axis and dashed lines)
  2. convert to indices with rgb2ind
  3. use [r,c]=find(A_ind==min(A_ind(:)); (or ind2sub) to get the location(s).
  2 件のコメント
ARUN V
ARUN V 2018 年 1 月 14 日
編集済み: ARUN V 2018 年 1 月 14 日
#code
RGB = imread('i.png');
figure
imagesc(RGB)
axis image
% zoom(4)
[IND,map] = rgb2ind(RGB,32);
figure
imagesc(IND)
colormap(map)
axis image
% zoom(4)
[i,j]=ind2sub(map,IND);
But sir, output of this code produced didn't match the output expected.. I am new to matlab, need help...
Jan
Jan 2018 年 8 月 2 日
qARUN V: We cannot know, which output you expect. I suggest to open a new thread and to explain the details.

サインインしてコメントする。


Image Analyst
Image Analyst 2018 年 1 月 14 日
編集済み: Image Analyst 2018 年 7 月 31 日
I've already done exactly that for someone else. Take the attached m-file and make the obvious changes.
  12 件のコメント
Antony Joseph
Antony Joseph 2018 年 8 月 2 日
You can see from this matlab result, The maximum temperature in each frame is same value(84.02).
how can I solve this problem?
Walter Roberson
Walter Roberson 2022 年 5 月 29 日
you do not appear to have cropped the color bar out of the images before looking at the maximum

サインインしてコメントする。


Özgür Uzunkaya
Özgür Uzunkaya 2022 年 5 月 29 日
ExtractMovieFrames.m What does the file and the following files say? where can i use it?
  3 件のコメント
Walter Roberson
Walter Roberson 2022 年 5 月 29 日
https://www.mathworks.com/matlabcentral/answers/377055-how-to-find-out-location-where-temperature-is-high-based-on-color-graph-using-matlab#comment_595688 has the code.
Image Analyst
Image Analyst 2022 年 5 月 29 日
@Özgür Uzunkaya I wrote the attached, well commented program. If you have any questions about it let me know what lines they are and I'll improve the comments.
You may not want to do everything in the demo, for example asking the user if they want to save each individual movie frame. Just delete the parts you don't want and make any other modifications you want.
I have lots of other movie demos. I've attached some of them if you want them.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImages についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by