image-processingimagemagick

What side is up? - Automatic Image rotation algorithm


Software like Google Picasa demonstrate very well that software can figure out which way a photo was taken without Exif-Data as it is not available in every camera.

Is there a documented algorithm which outputs whether or not an image has to be rotated or not? I want to find out the rotation without the use of EXIF Data. If at all possible I would want to do this with ImageMagick.


Solution

  • This is a complex problem and subject to ongoing research accordingly. Yann's answer is basically pointing towards the usual approaches already (+1) and mfrellum's hint towards the subject of Pattern Recognition likewise applies as well (+1) - for a more in depth analysis you might want to read through a couple of the following papers (subjective selection from past research of mine):

    [Please note: most of the PDF links below have been deduced from Google Scholar - Google is naturally good at finding the matching PDF elsewhere for publicly available abstracts of papers, where the actual content is more often than not hidden behind paywalls. The legality of this is subject to heated discussions of course, and so is shielding regularly publicly financed scientific research like so in the first place - make your own judgement!]

    Unfortunately I'm not aware of any readily available implementations/libraries, though I'd be surprised if there wouldn't be a few bits available at least.

    Have fun :)