1. A method comprising: identifying edges of at least a section of a document in a source image, wherein the document comprises at least one first row of text; identifying a plurality of characters in the document; identifying ones of the characters as a plurality of word portions; generating a plurality of first polynomials that approximate points of the characters within the word portions; generating a second polynomial that approximates the points of the characters of at least a first word portion and a second word portion among the word portions and corresponds to the first row of text; identifying at least one stretching coefficient of the first row of text based on a maximum length of the section between the edges and a length of the second polynomial; and mapping, by at least one processing device, portions of the source image along the first row of text to new positions in a corrected image based on the second polynomial and the stretching coefficient.