Skip to content

afferent

Recover columns, baselines, and reading order from raw OCR bounding boxes.

Get started →npm install afferent
01 Columns
02 Baselines
03 Lines
04 Continuation
QUICK START
ts
import { processPageLayout, stitchCrossPageDocument } from "afferent";

// 1. Process 2D page geometry (columns, horizontal baselines, line clusters)
const layout = await processPageLayout(ocrLines);

// 2. Stitch ambiguous cross-page boundaries (with optional System 1 semantic resolution)
const pages = await stitchCrossPageDocument([page1, page2], client);

Released under the MIT License.