title: Get coordinates of local maxima in 2D array above certain value
body: <pre><code>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 which I wanna get positions
  # problem: data has high background around value 900 - 1000
  
  im = Image.open('slice0000.png')
  data = np.array(im)
  
  # as far as I understand, data == maximum_filter gives True-value for pixels
  # being the brightest in their neighborhood (here 10 * 10 pixels)
  
  maxima = (data == maximum_filter(data,10))
  # How can I get only maxima, outstanding the background a certain value, let's say 500 ?
  </code></pre>
  
  <p>I'm afraid I don't really understand the <code>scipy.ndimage.filters.maximum_filter()</code> function. Is there a way to obtain pixel-coordinates only within the spots and not within the background?</p>
  
  <p><a href="https://i.stack.imgur.com/RImHW.png" rel="noreferrer">http://i.stack.imgur.com/RImHW.png</a> (16-bit grayscale picture, 256*256 pixels)</p>