Expand description
Line Segmentation
This module handles the segmentation of document images into individual text lines using horizontal projection profile analysis.
Structs§
- BBox
- Bounding box for a line segment
- Line
Segment - Result of line segmentation
- Line
Segmenter - Line segmenter using horizontal projection profile
Constants§
- CUT_
INK_ THRESHOLD - A column counts as carrying ink below this grayscale value.
- CUT_
SEARCH_ FRACTION - Where a tile may be cut, as a fraction of the tile width, searching backwards from the ideal boundary. 0.12 of a 1024px window is ~123px, roughly two Mon glyphs — wide enough to find a gap, narrow enough that tiles stay near full width.
- DEFAULT_
DENSITY_ THRESHOLD_ RATIO - The gap threshold this segmenter has always used, kept as the default so existing callers segment identically.
Functions§
- cut_
column - Where to end a tile that starts at
x0and may not passideal. - tile_
line - Split one line crop into pieces that each fit the model window.