title: Algorithm to detect photo orientation
body: <p>I would like to rotate photos automatically, even when EXIF metadata about the image orientation is not available.</p>
  
  <p>Are there any good algorithms for detecting the orientation of a photo?  The images are photographs from a digital camera. The algorithm doesn't have to work perfectly, but any reduction in the amount of human interaction required to properly rotate photos would be a benefit.</p>
  
  <p>I have found these two papers on the topic: </p>
  
  <ul>
  <li><a href="http://ieeexplore.ieee.org/Xplore/login.jsp?url=http%3A%2F%2Fieeexplore.ieee.org%2Fiel5%2F11024%2F34758%2F01660295.pdf%3Farnumber%3D1660295&amp;authDecision=-203" rel="noreferrer">Pre-Classification for Automatic Image Orientation</a> (2006)</li>
  <li><a href="http://ieeexplore.ieee.org/Xplore/login.jsp?url=http%3A%2F%2Fieeexplore.ieee.org%2Fiel5%2F9515%2F30163%2F01384938.pdf%3Farnumber%3D1384938&amp;authDecision=-203" rel="noreferrer">A Probabilistic Approach to Image Orientation Detection via Confidence-Based Integration of Low-Level and Semantic Cues</a> (2004)</li>
  </ul>
  
  <p>Pointers to other research and especially implementations are appreciated. </p>