Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ragaeeb/kokokor/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Preprocesses observations by filtering noise, flipping coordinates for RTL text, and normalizing x-coordinates for proper alignment. This function is the first step in the text line grouping pipeline, ensuring observations are clean and properly oriented before line detection.Signature
Parameters
Array of text observations to preprocess
Total width of the document/image in pixels
Horizontal DPI for coordinate normalization
Returns
Observation[] - Preprocessed observations ready for line grouping
What It Does
- Noise Filtering: Removes OCR artifacts and invalid observations
- RTL Coordinate Flipping: When
isRTLis enabled, flips x-coordinates to handle right-to-left text properly - X-Coordinate Normalization: Normalizes horizontal positions using DPI for consistent alignment
Usage Example
Related Functions
- mapObservationsToTextLines - Uses this function internally for preprocessing
- normalizeObservationsX - Called internally for coordinate normalization