Patent ID: 8718365

Claim:
A method of recognizing text in an image, comprising: receiving the image from a client device; producing a rotated version of the image; identifying a first plurality of patches within the image, and a second plurality of patches within the rotated version of the image; applying, to each patch of the first and second plurality of patches, a first text detection algorithm that indicates whether a patch contains text, thereby identifying a first set of the first plurality of patches, and a second set of the second plurality of patches, that contain text; identifying, as a properly-oriented image, one of the image and the rotated version of the image, responsive at least in part to a comparison of numbers of patches within the first set and within the second set; determining whether the properly-oriented image represents sparse or dense text, based at least in part on a number of patches within the identified set of patches corresponding to the properly-oriented image; responsive to the image representing sparse text: identifying within the properly-oriented image, using a second text detection algorithm having higher accuracy than the first text detection algorithm, a third set of patches representing text; within the third set of patches: grouping patches proximate to one another into a first text region, grouping patches proximate to one another into a second text region; performing optical character recognition on the first text region separately from the second text region, resulting in a first textual result and a second textual result; combining the first and second textual results into a textual result associated with the image as a whole; and providing the combined textual result to the client device.