samuelm2 · GitHub

This PR exposes a new function pycolmap.match_from_pairs (binding to CreateImagePairsFeatureMatcher) to allow feature matching for a user-specified list of image pairs.

Motivation:
Currently, users who want to match a custom list of pairs (e.g., from custom retrieval logic, custom intra-camera-rig connections, etc) are often directed to use pycolmap.verify_matches.
However, using pycolmap.verify_matches for this purpose is problematic:

  1. CPU Only: It hardcodes use_gpu = false, which is a bottleneck
  2. Hidden Settings: It doesn't allow passing FeatureMatchingOptions, so you're stuck with default SIFT parameters.
  3. Confusing Name: The name verify_matches implies it's just checking consistent geometry for already matched points. In reality, it runs a full feature matching pipeline, which isn't obvious to new users.

Changes:

  1. Added pycolmap.match_from_pairs binding.
  2. Takes default matching options by default, supporting GPU execution (Device::AUTO).
  3. Exposes full control over matching and verification options.

Usage:

pairing_options = pycolmap.ImportedPairingOptions()
pairing_options.match_list_path = "pairs.txt"
pycolmap.match_from_pairs(
    database_path,
    pairing_options=pairing_options,
    matching_options=pycolmap.FeatureMatchingOptions(),
    device=pycolmap.Device.GPU
)

This would resolve multiple open colmap issues: (Issues #3133, #3151)

Read the original on github.com ↗