1. A method for performing optical character recognition on an image of a document, comprising: receiving the image of the document; identifying a plurality of text areas in the document; identifying a midpoint of each of the plurality of text areas in the document; detecting one or more lines of text in the document, wherein each of the one or more lines of text comprises a plurality of text areas, and wherein each of the plurality of text areas is associated with a midpoint having a coordinate within a threshold number of pixels on one axis in a two-dimensional space; determining a probable orientation of the document based on an orientation of the detected one or more lines of text; and extracting text from the image based on the determined probable orientation of the document.