After taking a photo of a document, I use CIDetector
to auto crop the image, this works fine. But the image is rarely correctly oriented when I want to display it in a uiimageview. I know how to rotate it manually, but I want to be able to recognize the correct orientation based on the text in the document, so that the user never has to do anything.
I tried looping through every possible orientation, using CIDetector
to detect possible areas containing text in a loop, but that doesn't give a definitive answer. Also tried TesseractOCR with disappointing results.
Any other suggestions?