{"uid":"cap_08Dd27ITKJhwGfBRGymWh","slug":"halowerk-opencv-calibrated-lens-undistort-200d05c1","name":"HALOWERK OpenCV Calibrated Lens Undistort","description":"Resamples a grayscale image to remove radial and tangential lens distortion, using the camera matrix and five distortion coefficients you supply — typically from a planar calibration. Dimensions and camera matrix are preserved, so the corrected image drops into an existing pipeline without any change to geometry downstream. Because the output frame is unchanged, strongly distorted corners are pushed outside the image and are simply lost rather than being retained in a larger canvas.","url":"https://medien.halowerk.com/v1/oss-opencv-calibrated-lens-undistort?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"image":{"type":"array","items":{"type":"array","items":{"type":"integer","maximum":255,"minimum":0},"maxItems":256,"minItems":16},"maxItems":256,"minItems":16},"distortion":{"type":"array","items":{"type":"number","maximum":2,"minimum":-2},"maxItems":5,"minItems":5},"camera_matrix":{"type":"array","items":{"type":"array","items":{"type":"number","maximum":1000000000,"minimum":-1000000000},"maxItems":3,"minItems":3},"maxItems":3,"minItems":3}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_B0Ijc3VgsMigQqs6aaUfz","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Corrects radial and tangential lens distortion in a grayscale image using a supplied camera matrix and five distortion coefficients, preserving original image dimensions.","exampleAgentPrompt":"I have a grayscale image captured by a wide-angle lens and I know its camera matrix and the five distortion coefficients from a planar calibration — can you undistort it so the corrected image has the same dimensions as the original?","exampleUseCases":[{"title":"Correct wide-angle surveillance camera frame","prompt":"I'm processing frames from a fisheye security camera and I have the 3x3 camera matrix and five distortion coefficients from calibration. Can you undistort this grayscale frame so I can feed it into my object-detection pipeline without changing the image size?"},{"title":"Fix barrel distortion in robotics vision","prompt":"My robot's monocular camera has noticeable barrel distortion. I've run a planar calibration and have the camera matrix and distortion coefficients k1, k2, p1, p2, k3. Please undistort this grayscale image and return the corrected version at the same resolution."},{"title":"Prepare calibrated image for photogrammetry","prompt":"I have a grayscale aerial photo with radial and tangential lens distortion. I have the camera matrix and all five distortion coefficients from my calibration rig — please remove the distortion while keeping the same image dimensions so it plugs into my 3D reconstruction pipeline."}],"resultDescription":"A 2D array of integers (grayscale pixel values 0–255) representing the undistorted image, with the same width and height as the input. Strongly distorted corner regions that map outside the original frame are clipped and lost rather than padded.","failureModes":["Image array dimensions outside 16–256 range returns validation error","Camera matrix not exactly 3x3 returns schema validation error","Distortion array not exactly 5 elements returns validation error","Distortion coefficient values outside [-2, 2] returns validation error","Heavily distorted images may lose significant corner content with no warning","Payment failure via x402 returns 402 status, call not processed"],"whenToPreferThis":"Choose this endpoint when you have a pre-calibrated camera (camera matrix + 5 distortion coefficients from planar calibration) and need to undistort a grayscale image while strictly preserving the original pixel dimensions for compatibility with a downstream pipeline. It is purpose-built for OpenCV-style calibration outputs and is ideal for robotics, machine vision, or photogrammetry workflows. Prefer alternatives if you need color image support, a larger output canvas to retain corner data, or if you do not yet have calibration parameters.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T19:04:17.844Z","isFirstParty":false,"canonicalSlug":"halowerk-opencv-calibrated-lens-undistort-200d05c1"}