Grooper Help - Version 25.0
25.0.0017 2,127
  • Overview
  • Help Status

Line Snap Options

Grooper Object Grooper.Core

Configures automatic snapping of a rectangular region to nearby lines detected in a document image.

Remarks

The Line Snap Options class provides settings to automatically adjust the edges of a rectangular region—such as a zone or field—so they align with lines found on a document page. This is useful for precisely capturing table cells, form fields, or other structured regions where alignment to printed lines is important.

Overview

  • Snapping is performed by searching for horizontal and vertical lines near the region's edges.
  • The 'Auto Snap Distance' property controls how far from each edge to search for a line.
  • The 'Auto Snap Margin' property allows you to shrink the resulting region after snapping, to avoid overlapping the detected lines.
  • If snapping is disabled or no lines are found within the specified distance, the original region is used.

How It Works

  1. The snapping process begins with a rectangular region and a Document Instance containing layout information for the target page.
  2. For each edge (left, top, right, bottom), the system checks the corresponding value in 'Auto Snap Distance':
    • If the value is nonzero, it searches for the nearest line within that distance using the page Layout Data.
    • If a line is found, the region's edge is moved to align with the detected line, plus any offset specified by 'Auto Snap Margin' and a small boundary adjustment.
    • If no line is found or the distance is zero, the edge remains unchanged.
  3. After all applicable edges are processed, the region is checked for validity (ensuring left < right and top < bottom).
    • If the region is invalid after snapping, the original region is returned.
    • Otherwise, the adjusted region is used for further processing or extraction.

This approach ensures that extracted regions closely match the actual printed lines on the document, improving accuracy for structured data extraction.

Properties

NameTypeDescription

Derived Types

There are 1 implementations of Line Snap Options.

Result Snap Options Defines settings for snapping a text extraction result to nearby lines and updating the extracted value.

See Also

Used By

Notification