I’m experiencing a strange issue with OCR. Basically, I’m POST’ing a jpg from an iphone app, through my server to an OCR endpoint (ocrapiservice.com, FWIW). The photo contains nice, clear typed text at a sufficiently large size (2500 odd px wide). However, the result is unintelligible:
n. E o U > CO CO a £ O a p a h o .8 U o...
If I upload the same image to ocrapiservice’s test portal (I email myself a copy of the image once the image arrives at my server from the iphone), the result is the same.
I open up the same image in Photoshop and, without doing anything else, do "save as" with a different file name. The file size nearly doubles (for this reason, I guess). Now, if I upload this image, the result is near perfect, with no random characters or unintelligible bits.
So to summarize, both images are the same dimensions, resolution, color space, etc. The only difference is that I have saved-as one in Photoshop, doubling the file size.
Another strange aspect is that if I save-as in Photoshop, but choose a middling jpeg compression level that causes the new file size to be about the same as the original image, the saved-as image still gives good results while the same-sized original is gibberish.
I have no idea what the magic Photoshop is doing to get these images to read well into OCR is, but any guidance would be very much appreciated! In particular any tips for how I could effectively perform the same actions on my UIImage data in my iPhone app to get the OCR to work when POST’ing directly.
Thanks!
Thanks for the quick responses, guys. Turns out it was an issue with the image orientation. Photoshop reads the flag the iPhone sets and fixes the orientation accordingly, whereas posting the image directly drops it. Should’ve known!