from PIL import Image import numpy as np from scipy.ndimage.filters import maximum_filter import pylab # the picture (256 * 256 pixels) contains bright spots of whi
This can now be done with skimage.
from skimage.feature import peak_local_max xy = peak_local_max(data, min_distance=2,threshold_abs=1500)
On my computer, for a VGA image size it runs about 4x faster than the above solution and also returned a more accurate position in certain cases.