-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcli.html
406 lines (369 loc) · 23.5 KB
/
cli.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Command-line Interface — COLMAP 3.12.0.dev0 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=4eec7147" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=3a07dcc1"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="PyCOLMAP" href="pycolmap/index.html" />
<link rel="prev" title="Graphical User Interface" href="gui.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home">
COLMAP
</a>
<div class="version">
3.12.0.dev0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="install.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="database.html">Database Format</a></li>
<li class="toctree-l1"><a class="reference internal" href="cameras.html">Camera Models</a></li>
<li class="toctree-l1"><a class="reference internal" href="format.html">Output Format</a></li>
<li class="toctree-l1"><a class="reference internal" href="datasets.html">Datasets</a></li>
<li class="toctree-l1"><a class="reference internal" href="gui.html">Graphical User Interface</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Command-line Interface</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#example">Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="#help">Help</a></li>
<li class="toctree-l2"><a class="reference internal" href="#commands">Commands</a></li>
<li class="toctree-l2"><a class="reference internal" href="#visualization">Visualization</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="pycolmap/index.html">PyCOLMAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">Frequently Asked Questions</a></li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
<li class="toctree-l1"><a class="reference internal" href="contribution.html">Contribution</a></li>
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="bibliography.html">Bibliography</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">COLMAP</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Command-line Interface</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/cli.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="command-line-interface">
<span id="cli"></span><h1>Command-line Interface<a class="headerlink" href="#command-line-interface" title="Link to this heading"></a></h1>
<p>The command-line interface provides access to all of COLMAP’s functionality for
automated scripting. Each core functionality is implemented as a command to the
<code class="docutils literal notranslate"><span class="pre">colmap</span></code> executable. Run <code class="docutils literal notranslate"><span class="pre">colmap</span> <span class="pre">-h</span></code> to list the available commands (or
<code class="docutils literal notranslate"><span class="pre">COLMAP.bat</span> <span class="pre">-h</span></code> under Windows). Note that if you run COLMAP from the CMake
build folder, the executable is located at <code class="docutils literal notranslate"><span class="pre">./src/colmap/exe/colmap</span></code>. To start the
graphical user interface, run <code class="docutils literal notranslate"><span class="pre">colmap</span> <span class="pre">gui</span></code>.</p>
<section id="example">
<h2>Example<a class="headerlink" href="#example" title="Link to this heading"></a></h2>
<p>Assuming you stored the images of your project in the following structure:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/path/to/project/...
+── images
│ +── image1.jpg
│ +── image2.jpg
│ +── ...
│ +── imageN.jpg
</pre></div>
</div>
<p>The command for the automatic reconstruction tool would be:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span># The project folder must contain a folder "images" with all the images.
$ DATASET_PATH=/path/to/project
$ colmap automatic_reconstructor \
--workspace_path $DATASET_PATH \
--image_path $DATASET_PATH/images
</pre></div>
</div>
<p>Note that any command lists all available options using the <code class="docutils literal notranslate"><span class="pre">-h,--help</span></code>
command-line argument. In case you need more control over the individual
parameters of the reconstruction process, you can execute the following sequence
of commands as an alternative to the automatic reconstruction command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span># The project folder must contain a folder "images" with all the images.
$ DATASET_PATH=/path/to/dataset
$ colmap feature_extractor \
--database_path $DATASET_PATH/database.db \
--image_path $DATASET_PATH/images
$ colmap exhaustive_matcher \
--database_path $DATASET_PATH/database.db
$ mkdir $DATASET_PATH/sparse
$ colmap mapper \
--database_path $DATASET_PATH/database.db \
--image_path $DATASET_PATH/images \
--output_path $DATASET_PATH/sparse
$ mkdir $DATASET_PATH/dense
$ colmap image_undistorter \
--image_path $DATASET_PATH/images \
--input_path $DATASET_PATH/sparse/0 \
--output_path $DATASET_PATH/dense \
--output_type COLMAP \
--max_image_size 2000
$ colmap patch_match_stereo \
--workspace_path $DATASET_PATH/dense \
--workspace_format COLMAP \
--PatchMatchStereo.geom_consistency true
$ colmap stereo_fusion \
--workspace_path $DATASET_PATH/dense \
--workspace_format COLMAP \
--input_type geometric \
--output_path $DATASET_PATH/dense/fused.ply
$ colmap poisson_mesher \
--input_path $DATASET_PATH/dense/fused.ply \
--output_path $DATASET_PATH/dense/meshed-poisson.ply
$ colmap delaunay_mesher \
--input_path $DATASET_PATH/dense \
--output_path $DATASET_PATH/dense/meshed-delaunay.ply
</pre></div>
</div>
<p>If you want to run COLMAP on a computer without an attached display (e.g.,
cluster or cloud service), COLMAP automatically switches to use CUDA if
supported by your system. If no CUDA enabled device is available, you can
manually select to use CPU-based feature extraction and matching by setting the
<code class="docutils literal notranslate"><span class="pre">--SiftExtraction.use_gpu</span> <span class="pre">0</span></code> and <code class="docutils literal notranslate"><span class="pre">--SiftMatching.use_gpu</span> <span class="pre">0</span></code> options.</p>
</section>
<section id="help">
<h2>Help<a class="headerlink" href="#help" title="Link to this heading"></a></h2>
<p>The available commands can be listed using the command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ colmap help
Usage:
colmap [command] [options]
Documentation:
https://colmap.github.io/
Example usage:
colmap help [ -h, --help ]
colmap gui
colmap gui -h [ --help ]
colmap automatic_reconstructor -h [ --help ]
colmap automatic_reconstructor --image_path IMAGES --workspace_path WORKSPACE
colmap feature_extractor --image_path IMAGES --database_path DATABASE
colmap exhaustive_matcher --database_path DATABASE
colmap mapper --image_path IMAGES --database_path DATABASE --output_path MODEL
...
Available commands:
help
gui
automatic_reconstructor
bundle_adjuster
color_extractor
database_creator
delaunay_mesher
exhaustive_matcher
feature_extractor
feature_importer
image_deleter
image_rectifier
image_registrator
image_undistorter
mapper
matches_importer
model_aligner
model_analyzer
model_converter
model_merger
model_orientation_aligner
patch_match_stereo
point_triangulator
poisson_mesher
rig_bundle_adjuster
sequential_matcher
spatial_matcher
stereo_fusion
transitive_matcher
vocab_tree_builder
vocab_tree_matcher
vocab_tree_retriever
</pre></div>
</div>
<p>And each command has a <code class="docutils literal notranslate"><span class="pre">-h,--help</span></code> command-line argument to show the usage and
the available options, e.g.:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ colmap feature_extractor -h
Options can either be specified via command-line or by defining
them in a .ini project file passed to `--project_path`.
-h [ --help ]
--project_path arg
--database_path arg
--image_path arg
--image_list_path arg
--ImageReader.camera_model arg (=SIMPLE_RADIAL)
--ImageReader.single_camera arg (=0)
--ImageReader.camera_params arg
--ImageReader.default_focal_length_factor arg (=1.2)
--SiftExtraction.num_threads arg (=-1)
--SiftExtraction.use_gpu arg (=1)
--SiftExtraction.gpu_index arg (=-1)
--SiftExtraction.max_image_size arg (=3200)
--SiftExtraction.max_num_features arg (=8192)
--SiftExtraction.first_octave arg (=-1)
--SiftExtraction.num_octaves arg (=4)
--SiftExtraction.octave_resolution arg (=3)
--SiftExtraction.peak_threshold arg (=0.0066666666666666671)
--SiftExtraction.edge_threshold arg (=10)
--SiftExtraction.estimate_affine_shape arg (=0)
--SiftExtraction.max_num_orientations arg (=2)
--SiftExtraction.upright arg (=0)
--SiftExtraction.domain_size_pooling arg (=0)
--SiftExtraction.dsp_min_scale arg (=0.16666666666666666)
--SiftExtraction.dsp_max_scale arg (=3)
--SiftExtraction.dsp_num_scales arg (=10)
</pre></div>
</div>
<p>The available options can either be provided directly from the command-line or
through a <cite>.ini</cite> file provided to <code class="docutils literal notranslate"><span class="pre">--project_path</span></code>.</p>
</section>
<section id="commands">
<h2>Commands<a class="headerlink" href="#commands" title="Link to this heading"></a></h2>
<p>The following list briefly documents the functionality of each command, that is
available as <code class="docutils literal notranslate"><span class="pre">colmap</span> <span class="pre">[command]</span></code>:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">gui</span></code>: The graphical user interface, see
<a class="reference internal" href="gui.html#gui"><span class="std std-ref">Graphical User Interface</span></a> for more information.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">automatic_reconstructor</span></code>: Automatically reconstruct sparse and dense model
for a set of input images.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">project_generator</span></code>: Generate project files at different quality settings.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">feature_extractor</span></code>, <code class="docutils literal notranslate"><span class="pre">feature_importer</span></code>: Perform feature extraction or
import features for a set of images.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">exhaustive_matcher</span></code>, <code class="docutils literal notranslate"><span class="pre">vocab_tree_matcher</span></code>, <code class="docutils literal notranslate"><span class="pre">sequential_matcher</span></code>,
<code class="docutils literal notranslate"><span class="pre">spatial_matcher</span></code>, <code class="docutils literal notranslate"><span class="pre">transitive_matcher</span></code>, <code class="docutils literal notranslate"><span class="pre">matches_importer</span></code>:
Perform feature matching after performing feature extraction.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">mapper</span></code>: Sparse 3D reconstruction / mapping of the dataset using SfM after
performing feature extraction and matching.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">hierarchical_mapper</span></code>: Sparse 3D reconstruction / mapping of the dataset
using hierarchical SfM after performing feature extraction and matching.
This parallelizes the reconstruction process by partitioning the scene into
overlapping submodels and then reconstructing each submodel independently.
Finally, the overlapping submodels are merged into a single reconstruction.
It is recommended to run a few rounds of point triangulation and bundle
adjustment after this step.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">image_undistorter</span></code>: Undistort images and/or export them for MVS or to
external dense reconstruction software, such as CMVS/PMVS.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">image_rectifier</span></code>: Stereo rectify cameras and undistort images for stereo
disparity estimation.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">image_filterer</span></code>: Filter images from a sparse reconstruction.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">image_deleter</span></code>: Delete specific images from a sparse reconstruction.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">patch_match_stereo</span></code>: Dense 3D reconstruction / mapping using MVS after
running the <code class="docutils literal notranslate"><span class="pre">image_undistorter</span></code> to initialize the workspace.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">stereo_fusion</span></code>: Fusion of <code class="docutils literal notranslate"><span class="pre">patch_match_stereo</span></code> results into to a colored
point cloud.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">poisson_mesher</span></code>: Meshing of the fused point cloud using Poisson
surface reconstruction.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">delaunay_mesher</span></code>: Meshing of the reconstructed sparse or dense point cloud
using a graph cut on the Delaunay triangulation and visibility voting.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">image_registrator</span></code>: Register new images in the database against an existing
model, e.g., when extracting features and matching newly added images in a
database after running <code class="docutils literal notranslate"><span class="pre">mapper</span></code>. Note that no bundle adjustment or
triangulation is performed.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">point_triangulator</span></code>: Triangulate all observations of registered images in
an existing model using the feature matches in a database.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">point_filtering</span></code>: Filter sparse points in model by enforcing criteria,
such as minimum track length, maximum reprojection error, etc.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bundle_adjuster</span></code>: Run global bundle adjustment on a reconstructed scene,
e.g., when a refinement of the intrinsics is needed or
after running the <code class="docutils literal notranslate"><span class="pre">image_registrator</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">database_creator</span></code>: Create an empty COLMAP SQLite database with the
necessary database schema information.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">database_merger</span></code>: Merge two databases into a new database. Note that the
cameras will not be merged and that the unique camera and image identifiers
might change during the merging process.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">model_analyzer</span></code>: Print statistics about reconstructions.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">model_aligner</span></code>: Align/geo-register model to coordinate system of given
camera centers.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">model_orientation_aligner</span></code>: Align the coordinate axis of a model using a
Manhattan world assumption.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">model_converter</span></code>: Convert the COLMAP export format to another format,
such as PLY or NVM.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">model_cropper</span></code>: Crop model to specific bounding box described in GPS or
model coordinate system.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">model_splitter</span></code>: Divide model in rectangular sub-models specified from
file containing bounding box coordinates, or max extent of sub-model, or
number of subdivisions in each dimension.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">model_merger</span></code>: Attempt to merge two disconnected reconstructions,
if they have common registered images.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">color_extractor</span></code>: Extract mean colors for all 3D points of a model.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">vocab_tree_builder</span></code>: Create a vocabulary tree from a database with
extracted images. This is an offline procedure and can be run once, while the
same vocabulary tree can be reused for other datasets. Note that, as a rule of
thumb, you should use at least 10-100 times more features than visual words.
Pre-trained trees can be downloaded from <a class="reference external" href="https://demuc.de/colmap/">https://demuc.de/colmap/</a>.
This is useful if you want to build a custom tree with a different trade-off
in terms of precision/recall vs. speed.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">vocab_tree_retriever</span></code>: Perform vocabulary tree based image retrieval.</p></li>
</ul>
</section>
<section id="visualization">
<h2>Visualization<a class="headerlink" href="#visualization" title="Link to this heading"></a></h2>
<p>If you want to quickly visualize the outputs of the sparse or dense
reconstruction pipelines, COLMAP offers you the following possibilities:</p>
<ul class="simple">
<li><p>The sparse point cloud obtained with the <code class="docutils literal notranslate"><span class="pre">mapper</span></code> can be visualized via the
COLMAP GUI by importing the following files: choose <code class="docutils literal notranslate"><span class="pre">File</span> <span class="pre">></span> <span class="pre">Import</span> <span class="pre">Model</span></code>
and select the folder where the three files, <code class="docutils literal notranslate"><span class="pre">cameras.txt</span></code>, <code class="docutils literal notranslate"><span class="pre">images.txt</span></code>,
and <code class="docutils literal notranslate"><span class="pre">points3d.txt</span></code> are located.</p></li>
<li><p>The dense point cloud obtained with the <code class="docutils literal notranslate"><span class="pre">stereo_fusion</span></code> can be visualized
via the COLMAP GUI by importing <code class="docutils literal notranslate"><span class="pre">fused.ply</span></code>: choose
<code class="docutils literal notranslate"><span class="pre">File</span> <span class="pre">></span> <span class="pre">Import</span> <span class="pre">Model</span> <span class="pre">from...</span></code> and then select the file <code class="docutils literal notranslate"><span class="pre">fused.ply</span></code>.</p></li>
<li><p>The dense mesh model <code class="docutils literal notranslate"><span class="pre">meshed-*.ply</span></code> obtained with the <code class="docutils literal notranslate"><span class="pre">poisson_mesher</span></code> or
the <code class="docutils literal notranslate"><span class="pre">delaunay_mesher</span></code> can currently not be visualized with COLMAP, instead
you can use an external viewer, such as Meshlab.</p></li>
</ul>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="gui.html" class="btn btn-neutral float-left" title="Graphical User Interface" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="pycolmap/index.html" class="btn btn-neutral float-right" title="PyCOLMAP" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2024, Johannes L. Schoenberger.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>