1. A method for correcting a distortion in an image including text, the method comprising: generating a first set of substantially straight lines corresponding to a first direction for a quadrangle for the image; generating a second set of substantially straight lines corresponding to a second direction for the quadrangle for the image; finding a first vanishing point based on said first set of substantially straight lines comprising filtering the lines of the first set of substantially straight lines based on their length, and using longer lines to find the first vanishing point; finding a second vanishing point based on said second set of substantially straight lines; identifying the quadrangle for the image based on the first vanishing point and the second vanishing point; determining a parameter for a rectangle of a corrected image; and reducing the distortion in the image including text by generating the corrected image based on the rectangle at least partially in a memory of a computer device.