Introduction
Finding correspondences—identifying the same physical point across different images—is a fundamental task in computer vision. Traditionally, the field has been bifurcated into sparse methods, which match a limited set of salient keypoints, and dense methods, which estimate a match for every pixel. While sparse methods excel in 3D reconstruction but fail in textureless regions, dense methods capture smooth motion but struggle with large displacements or distinct object boundaries.
COTR (Correspondence Transformer) proposes a unified framework that treats image matching as a functional mapping problem. By formulating matching as a function $\text{COTR}(x \mid I, I') = x'$, the model can predict the corresponding location $x'$ in image $I'$ for any arbitrary query point $x$ in image $I$. This approach bridges the gap between sparse and dense correspondence, allowing for flexible querying across various tasks.
Methodology
The COTR architecture leverages the global context-capturing capabilities of Transformers to perform coordinate regression.
Architecture
The pipeline begins with a shared ResNet-50 backbone that extracts feature maps from the input image pair $(I, I')$. Unlike traditional methods that use correlation layers, COTR concatenates these feature maps side-by-side. A linear positional encoding is added to these maps to provide the network with spatial awareness and the ability to distinguish between the two images.
The concatenated maps are processed by a Transformer encoder-decoder. The decoder receives the query point $x$ as input and produces a latent vector, which is then passed through a Multi-Layer Perceptron (MLP) head to regress the 2D coordinates of the corresponding point $x'$.
Recursive Zoom-in
To overcome the resolution limitations of Transformer feature maps, COTR employs a recursive "zoom-in" strategy. After an initial coarse prediction, the model iteratively crops patches around the query and the estimated correspondence, re-running the network at higher resolutions. By zooming in by a factor of 2 over four iterations, COTR achieves high-precision, sub-pixel accuracy.
Experimental Results
COTR was trained exclusively on the MegaDepth dataset, which consists of static urban scenes. Despite this restricted training set, the model demonstrates remarkable zero-shot generalization across diverse benchmarks.
- Optical Flow: On the KITTI-2015 benchmark, COTR achieved an Average End Point Error (AEPE) of 2.62, significantly outperforming previous state-of-the-art dense methods like RAFT (5.04).
- Wide-Baseline Stereo: In the Image Matching Challenge 2020, COTR using only 512 random matches surpassed SuperGlue (which uses 2000 keypoints) in pose accuracy (mAA).
- Dense and Sparse Tasks: COTR outperformed specialized methods like GLU-Net and GOCor on the HPatches and ETH3D datasets, proving its versatility across planar and multi-view scenarios.
Conclusion
COTR introduces a powerful, unified approach to image correspondence by leveraging Transformers for coordinate regression. Its ability to handle arbitrary queries and generalize to unseen dynamic scenes marks a significant step toward a universal matching engine. While current computational costs for per-point querying remain a challenge, the framework's accuracy and robustness across sparse and dense tasks establish a new state-of-the-art in the field.
Summary updated