title: Image straightening algorithm
body: <p>I am looking for a way to auto-straighten my images, and I was wondering if anyone has come across any algorithms to do this.  I realize that the ability to do this depends on the content of the image, but any known algorithms would be a start.</p>
  
  <p>I am looking to eventually implement this in <code>C#</code> or <code>PHP</code>, however, I am mainly after the algorithm right now.</p>
  
  <p>Is this possible with <code>OpenCV</code>? <code>ImageMagick</code>? Others?</p>
  
  <p>Many thanks,
  Brett</p>