﻿# SuperGlue unmatched points: an invalid match index must stay invalid

Handle SuperGlue unmatched-point sentinels before indexing partner keypoints, and keep learned match confidence separate from geometric verification.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-superglue-unmatched-index-contract/
Language: en

## Recognize partial correspondence as a valid result

Two photographs rarely expose exactly the same visible interest points. SuperGlue therefore predicts an assignment that can leave points unmatched. The [paper](https://arxiv.org/abs/1911.11763) describes matching with an explicit rejection mechanism. An absent correspondence is not necessarily a software error or evidence that an image failed to load. Preserve that outcome in the application instead of inventing a partner for every detected point to simplify a downstream array shape.

## Filter the documented sentinel before indexing

The [reference implementation](https://github.com/magicleap/SuperGluePretrainedNetwork) documents `-1` for an unmatched point in its exported match array. In common array indexing, a negative index can select an element from the end. Gathering partner coordinates before filtering can consequently draw a false correspondence to a real last point. Check the selected interface's validity convention and apply the valid-match selection before using any index as a location in the partner image.

## Keep directional indexing explicit

The matcher relates points from one input list to indices in another. Its [reference model code](https://github.com/magicleap/SuperGluePretrainedNetwork/blob/master/models/superglue.py) exposes directional match arrays and matching scores. Do not confuse a point's index in its own feature list with its partner index. If earlier filtering or sorting changed either input list, preserve the corresponding feature identities so a valid numeric match still refers to the intended coordinates after export.

## Distinguish model confidence from geometry

A confident learned correspondence can still be unsuitable for a particular camera model or scene assumption. Preserve match scores as the model's evidence and evaluate geometric consistency separately when the application requires a pose or reconstruction. Repeated texture, moving objects and limited overlap are informative inspection cases. A large count of accepted matches does not independently establish a correct camera transformation or prove that every retained correspondence is an inlier.

## Test the no-match path deliberately

Include a pair with little or no shared content and confirm that the consumer handles an empty retained set without fabricating coordinates. Then inspect a partially overlapping pair and its actual validity selection. The guides to [image coordinate transforms](/journal/data-guide-image-exif-box-coordinate/) and [grouped evaluation splits](/journal/data-guide-entity-group-split-design/) provide context. SuperGlue's specific contract includes rejection: preserving unmatched outcomes is necessary for an honest correspondence result, not an optional cleanup after visualization.
