Patent attributes
Skew angle in a document image is estimated using operators known from mathematical morphology. Skew angle in a document image (A) is estimated by run-length smoothing the image and then producing a plurality of eroded run-length-smoothed images. The run-length-smoothed image (RLSA(A)) is eroded using a linear structuring element (k2Lα) oriented at each of a plurality of different angles (α). The angle of the linear structuring element which produces an eroded image having the greatest surface area is designated as the skew angle. A plurality of run-length-smoothed images (RLSAα(A)) may be produced, each generated by smoothing the document image using a linear structuring element (k1Lα) oriented at a respective different angle (αi). Then each run-length smoothed image (RLSAα(A)) is eroded using a linear structuring element oriented at the corresponding angle (αi).