Question about using COLMAP's SfM in ODM pipeline

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

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.

Welcome!

Really cool project.

Piero Toffanin has already implemented it I think but not maintained anymore …
So may be a good start point is to use his source : GitHub - uav4geo/NodeCM: GPU-enabled photogrammetry pipeline to generate point clouds, orthophotos and elevation models from aerial images using COLMAP.

Oh interesting. If I knew about this, I forgot about it… .