When pick the peak points on an image, e.g. the matrix made by peak in matlab as this one, enter image description here

I can use max to get the index of the peaks. But how can I also get the uncertainties of the index for the peaks?

For example, the max peak of the red spot could be located at (ix,iy)=(25,37). How do I get the uncertainties like (25±3,37±2)?


One way is to simply model each peak with a Gaussian, with mean $\mu_i$ and variance $\sigma_i$. In fact what you mean by uncertainty corresponds to the variance. You can iteratively fit Gaussians using e.g. EM-algorithm. In MATLAB you could easily do this with built-in fitting functions: https://www.mathworks.com/help/curvefit/gaussian.html

Alternatively, you could use the mean-shift algorithm to find the modes in the data, from which you could extract the probabilities: http://de.mathworks.com/matlabcentral/fileexchange/39079-mean-shift-for-finding-modes

And finally, we might want to think of the uncertainty as the steepness of the maximum. In that regard, the magnitude of the first derivative would give us how strong the peak is. Then, a first order derivative, or a curvature filter can characterize the uncertainty. This is also doable in MATLAB with simple finite difference approximation schemes.

  • $\begingroup$ Very useful! I'm reading materials on the principles of EM, mean-shift and curvature filter. Could u please explain a bit more about how to relate the latter two to the problem of peak detection and uncertainty estimate? $\endgroup$ – ddzzbbwwmm Dec 13 '16 at 22:57
  • $\begingroup$ Seems the algorithms are commonly used for cluster analysis. Do you mean estimate the size of the clusters as uncertainties? $\endgroup$ – ddzzbbwwmm Dec 13 '16 at 23:30
  • $\begingroup$ As explained, you could model the uncertainty as variance or as the spread around a peak or as number of points falling into the cluster. That's true. Or as I said the derivatives could also characterize it. That depends on what suits your application the most. $\endgroup$ – Tolga Birdal Dec 14 '16 at 0:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.