{"uid":"cap_0u5myM2w-y_s-K0O3TgOn","slug":"halowerk-robust-planar-homography-ransac-215a37dd","name":"HALOWERK Robust Planar Homography (RANSAC)","description":"Fits a 2D projective transform between two point sets with RANSAC at a caller-chosen reprojection threshold, and returns both the homography and the inlier mask. The mask is what makes this useful beyond a plain fit: bad correspondences are named rather than quietly averaged in, so a caller can re-run detection, drop a frame or raise an alarm. Suitable for document rectification, planar tracking and image stitching where the scene really is flat.","url":"https://medien.halowerk.com/v1/oss-opencv-robust-planar-homography?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"source_points":{"type":"array","items":{"type":"array","items":{"type":"number","maximum":1000000000,"minimum":-1000000000},"maxItems":2,"minItems":2},"maxItems":2048,"minItems":4},"target_points":{"type":"array","items":{"type":"array","items":{"type":"number","maximum":1000000000,"minimum":-1000000000},"maxItems":2,"minItems":2},"maxItems":2048,"minItems":4},"reprojection_threshold":{"type":"number","maximum":10,"minimum":0.1}}},"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_Ha1bg0A32b_Ya2u10DTSV","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":"Fits a RANSAC-robust 2D projective (homography) transform between two matched point sets, returning the 3×3 matrix and an inlier mask identifying which correspondences are outliers.","exampleAgentPrompt":"I have two sets of matched 2D points — source and target — from two photos of a flat whiteboard; fit a robust homography using RANSAC with a reprojection threshold of 3.0 pixels and tell me which matches are inliers versus outliers.","exampleUseCases":[{"title":"Document scan rectification","prompt":"I've got 4 or more corner correspondences between a skewed scan and its ideal rectangle; use RANSAC with threshold 2.0 to fit the projective warp and flag any bad corner matches so I can re-detect them."},{"title":"Image stitching keypoint filtering","prompt":"I ran ORB feature matching between two overlapping photos and got 200 point pairs — many are probably wrong. Fit a homography with RANSAC at reprojection threshold 4.0 and give me the inlier mask so I can drop the garbage matches before blending."},{"title":"Planar object tracking quality check","prompt":"My tracker gave me 50 point correspondences between the last frame and the current frame of a flat poster; compute the homography at threshold 1.5 pixels and tell me which ones are inliers so I can raise an alarm if too many are outliers."}],"resultDescription":"Returns a 3×3 homography matrix representing the best-fit 2D projective transform between the two point sets, along with a boolean inlier mask (one entry per correspondence) identifying which point pairs were consistent with the model within the specified reprojection threshold. This allows callers to separate good matches from outliers rather than silently averaging them in.","failureModes":["Fewer than 4 point pairs provided — minimum needed for homography estimation","All correspondences are outliers — degenerate scene or extremely noisy matches leading to no valid model","Points are collinear or nearly so — degenerate configuration where homography is undefined","Reprojection threshold outside allowed range [0.1, 10] — validation error returned","source_points and target_points arrays have mismatched lengths"],"whenToPreferThis":"Choose this endpoint when you need a robust 2D projective transform between matched planar point sets and want explicit outlier identification via an inlier mask — particularly for document rectification, image stitching, or planar tracking pipelines where noisy feature matches could silently corrupt a least-squares fit. Prefer this over a plain homography solver when you expect outlier correspondences and need to know which ones failed rather than having them averaged in.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T19:05:32.842Z","isFirstParty":false,"canonicalSlug":"halowerk-robust-planar-homography-ransac-215a37dd"}