xtract.bot

Undistort (lens correction)

Try it interactively →
POST /api/image-undistort

Correct lens-distortion artefacts (barrel / pincushion) in an image. Accepts the standard 4-coefficient radial-distortion model.

Corrects radial lens distortion — the "fisheye" or "squashed" effect from wide-angle lenses, dashcams, or security cameras. Inputs are the standard 4-coefficient distortion model (`k1`, `k2`, `p1`, `p2`) plus the camera intrinsic matrix (`fx`, `fy`, `cx`, `cy`). For most consumer cameras the distortion coefficients are published or recoverable through one-time calibration.

Inputs

NameTypeDefaultDescription
image*fileInput image bytes.
cameraMatrix*stringJSON-encoded 9-number array `[fx,0,cx, 0,fy,cy, 0,0,1]`.
distCoeffs*stringJSON-encoded array of distortion coefficients (4, 5, 8, 12, or 14 numbers).
formatenum (jpeg | png)"jpeg"Output encoding.
qualitynumber (1…100)90JPEG quality.

Response

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