Grooper Help - Version 25.0
25.0.0023 2,165
  • Overview
  • Help Status

Auto Deskew

IP Command Grooper.IP

Detects and corrects the skew angle of text in an image by analyzing character alignment and rotating the image to compensate.

Remarks

The Auto Deskew command is used to automatically detect and correct the skew of scanned or photographed document images, ensuring that text lines are horizontally or vertically aligned. This is essential for improving the accuracy of downstream processes such as OCR, data extraction, and document classification.

How Auto Deskew Works

  1. The command first binarizes the input image using the configured 'Binarization Settings', converting color or grayscale images to black and white for more reliable blob (character) detection.
  2. It detects character-like blobs within the specified 'Font Size Range', filtering out non-text elements such as specks, graphics, or lines.
  3. The algorithm tests a range of angles, from -'Maximum Angle' to +'Maximum Angle', in increments defined by 'Angle Precision'. For each angle, it evaluates the straightness of the detected characters to determine the most likely skew.
  4. If the detected skew angle meets or exceeds the 'Minimum Confidence', the image is rotated to correct the skew using the specified 'Interpolation Mode' and 'Background Color'. If not, the image is left unrotated.

Supported Pixel Formats

All common pixel formats are supported, including Pixel8bppGrayscale, Pixel24bppBgr, and Pixel1bppIndexed. Images are automatically converted as needed for skew detection and correction.

Diagnostics

When run in diagnostic mode, Auto Deskew generates additional output to assist with configuration and troubleshooting:

  • Diagnostic images showing the binarized input and the detected character blobs used for skew analysis.
  • Log messages detailing the number of blobs detected, the confidence of the skew angle, and the angle chosen for correction.
  • Visual overlays highlighting which characters were included in the analysis.

These diagnostics help users tune properties such as 'Font Size Range', 'Maximum Samples', and 'Binarization Settings' for optimal results on their specific documents.

Classification Features

Auto Deskew does not generate classification features directly, but by improving image alignment, it enhances the reliability of downstream feature extraction and classification processes.

Configuration and Usage

To use Auto Deskew, add it to an IP Profile or configure it as a property of a Grooper object. Adjust the 'Maximum Angle' and 'Angle Precision' to balance accuracy and processing speed. Use the 'Font Size Range' and 'Maximum Samples' to target the expected text size and density in your documents. Review diagnostic output to fine-tune settings for your document types and image quality.

Properties

NameTypeDescription
Skew Detection
Skew Correction
Command Info

See Also

Used By

Notification