A method for determining skew angle (5) and location of a document in
an
over-scanned digital image is disclosed. A document is scanned to capture a gray
scale image. The outline pixel (1) of a document from the captured gray
scale image are connected (2). An initial angle is set at zero and a x-minimum,
y-minimum, x-maximum, and y-maximum of the polygon are determined (3). A
rectangular boundary (4) area based on the x-minimum, y-minimum, x-maximum,
and y-maximum is calculated and recorded. The angle is recorded and the polygon
is rotated z-degree. The process is repeated and a minimum boundary area is selected.
An angle corresponding to the minimum boundary is the skew angle of the document.