arXiv:2610.32976cs.CVOct 2026

Manuscript Offprint

arXiv:2610.32976

FlexGlue: Sparse-to-Dense Feature Matching and Visual Disambiguation

Philipp Lindenberger, Paul-Edouard Sarlin, Ondrej Miksik, Marc Pollefeys

Philipp Lindenberger 1^{1} Paul-Edouard Sarlin 2^{2} Ondrej Miksik 3^{3} Marc Pollefeys 1,3^{1,3}

1^{1}ETH Zurich 2^{2}Google 3^{3}Microsoft Spatial AI Lab

SfM on ETH3D: accuracy vs. throughput

Figure

Throughput [pairs/s]

LoMa

FlexGlue

∇GT ∇Pred.

Covisible: 122 matches

Doppelganger: 98%

Figure 1: To match or not to match. Deep matchers are trained only on covisible pairs and thus return many confident matches between distinct but similar-looking structures, which breaks Structure-from-Motion (top right). FlexGlue tracks 2D query points across an image pair with subpixel accuracy and jointly predicts whether the two images are covisible, rejecting such doppelgangers with high confidence (bottom right). For 3D applications, FlexGlue is more robust than state-of-the-art matchers and disambiguates more accurately than the dedicated classifier DG++ (Xiangli et al., 2025) (left). We show that disambiguation even improves throughput by stopping early on non-covisible pairs.

ABSTRACT

To estimate correspondences across images, existing approaches match either sparse interest points, which is highly efficient but limited by repeatability, or dense pixel grids, which is robust but expensive. Furthermore, these approaches are trained with only matching pairs and thus often fail to reject unrelated pairs that exhibit visual symmetries, which is equally important in applications like Structure-from-Motion (SfM). We bridge these gaps by introducing FlexGlue, a neural network for asymmetric sparse-to-dense matching and disambiguation. Given two images and coordinates of points in the first image, FlexGlue estimates the coordinates of the corresponding points in the second image while simultaneously rejecting the pair if non-matching. By searching for a limited set of correspondences among dense pixels, our approach is both fast and effective at both matching and disambiguation: it combines the sub-pixel accuracy of dense matching with the speed of sparse matching, while rejecting incorrect pairs with high precision. Experiments on multiple datasets show that FlexGlue pushes the Pareto frontier in relative pose estimation and significantly outperforms existing approaches for SfM and visual localization. FlexGlue is publicly available at github.com/cvg/flexglue.

1 INTRODUCTION

Image matching estimates correspondences across images and is a fundamental building block of 3D vision, from Structure-from-Motion (SfM) to visual localization. Most geometric applications only require correspondences for a sparse set of distinctive interest points (Lowe, 2004; Yi et al., sparse queries

feature interpolation refine overlap

Figure

Figure 2: Architecture of FlexGlue. Each of the two images is encoded by a CNN backbone. The resulting dense tokens are fused by a Transformer that outputs context-augmented tokens. These tokens are decoded into overlap heatmaps and classify whether the image pair is unmatchable, in which case the inference stops. Otherwise, a query point in one image is turned into a sub-pixel coordinate in the other by interpolation of its feature, dense correlation, and match refinement.

2016; DeTone et al., 2018), which both simplifies the problem and reduces its cost. These points are detected independently in each image and matched by a nearest-neighbor search of their descriptors or by deep networks that learn priors on motion and scene structure (Sarlin et al., 2020; Lindenberger et al., 2023; Nordström et al., 2026). Matching is thus fundamentally bounded by the detector: a 3D point can only be matched if it is detected in both views, and any localization noise of the detections propagates directly into the correspondences.

Dense matchers (Edstedt et al., 2023; 2024; Leroy et al., 2024; Edstedt et al., 2026) lift this bound by matching all pixels directly, and are remarkably robust to large viewpoint and appearance changes while achieving subpixel accuracy. This comes at a high cost: they estimate and refine a correspondence for every pixel, which restricts them to low resolutions and makes training expensive, even though downstream applications typically use only a sparse subset. Multi-view applications such as SfM further require discrete tracks, forcing pipelines to snap dense correspondences to detected keypoints with additional heuristics (Sun et al., 2021; He et al., 2024). Semi-dense matchers (Sun et al., 2021; Li et al., 2025) reduce the cost by matching on a coarse grid, but anchor correspondences to grid cells and refine all of them, even when only a sparse subset is needed. Existing matchers thus face a clear trade-off between the robustness of dense and the efficiency of sparse matching.

Beyond this trade-off, learned sparse and dense matchers share a global blind spot: they are trained exclusively on covisible image pairs. Real-world applications such as SfM and SLAM, however, must reject pairs that depict different places, and matchers that confidently match visually similar structures, e.g., symmetric facades, cause catastrophic scene collapses, where classical methods like SIFT (Lowe, 2004) often still perform best. Recent works therefore add bespoke models that predict covisibility after matching (Cai et al., 2023; Xiangli et al., 2025), which introduces architectural redundancy and cost, although local matching and global disambiguation are intrinsically the same task: finding overlapping context.

To bridge these gaps, we introduce FlexGlue (Fig. 1), which matches sparse queries against dense context: given an arbitrary query point in one image, it predicts its subpixel correspondence in the other. A lightweight Transformer (Vaswani et al., 2017) aggregates context over a dense token grid of both images, and a cheap readout and refinement head extracts correspondences only at the queries (Fig. 2). Correspondences can thus land on any pixel, removing the dependence on repeatable detections while retaining the efficiency of sparse matching. As a result, FlexGlue is substantially cheaper to train and run than dense matchers, while matching or even surpassing them on relative pose estimation, SfM, and visual localization.

Crucially, FlexGlue is trained jointly to match covisible pairs and to reject non-covisible ones, exploiting the synergy between matching and visual disambiguation. Since its dense context aggregation already builds a global understanding of the image pair, a lightweight covisibility head suffices to outperform bespoke disambiguation models. As training data with symmetries is scarce, we further show that disambiguation can be learned label-free from flip augmentations. Detecting negative pairs in early layers moreover accelerates matching, in contrast to prior efficient matchers (Lindenberger et al., 2023), which stop early on easy covisible pairs but run the full network on unmatchable ones.

In summary, our main contributions are as follows:

(i) Efficient sparse-to-dense matching: a simple architecture that combines the efficiency of sparse matchers with the robustness and accuracy of dense matchers, achieving state-of-the-art accuracy on some two-view estimation and indoor visual localization benchmarks.

(ii) Joint matching and disambiguation: a joint formulation that outperforms dedicated disambiguation models at 4×4\times higher throughput and stops early on unmatchable pairs. It significantly improves the robustness of SfM on ETH3D and the CVPR 2025 Image Matching Challenge.

(iii) Indoor doppelganger benchmark: the first indoor and cross-device benchmark for visual disambiguation, which we found is a crucial blindspot of existing methods, built from LaMAR (Sarlin et al., 2022) with hard-mined negatives. Our method improves by a large margin there.

References (64)