how can i find the three peak points of the histogram..

i can find 1st peak point, then how can i find the 2nd and 3rd peak of the histogram?

回答 (3 件)

Adam
Adam 2015 年 1 月 12 日
編集済み: Adam 2015 年 1 月 12 日

1 投票

doc findpeaks
if you have the Signal Processing Toolbox.
Although you don't say which histogram you are referring to.
If you don't have the Signal Processing toolbox you can search for find peaks or similar on Matlab Exchange for code that will do the same.

9 件のコメント

user06
user06 2015 年 1 月 12 日
i have a grayscale image's histogram and i m able to find the 1st peak point. now i have to find the 2nd and 3rd peak...
Image Analyst
Image Analyst 2015 年 1 月 12 日
We know - you said that already. Please read this.
Adam
Adam 2015 年 1 月 12 日
Incidentally, how do you find the first peak?
user06
user06 2015 年 1 月 13 日
編集済み: Image Analyst 2015 年 1 月 13 日
by writing this:
[pixelCounts, grayLevels] = imhist(b);
[maxCount, indexOfMax] = max(pixelCounts);
grayLevelAtMax = grayLevels(indexOfMax);
fprintf('max=%d',grayLevelAtMax);
Adam
Adam 2015 年 1 月 13 日
That gives you the largest peak, not necessarily the first peak
user06
user06 2015 年 1 月 13 日
that code which i posted is only giving me the largest peak.. but i want to know how to find the three peaks of the histogram... and i also wants the same for the lowest point.. plz help its very important for me.
Image Analyst
Image Analyst 2015 年 1 月 13 日
Did you try his original suggestion of using findpeaks()? Why not?
user06
user06 2015 年 1 月 14 日
actually i didn't getting how to apply that findpeaks()function.. if u provide me the right example or syntax then i will try..
Adam
Adam 2015 年 1 月 15 日
The help page for findpeaks gives something like 7 or 8 examples. I haven't memorised the syntax so you might as well look at the examples yourself rather than me spend time doing it just to repeat them for you here!

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

Stalin Samuel
Stalin Samuel 2015 年 1 月 13 日

0 投票

sort the data in descending order & take first three values

3 件のコメント

user06
user06 2015 年 1 月 13 日
how can i sort the values of the histogram?? sry i don't know this as i m new to matlab.. plz help by giving by some example.
Adam
Adam 2015 年 1 月 13 日
That won't give you peaks. Quite likely it will give you the largest peak and the two values either side of it.
user06
user06 2015 年 1 月 13 日
that code what i posted is only giving me the largest peak.. but i want to know how to find the three peaks of the histogram... and i also wants the same for the lowest point.. plz help its very important for me.

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

mouh nyquist
mouh nyquist 2015 年 1 月 15 日

0 投票

you can save your histogram as a variable and then use the file (peak finder in matlab exchange file)

7 件のコメント

user06
user06 2015 年 1 月 16 日
can u give an example for that?
mouh nyquist
mouh nyquist 2015 年 1 月 16 日
first have you finded the file in matlab files exchange
user06
user06 2015 年 1 月 16 日
actually i m using the matlab version 2010. in that they are not showing any thing... plz help as i m new to matlab.. and need this function badly..
mouh nyquist
mouh nyquist 2015 年 1 月 16 日
see the attached file ; all the best
user06
user06 2015 年 1 月 19 日
and how can i find the three minimum points of the same histogram.???
mouh nyquist
mouh nyquist 2015 年 1 月 19 日
編集済み: mouh nyquist 2015 年 1 月 19 日
I think it is easy , you need to read a little :-)
Image Analyst
Image Analyst 2015 年 1 月 19 日
You can use findpeaks() like Adam already told you, but you just have to invert your signal so that valleys now become peaks.
upsidedownSignal = max(signal) - signal;
theValleys = findpeaks(upsidedownSignal);
In the future, you can make this a lot faster and more effective if you attach your data so people have something to work with. See this link

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

質問済み:

2015 年 1 月 12 日

コメント済み:

2015 年 1 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by