Run COLMAP with Default Parameters

Set paths and create output folders

First, define the required environment variables and create the output folder:

set COLMAP_PATH=<Path to installed colmap.bat>
set DATA_PATH=<Path to dataset folder, e.g., plush-dog>
set IMAGE_PATH=%DATA_PATH%\images
set DB_PATH=%DATA_PATH%\colmap.db
set SPARSE_PATH=%DATA_PATH%\sparse

mkdir %SPARSE_PATH%

Run feature extraction

Use the following command to extract SIFT features from the input images:

%COLMAP_PATH% feature_extractor ^
    --database_path %DB_PATH% ^
    --image_path %IMAGE_PATH% ^
    --ImageReader.single_camera 1 ^
    --ImageReader.camera_model PINHOLE ^
    --SiftExtraction.use_gpu 1

This command extracts SIFT features from the input images and stores them in the specified COLMAP database.

Parameter reference:

  • --database_path: Path to the SQLite file database where features will be stored
  • --image_path: Path to the folder containing the input images
  • --ImageReader.single_camera 1: Assumes all images are from a single camera
  • --ImageReader.camera_model PINHOLE: Uses the pinhole camera model
  • --SiftExtraction.use_gpu 1: Enables GPU acceleration for feature extraction

Sample output:

==============================================================================
Feature extraction
==============================================================================
Creating SIFT GPU feature extractor
Processed file [1/84]
  Name:            IMG_3496.jpg
  Dimensions:      3000 x 2000
  Camera:          #1 - PINHOLE
  Focal Length:    5515.70px (Prior)
  Features:        2400
Processed file [2/84]
  Name:            IMG_3497.jpg
  Dimensions:      3000 x 2000
  Camera:          #1 - PINHOLE
  Focal Length:    5515.70px (Prior)
  Features:        2416
...

Run feature matching

After extracting features, run the exhaustive matcher to find correspondences between image pairs:

%COLMAP_PATH% exhaustive_matcher ^
    --database_path %DB_PATH% ^
    --SiftMatching.use_gpu 1

This command performs pairwise feature matching between all image pairs using default settings.

Parameter reference:

  • --database_path: Path to the COLMAP database with extracted features
  • --SiftMatching.use_gpu 1: Enables GPU acceleration for matching

The exhaustive matcher compares features between every possible image pair. It is best suited for small to medium-sized datasets (up to a few hundred images). For larger datasets, it becomes computationally expensive because the number of pairs grows quadratically.

COLMAP also supports other matching strategies that are better for large-scale datasets, including sequential, spatial, and vocab tree matching. See the COLMAP documentation for more details.

Sample output:

==============================================================================
Feature matching
==============================================================================
Creating SIFT GPU feature matcher
Generating exhaustive image pairs...
Matching block [1/2, 1/2]
...
Elapsed time: 0.044 [minutes]

Run sparse 3D reconstruction

After matching, run the COLMAP mapper to estimate camera poses and build a sparse 3D reconstruction:

%COLMAP_PATH% mapper ^
    --database_path %DB_PATH% ^
    --image_path %IMAGE_PATH% ^
    --output_path %SPARSE_PATH%

Parameter reference:

  • --database_path: Path to the COLMAP database with features and matches
  • --image_path: Path to the folder with input images
  • --output_path: Path to save the reconstructed models. Each result will be stored in a numbered subfolder (for example, sparse/0)

Sample output and failure

In some cases, including the example dataset in this tutorial, COLMAP may not succeed with the default settings. Feature matching might complete, but the reconstruction can fail during the incremental mapping stage.

A sample failure log looks like this:

Loading database
Loading cameras...
 1 in 0.000s
Loading matches...
 214 in 0.001s
Loading images...
 84 in 0.008s (connected 84)
Loading pose priors...
 0 in 0.000s
Building correspondence graph...
 in 0.005s (ignored 0)
Elapsed time: 0.000 [minutes]
Finding good initial image pair
Initializing with image pair #57 and #83
Global bundle adjustment
Registering image #56 (3)
=> Image sees 52 / 299 points
Retriangulation and Global bundle adjustment
Registering image #84 (4)
=> Image sees 68 / 257 points
...
Registering image #43 (21)
=> Image sees 30 / 144 points
=> Could not register, trying another image.
Retriangulation and Global bundle adjustment
Finding good initial image pair
=> No good initial image pair found.
Finding good initial image pair
=> No good initial image pair found.

The repeated message "No good initial image pair found" indicates that COLMAP could not identify a geometrically valid pair of images to start the reconstruction. This can occur during initialization of the first 3D model or when attempting to begin a new model after failing to register additional images.

These failures are typically caused by weak, sparse, or unevenly distributed feature matches across the dataset. To improve initialization, try adjusting feature extraction and matching parameters to increase the quality of initial correspondences.

If tuning parameters is not sufficient, consider capturing more overlapping images or experimenting with alternative reconstruction tools.

The next section, Run COLMAP with Adjusted Parameters, demonstrates how to modify key settings to improve reconstruction results.

A sample batch script with all the commands used in this section is available at: scripts/run_colmap_default.bat


© 2025 SmartDataScan.
This section is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.