title: Compute eigenvectors of image in python
body: <p>I'm trying to fit a 2D Gaussian to an image. Noise is very low, so my attempt was to rotate the image such that the two principal axes do not co-vary, figure out the maximum and just compute the standard deviation in both dimensions. Weapon of choice is python. </p>
  
  <p><img src="https://i.stack.imgur.com/2dmUS.png" alt="2d more-or-less gaussian distribution"></p>
  
  <p>However I got stuck at finding the eigenvectors of the image - <code>numpy.linalg.py</code> assumes discrete data points. I thought about taking this image to be a probability distribution, sampling a few thousand points and then computing the eigenvectors from that distribution, but I'm sure there must be a way of finding the eigenvectors (ie., semi-major and semi-minor axes of the gaussian ellipse) directly from that image. Any ideas?</p>
  
  <p>Thanks a lot :)</p>