1. A method for modifying one or more spatial characteristics of a digital representation of a document in a digital image, the method comprising: transforming a tetragon into a rectangle using at least one processor, wherein the tetragon is characterized by a plurality of equations, wherein each equation corresponds to a side of the tetragon, wherein each equation is selected from a chosen class of functions, and wherein at least one of the equations is a second-degree or higher polynomial.