# How can I get the uncertainties for peaks on an image?

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

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