---
id: "lightglue-feature-matching"
title: "LightGlue feature matching"
aliases: [LightGlue]
domain: "capture"
stage: "capture"
realtime: "interactive"
platforms: [cuda, python, cpu]
year_introduced: 2023
inputs: [photos]
outputs: [camera-poses, point-cloud]
style: "photoreal"
dynamic: "static"
cost: "offline"
authority: "Lindenberger et al., 2023"
url: "https://texelatlas.vercel.app/t/lightglue-feature-matching/"
sources_verified_at: "2026-11-29"
---
# LightGlue feature matching (Lindenberger et al., 2023)

> A transformer matcher that pairs local keypoints such as SuperPoint or DISK between two images and stops early on easy pairs, giving accurate correspondences for SfM and localisation.

## Reach for it when

- sift matching finds too few correct matches
- photos fail to register in my sfm reconstruction
- match keypoints across large viewpoint change
- need faster learned matching for pose estimation

## How it works

Given keypoints with descriptors from a detector for two images, LightGlue runs a stack of attention layers. Each layer applies self-attention within an image and cross-attention across the pair, with rotary positional encodings on keypoint positions, then predicts assignment scores. A small classifier after each layer decides if a keypoint's match is already confident (so it is frozen) or whether the pair is already settled, and a pruning step removes keypoints unlikely to match, so easy image pairs finish in fewer layers than hard ones. Final matches come from a mutual-match test on soft assignment scores with a learned unmatchable-point score. The matches feed geometric verification (essential or fundamental matrix with RANSAC), triangulation and bundle adjustment in a pipeline like [Structure-from-Motion (COLMAP)](https://texelatlas.vercel.app/t/structure-from-motion-colmap.md).

## When to use it

Choose it as the matcher in a modern SfM or localisation pipeline where nearest-neighbour descriptor matching and ratio tests give too few correct matches under viewpoint, lighting or texture variation. Prefer classic SIFT with ratio-test matching when you need a CPU-only, learning-free baseline, [DUSt3R](https://texelatlas.vercel.app/t/dust3r.md) or [MASt3R](https://texelatlas.vercel.app/t/mast3r.md) when you want a pose-free dense learned alternative, and [Structure-from-Motion (COLMAP)](https://texelatlas.vercel.app/t/structure-from-motion-colmap.md) for the surrounding reconstruction pipeline itself.

## Cost

offline — Per image pair it takes tens of milliseconds on a desktop GPU; large collections need pair selection since pairs grow quadratically.

## Failure modes

- Repeated structures like windows or tiles yield confident but wrong matches that geometric verification must filter
- Performance depends on the detector; weak keypoints in textureless regions cannot be rescued by the matcher
- Extreme viewpoint changes or rotation beyond the training range reduce matches unless augmented
- Pairwise matching cost grows quadratically with image count without retrieval-based pair selection

## Dataflow

- Inputs: photos
- Outputs: camera-poses, point-cloud
- Platforms: cuda, python, cpu

## Combines with

- [Structure-from-Motion (COLMAP)](https://texelatlas.vercel.app/t/structure-from-motion-colmap.md): LightGlue's verified matches replace the default matcher stage before triangulation and bundle adjustment.
- [Nerfstudio](https://texelatlas.vercel.app/t/nerfstudio.md): Better matched poses give nerfstudio and splat training cleaner camera input from hard captures.

## Sources

1. [primary] Philipp Lindenberger, Paul-Edouard Sarlin, Marc Pollefeys (2023) LightGlue: Local Feature Matching at Light Speed. arXiv preprint (cs.CV). https://arxiv.org/abs/2306.13643 (verified via arxiv on 2026-11-29)
2. [implementation] cvg (2023) cvg/LightGlue. https://github.com/cvg/LightGlue License: Apache-2.0. (verified via github on 2026-11-29)

## Cite this entry

Texel. "LightGlue feature matching." https://texelatlas.vercel.app/t/lightglue-feature-matching/ (accessed 2026-12-01).
