xtract.bot
POST /api/ocr-prep-id-card

Pre-process a passport, drivers licence, or other ID card photo: detect the card edges, crop, deskew, and normalise lighting for clean OCR.

Specialised pre-processing for photos of identity documents — passports, driving licences, national IDs, library cards. The pipeline detects the card outline, crops to its bounds, corrects perspective so the card is rectangular, and normalises lighting so the resulting image is OCR-friendly. Glare patches and shadows are reduced where possible. Output is a clean rectangular PNG ready for `document-ocr`. Pair the two for an end-to-end ID-photo → text pipeline.

Inputs

NameTypeDefaultDescription
image*filePhoto of an ID card / passport / driver's license.
granularityenum (text | word | line | word+line)"text"OCR detail level.
returnPrepImagebooleanfalseReturn the prep'd PNG as base64.

Response

Modes: json. Cache: yes (24h TTL).