Using Matlab to find maxima for data with a lot of noise
Posted
by jimbo
on Stack Overflow
See other posts from Stack Overflow
or by jimbo
Published on 2010-05-06T08:28:03Z
Indexed on
2010/05/06
8:38 UTC
Read the original article
Hit count: 256
I have noisy data set with three peaks in Matlab and want to do some image processing on it. The peaks are about 5-9 pixels wide at the base, in a 50 x 50 array. How do I locate the peaks? Matlab is very new to me. Here is what I have so far...
For my original image, let's call it "array", I tried
J = fspecial('gaussian',[5 5], 1.5);
C = imfilter(array, J)
peaks = imregionalmax(C);
but there is still some noise along the baseline between the peaks so I end up getting a ton of local max that are really just noise values. (I tried playing with the size of the filter, but that didn't help.) I also tried
peaks = imextendedmax(C,threshold);
where the threshold was determined visually... which works but is definitely not a good way to do it since it's not that robust obviously.
So, how do I locate these peaks in a robust way? Thanks.
© Stack Overflow or respective owner