Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
StonerLing opened this issue Feb 6, 2025 · 1 comment
Closed

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

StonerLing opened this issue Feb 6, 2025 · 1 comment

Comments

@StonerLing
Copy link

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.

Copy link

github-actions bot commented Feb 6, 2025

Thanks for the report, but it looks like you didn't include a copy of your dataset for us to reproduce this issue? Please make sure to follow our issue guidelines 🙏

p.s. I'm just an automated script, not a human being.

@github-actions github-actions bot closed this as completed Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant