artifact_projection library

This library is part of the Textify package. Provides histogram projection-based segmentation for clean digital text images.

Uses the XY-cut algorithm: horizontal projection finds text lines, vertical projection finds character segments within each line.

Functions

findCharacterRects(Artifact image, {bool attemptSplitting = true}) List<IntRect>
Finds character segments within a text line using vertical projection (pixel count per column).
findTextLineRects(Artifact image) List<IntRect>
Finds text line rows using horizontal projection (pixel count per row).
insertSpacesByGap(List<Artifact> artifacts, int lineHeight) → void
Inserts space artifacts between character artifacts where the gap between them exceeds a threshold computed from the gap distribution.