Tilt detection is performed using a hybrid method that utilizes both the tilt information of line segments and the tilt information of text.
- If the tilt of a line segment is nearly the same as the tilt of mostly horizontal or vertical line segments, use that tilt as the document's tilt.
Use the function of the raster-vector transformation library.
- If there are few line segments that are nearly horizontal or vertical, and the tilt of the line segments varies significantly, use the tilt of the text as the document's tilt.
- If the tilt of a text line that is mostly horizontal or vertical and of a certain length is nearly the same, use that tilt as the document's tilt.
Use the function of the OCR library.
- If there are few text lines that are nearly horizontal or vertical, and the tilt of the text lines varies significantly, tilt detection of the document fails.
|