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
(k.sub.2L.sub..alpha.) oriented at each of a plurality of different
angles (.alpha.). 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.sub..alpha.(A)) may be produced, each generated by smoothing the
document image using a linear structuring element (k.sub.1L.sub..alpha.)
oriented at a respective different angle (.alpha..sub.i). Then each
run-length smoothed image (RLSA.sub..alpha.(A)) is eroded using a linear
structuring element oriented at the corresponding angle (.alpha..sub.i).