フィルターのクリア

How to extract point of interest from plotted graph?

1 回表示 (過去 30 日間)
Usman
Usman 2015 年 11 月 19 日
コメント済み: Usman 2015 年 11 月 19 日
I have plotted the graph by calculating this average horizontal values and then calculate their local minima points. Now I want to extract to two minima points which are my point of interest and then calculate distance between them. These point of interest are marked in graph with outline. these points are 2nd and 5th minima i.e first valley from negative to positive and second valley from positive to negative. can anyone help me out?
I1=imread('open.jpg');
I2=rgb2gray(I1);
figure, title('open');
plot(1:size(I2,1), mean(I2,2));
hold on
horizontalAverages = mean(I2 , 2);
plot(1:size(I2,1) , horizontalAverages)
[Minimas locs] = findpeaks(-horizontalAverages)
plot(locs , -1*Minimas , 'r*')
Minimas =
-86.5647
-80.3647
-81.3588
-106.9882
-77.0765
-77.8235
-92.2353
-106.2235
-115.3118
-98.3706
locs =
30
34
36
50
93
97
110
121
127
136

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 11 月 19 日
In your code, they are going to be located at locs(2) = 34 and locs(5) = 93, so the distance between them will be 93-34
  1 件のコメント
Usman
Usman 2015 年 11 月 19 日
yes roberson, i know. but actually i want to extract these points automatically from MATLAB. I mean i dont have to look up at graph. MATLAB do this for me.

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

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by