Brute-force descriptor matching
Compare each query descriptor with every training descriptor using a chosen distance.
A short binary descriptor makes pairwise differences visible. Orange is the query; violet rows are candidates.
This binary example counts unequal bits. Float descriptors instead need an appropriate numeric distance.
The best candidate has the smallest descriptor distance. Index search can avoid inspecting every candidate for larger collections.
The best match is evidence of similar appearance. Ambiguity filtering and geometric verification remain separate steps.
Filter ambiguous candidates and validate them with image geometry.
Illustrative example. The stages explain the method; they are not a live OpenCV execution.
Try it on an image
Experiment at pixel level
Compute ORB descriptors in both images, match using Hamming cross-check, and draw the best correspondences side by side.
The engine loads on your first run. Your images stay in this browser.
Scroll over either image to zoom at the pointer. Use the scrollbars to pan both views over the same relative area. Zoom is relative to the input; pixel coordinates belong to each image. Warps can change scene correspondence.
Pixel inspector RGBA · native values · matched scale · 9 × 9 output pixels
Select a pixel
Select a pixel
When to use it
Establish candidate correspondences before estimating a geometric transformation.
How it works
- 01Compute descriptor distances.
- 02Select the nearest match or nearest k neighbours.
- 03Filter ambiguous candidates and validate them with image geometry.
best match = argmin descriptor distance
What to tune
Use L2 for floating descriptors, Hamming for ordinary binary descriptors, and Hamming2 for ORB configurations that require it.
Where it breaks down
A nearest descriptor is not automatically the same physical point. Use cross-checking, ratio tests where appropriate, and robust geometric verification.
TypeScript API
Open an entry for its exact overloads, parameter descriptions, result ownership and pinned upstream source.
All of these calls execute on the CPU. Native objects need explicit disposal. See matrices and ownership and build compatibility.
Related methods
Template matching
Slide a patch across an image and score how well it agrees at each location.
Phase correlation
Estimate translation from the phase relationship between two images in the frequency domain.
ECC alignment
Refine a warp by maximizing enhanced correlation between an image and a template.
FLANN nearest neighbours
Organize descriptors so nearest-neighbour queries can avoid an exhaustive scan.