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
Converts bounding box coordinates from array format to object format. Transforms[x1, y1, x2, y2] coordinates to {x, y, width, height} format, commonly needed when integrating with OCR libraries like Surya that use matrix-style bounding boxes.
Signature
Parameters
Array containing
[x1, y1, x2, y2] coordinates where:x1, y1is the top-left cornerx2, y2is the bottom-right corner
Returns
BoundingBox - Bounding box object with x, y, width, and height properties
What It Does
Converts from coordinate-pair format (used by many OCR engines) to the width/height format used throughout Kokokor’s API.Usage Example
Surya OCR Integration
Basic Conversion
Related Functions
- reconstructParagraphs - Accepts observations with BoundingBox format
- mapObservationsToTextLines - Processes observations with BoundingBox format