1. A method for reducing distortion in an image comprising pixels, the method comprising: segmenting the image into foreground pixels and background pixels; applying a connected component analysis to the foreground pixels to obtain letters; indexing a location for each of the letters; forming words using the indexed letters to identify a neighborhood of letters for a query letter and forming into a word the letters from the neighborhood of letters that are less than a threshold distance apart; estimating a location and orientation for each word and indexing the location of each word; forming baselines using the indexed words to identify a neighborhood of words for a query word and forming into a baseline the words from the neighborhood of words that lay on a projection of the query word along its orientation; fitting a function to at least some of the baselines; selecting one or more dominant functions; responsive to a pixel in the image being located between two dominant functions, unwarping the pixel by blending the two dominant functions; and responsive to a pixel in the image not being located between two dominant functions, unwarping the pixel in relation to a nearest dominant function and a shift related to a distance between the pixel's location and the nearest dominant function.