Debian Codegraph @

doc/features.rst

raw
1 .. _features:
2
3 Feature Extraction and Matching
4 ===============================
5
6 COLMAP supports multiple feature extraction and matching algorithms. This page
7 describes how to switch between them using the command-line interface or the
8 graphical user interface.
9
10
11 Feature Extractor Types
12 -----------------------
13
14 The following feature extractor types are available:
15
16 - ``SIFT``: Scale-Invariant Feature Transform (default). The classic and most
17 widely tested feature extractor. Produces 128-dimensional uint8 descriptors.
18
19 - ``ALIKED``: A Lighter Keypoint and Descriptor Extractor. A learned feature
20 extractor that produces floating-point descriptors. Requires ONNX support to
21 be enabled at build time (``-DONNX_ENABLED=ON``).
22
23 - ``LOMA``: A learned feature extractor, introduced in LoMa: Local Feature
24 Matching Revisited, ECCV26, that uses the DeDoDe architecture. Two descriptor
25 variants are available: ``LOMA_B`` (256-dim, frozen DINOv2 features combined
26 with trained convolutional features) and ``LOMA_B128`` (128-dim, more
27 lightweight). Requires ONNX support to be enabled at build time
28 (``-DONNX_ENABLED=ON``).
29
30 To select a feature extractor type via the command-line::
31
32 $ colmap feature_extractor \
33 --database_path $DATASET_PATH/database.db \
34 --image_path $DATASET_PATH/images \
35 --FeatureExtraction.type ALIKED_N16ROT \
36 --AlikedExtraction.max_num_features 2048
37
38 For SIFT (the default), you can omit the type or explicitly set it::
39
40 $ colmap feature_extractor \
41 --database_path $DATASET_PATH/database.db \
42 --image_path $DATASET_PATH/images \
43 --FeatureExtraction.type SIFT \
44 --SiftExtraction.max_num_features 8192
45
46 In the GUI, open ``Processing > Feature extraction`` and select the desired
47 tab (SIFT, ALIKED, LoMa, etc.) before clicking Extract.
48
49
50 Feature Matcher Types
51 ---------------------
52
53 The following feature matcher types are available:
54
55 - ``SIFT_BRUTEFORCE``: Brute-force matching optimized for SIFT descriptors
56 (default). Uses L2 distance with ratio test.
57
58 - ``ALIKED_BRUTEFORCE``: Brute-force matching for ALIKED descriptors. Uses
59 cosine similarity. Requires ONNX support to be enabled at build time.
60
61 - ``SIFT_LIGHTGLUE``: Neural network-based matching using the LightGlue model
62 for SIFT descriptors. This typically produces more matches and higher inlier
63 ratios than brute-force matching, especially for challenging image pairs with
64 large viewpoint or illumination changes. Requires ONNX support to be enabled
65 at build time.
66
67 - ``ALIKED_LIGHTGLUE``: Neural network-based matching using the LightGlue model
68 for ALIKED descriptors. Requires ONNX support to be enabled at build time.
69
70 - ``LOMA_BRUTEFORCE``: Brute-force matching for either of the LoMa descriptors.
71 Uses cosine similarity. Requires ONNX support to be enabled at build time.
72
73 - ``LOMA_B``: Dedicated neural network matcher for the 256-dim ``LOMA_B``
74 descriptor, comparable in size to LightGlue. Requires ONNX support to be
75 enabled at build time.
76
77 - ``LOMA_R``: Same size as ``LOMA_B``, but trained with rotation augmentation
78 for better robustness to rotated image pairs. Also matches the 256-dim
79 ``LOMA_B`` descriptor. Requires ONNX support to be enabled at build time.
80
81 - ``LOMA_L``, ``LOMA_G``: Larger dedicated matchers for the 256-dim
82 ``LOMA_B`` descriptor, in increasing order of model size and matching
83 quality. Requires ONNX support to be enabled at build time.
84
85 - ``LOMA_B128``: Dedicated matcher for the lightweight 128-dim ``LOMA_B128``
86 descriptor. Requires ONNX support to be enabled at build time.
87
88 To select a feature matcher type via the command-line::
89
90 $ colmap exhaustive_matcher \
91 --database_path $DATASET_PATH/database.db \
92 --FeatureMatching.type ALIKED_BRUTEFORCE \
93 --AlikedMatching.min_cossim 0.85
94
95 For SIFT matching (the default)::
96
97 $ colmap exhaustive_matcher \
98 --database_path $DATASET_PATH/database.db \
99 --FeatureMatching.type SIFT_BRUTEFORCE \
100 --SiftMatching.max_ratio 0.8
101
102 In the GUI, open ``Processing > Feature matching``, select any matching tab
103 (Exhaustive, Sequential, etc.), and choose the matcher type from the "Type"
104 dropdown in the shared options section.
105
106
107 Compatible Extractor and Matcher Types
108 --------------------------------------
109
110 The feature extractor and matcher types should be compatible:
111
112 - Use ``SIFT`` extraction with ``SIFT_BRUTEFORCE`` or ``SIFT_LIGHTGLUE`` matching.
113 - Use ``ALIKED_*`` extraction with ``ALIKED_BRUTEFORCE`` or ``ALIKED_LIGHTGLUE`` matching.
114 - Use ``LOMA_B`` extraction with ``LOMA_BRUTEFORCE``, ``LOMA_B``, ``LOMA_R``,
115 ``LOMA_L``, or ``LOMA_G`` matching.
116 - Use ``LOMA_B128`` extraction with ``LOMA_BRUTEFORCE`` or ``LOMA_B128``
117 matching.
118
119 Mixing incompatible types (e.g., SIFT features with ALIKED matcher, or
120 ``LOMA_B128`` features with the ``LOMA_B`` matcher) will result in a runtime
121 error. Do not mix different feature extractor types (e.g., SIFT and ALIKED)
122 in the same database.
123
124
125 ALIKED Model Variants
126 ---------------------
127
128 ALIKED requires an ONNX model file. Several model variants are available with
129 different trade-offs between speed and accuracy:
130
131 - ``aliked-n16rot``: Faster and trained for some viewpoint invariance. 128-dim descriptors.
132 - ``aliked-n32``: More expensive but not explicitly trained for viewpoint invariance, 128-dim descriptors.
133
134 Specify the model path using ``--AlikedExtraction.*_model_path``. If the path is
135 a URL, COLMAP will automatically download and cache the model. You can download
136 different ALIKED models from the release page at https://github.com/colmap/colmap/releases/
137
138
139 LoMa Model Variants
140 --------------------
141
142 LoMa, similar to ALIKED, uses a detect+describe+match framework. The descriptor
143 comes in two variants:
144
145 - ``LOMA_B``: 256-dim descriptor combining frozen DINOv2 features with trained
146 convolutional features.
147 - ``LOMA_B128``: A more lightweight 128-dim descriptor.
148
149 Each descriptor variant has its own dedicated matcher(s) with
150 different trade-offs between speed and accuracy:
151
152 - ``LOMA_B`` descriptors can be matched with ``LOMA_B`` (smallest, same size as
153 LightGlue), ``LOMA_R`` (same size as ``LOMA_B`` but trained with rotation
154 augmentation), ``LOMA_L``, or ``LOMA_G`` (progressively larger, slower, and
155 more accurate), as well as ``LOMA_BRUTEFORCE``.
156 - ``LOMA_B128`` descriptors can only be matched with ``LOMA_B128`` or
157 ``LOMA_BRUTEFORCE``. Fastest option but least accurate out of the LoMa
158 matchers.
159
160 By default, all LoMa model weights are downloaded automatically and cached
161 locally the first time they are used, so no manual setup is required to get
162 started. To use a different model, specify its path using
163 ``--LomaExtraction.*_model_path`` for extraction and
164 ``--LomaMatching.*_model_path`` for matching. As with ALIKED, if the path is a
165 URL, COLMAP will automatically download and cache it. Extraction and
166 matching also support an opt-in ``use_bf16`` mode
167 (``--LomaExtraction.use_bf16`` / ``--LomaMatching.use_bf16``) for faster
168 inference.
169
170
171 Iterative Runs
172 ---------------------
173
174 When re-running matching on an existing database, image pairs that already have
175 a two-view geometry are skipped, so changing ``--FeatureMatching.type`` on such
176 a database leaves previously matched pairs untouched. To force re-matching, first
177 clear the existing results with ``database_cleaner``::
178
179 $ colmap database_cleaner \
180 --database_path $DATASET_PATH/database.db \
181 --type two_view_geometries \
182 --type matches
183
184 When re-extracting with a different ``--FeatureExtraction.type``, use
185 ``--type features`` to additionally clear the extracted keypoints and descriptors.