title: calculate the orientation of a blob
body: <p><img src="https://i.stack.imgur.com/5YEwy.png" alt="enter image description here"></p>
  
  <p>I have an image with a white blob as visualized in the attached picture. I would like to calculate the 'orientation' of it. Imagine the blob being located in a coordinate system with x- and y-axis. I can calculate the centroid by adding all the white pixels coordinates and dividing by the sum of all white pixels but to get the orientation (which I marked with the red line) I would hav to find some extreme point or something like that.</p>
  
  <p>This would somehow relate to the problem of positioning an ellipsis in this system although so far I haven't found anything on that problem either. </p>
  
  <p>Anyone have any clues?</p>