Speckle pattern - speckles detection I have the following problem. I have a speckle pattern (of light) like on the image below (left).
 I have to locate as precisely as possible the centers of all speckles. 

That would not be a problem if those speckles would have some constant, known shape, e.g. Gaussians. 

But they are irregular and I do not really know how to do this.

What I do now is:


I look for the highest point in the image and Im registering coordinates of this point.
I mask (NaN) the circular area near this point - more or less of the size of a typical speckle (image, 2nd subplot) and
I'm searching for another highest point. If there are no NaNs in the circular ares of this point, I register its position also. And so on, hundreds of times.


But it is not working to well. Is there any standard method in signal analysis for localization of individual speckles in the speckle pattern?

Image:  


Left - speckle pattern  
2nd  - masked areas  
3rd  - registered positions if the masks can overlap  
4rd  - ... if they cannot.
Essentially, isn't this just looking for local maxima in the image? Have a look at the following code. It dilates the image, i.e. putting each pixel the value of the maximum of its neighborhood. Then, it checks which pixels actaully were the maximum and marks them with a circle:

import skimage
import skimage.io
import skimage.morphology
import numpy as np
import skimage.draw
import scipy.ndimage

I = skimage.io.imread("Capture.PNG", as_grey=True)

selem = np.ones((9,9))
D = skimage.morphology.dilation(I, selem)
plt.figure(figsize=(12,12))

plt.subplot(221); plt.imshow(I); plt.title("Original image")
plt.subplot(222); plt.imshow(D); plt.title("dilated image")

maxima = I==D
plt.subplot(223); plt.imshow(maxima); plt.title("Detected Maxima regions")


labels, nlabels = scipy.ndimage.label(maxima)

plt.subplot(224); plt.imshow(labels)
print (nlabels)

C = scipy.ndimage.measurements.center_of_mass(maxima, labels, 1+np.arange(nlabels-1))
I2 = I.copy()
for x, y in C:
    rr, cc = skimage.draw.circle_perimeter(int(x), int(y), 5, shape=I2.shape)
    I2[rr,cc] = 1
plt.imshow(I2); plt.title("Center of mass of maxima"); plt.colorbar();




what is missing is e.g. a threshold to ignore small maxima.