Robust dense feature matching
open sourceMIT AND Apache-2.0self-hostablefree
RoMa is a dense feature matcher (CVPR 2024) that estimates a pixel-dense warp between two images with a certainty for every pixel, and aims to work for almost any image pair, including hard ones. It uses DINOv2 features alongside its own matching network, and you sample matches from the warp to estimate a homography or fundamental matrix with OpenCV's RANSAC solvers. The romatch package on PyPI loads outdoor and indoor models and Tiny RoMa, a much lighter variant built on XFeat; it can also match keypoints you supply. The code is MIT-licensed, the DINOv2 part Apache-2.0. Its authors' successor, RoMa v2 (Parskatt/RoMaV2, the romav2 package), uses DINOv3, which has its own licence.
Problems it solves
- keypoint matching fails between two photos taken from very different angles and lighting
- get a dense pixel-to-pixel correspondence map between two images instead of a few sparse matches
- find correspondences between an indoor image pair where sparse keypoint matchers come up short
- align a photo of a document to a reference image even when it's tilted, shadowed and partly covered
- estimate relative camera pose from an image pair as accurately as possible for a 3D reconstruction
- get a confidence for every match so I can keep only the reliable correspondences before RANSAC
- state-of-the-art image matcher in PyTorch with pretrained weights under a permissive licence
- a lighter dense matcher that runs without a big vision transformer backbone
- warp one image onto another using a learned dense flow field
Features
- pixel-dense warp with a per-pixel certainty for any image pair
- pretrained outdoor and indoor models downloaded automatically
- Tiny RoMa: a lightweight variant built on XFeat
- match arbitrary keypoints with match_keypoints
- balanced sampling of matches for RANSAC estimation
- configurable coarse and upsampled resolutions (560 and 864 by default)
- optional fused local correlation kernel
- training and benchmark code for MegaDepth-1500 and other datasets
- installable from PyPI as romatch
Capabilities
| Has official SDKs | plan not known |
|---|
Alternatives
The same job
These do what RoMa does.
