Skip to content

Question about using COLMAP's SfM in ODM pipeline #1822

@StonerLing

Description

@StonerLing

When I attempted to use COLMAP in ODM instead of OpenSfM, I performed undistortion on the reconstructed data and exported the undistorted reconstruction files to the NVM format. However, I noticed that the undistortion results differed from those of OpenSfM, and the final digital orthophoto map (DOM) was incorrect. Upon investigation, I realized that COLMAP's undistorted camera model includes a principal point, whereas OpenSfM assumes the principal point to be the image center.
To address this, I modified the undistortion code in COLMAP to output images without the (cx, cy) offset, as shown below:

  // Copy principal point parameters.
  undistorted_camera.SetPrincipalPointX(camera.Width() / 2.0);
  undistorted_camera.SetPrincipalPointY(camera.Height() / 2.0);

While the resulting DOM appeared visually correct, its precision was not as high as OpenSfM's pipeline. Are there any additional steps I should consider when integrating COLMAP into ODM?

The commands I used are as follows:

colmap feature_extractor \
    --database_path $DATASET_PATH/database.db \
    --image_path $DATASET_PATH/images

colmap spatial_matcher --database_path $DATASET_PATH/database.db \
 --SpatialMatching.max_distance 150.000000 

colmap mapper \
    --database_path $DATASET_PATH/database.db \
    --image_path $DATASET_PATH/images \
    --output_path $DATASET_PATH/sparse

colmap image_undistorter --image_path IMAGE_PATH \
    --input_path $DATASET_PATH/sparse \
    --output_path $DATASET_PATH/dense \
    --min_scale 1.0 --max_scale 1.0 --output_type COLMAP

colmap model_converter --input_path $DATASET_PATH/dense \
    --output_path $DATASET_PATH/dense/scene.nvm \
    --output_type NVM

Note: I am using a forked version of COLMAP 3.8 with GPS constraints.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions