colmap icon indicating copy to clipboard operation
colmap copied to clipboard

how to run sfm with known camera intrinsics

Open guijuzhejiang opened this issue 3 years ago • 5 comments

colmap verison:3.8

colmap feature_extractor --database_path $DATASET_PATH/database.db
--image_path $DATASET_PATH/images
--SiftExtraction.max_image_size 3840
--ImageReader.single_camera 1
--ImageReader.camera_model=PINHOLE
--ImageReader.camera_params "4479.94,4374.51,2727.48,1811.92"

echo exhaustive_matcher... colmap exhaustive_matcher --database_path $DATASET_PATH/database.db --SiftMatching.guided_matching 0

mkdir -p $DATASET_PATH/sparse/0 colmap mapper
--database_path $DATASET_PATH/database.db
--image_path $DATASET_PATH/images
--output_path $DATASET_PATH/sparse
--Mapper.ba_refine_principal_point false

i ran cmd above but i got : ERROR: Failed to parse options - unrecognised option '--max_image_size'. stereo_fusion...

StereoFusion::Options

mask_path: max_image_size: -1 min_num_pixels: 5 max_num_pixels: 10000 max_traversal_depth: 100 max_reproj_error: 2 max_depth_error: 0.01 max_normal_error: 10 check_num_images: 50 use_cache: 0 cache_size: 32 bbox_min: -3.40282e+38 -3.40282e+38 -3.40282e+38 bbox_max: 3.40282e+38 3.40282e+38 3.40282e+38

Reading workspace... F0517 20:57:44.282964 8423 misc.cc:310] Check failed: file.is_open() /mnt/hdd/dataset/slam/drone/drone_3/dense/stereo/fusion.cfg *** Check failure stack trace: *** @ 0x7fb4ebbbe0cd google::LogMessage::Fail() @ 0x7fb4ebbbff33 google::LogMessage::SendToLog() @ 0x7fb4ebbbdc28 google::LogMessage::Flush() @ 0x7fb4ebbc0999 google::LogMessageFatal::~LogMessageFatal() @ 0x555ec42acf2b (unknown) @ 0x555ec41ac1a4 (unknown) @ 0x555ec42d021c (unknown) @ 0x7fb4c73596df (unknown) @ 0x7fb4c7a386db start_thread @ 0x7fb4c67e761f clone /home/ray/Workspace/project/ORB_SLAM3/src/shell_slam/colmap_pipline.sh: line 56: 8415 Aborted (core dumped) colmap stereo_fusion --workspace_path $DATASET_PATH/dense --workspace_format COLMAP --input_type geometric --output_path $DATASET_PATH/dense/fused.ply

please help

guijuzhejiang avatar May 18 '22 01:05 guijuzhejiang

The error message you show is related to the stereo_fusion approach, which is run after the mapper. You should not see this error message when you run feature extraction, matching, and mapping.

To answer the question on how to run sfm with known intrinsics, you can set the mapper parameters --Mapper.ba_refine_focal_length and --Mapper.ba_refine_extra_params to 0 to avoid that they are refined during the mapping process (see also http://colmap.github.io/faq.html#fix-intrinsics).

tsattler avatar May 18 '22 08:05 tsattler

Hi @tsattler , may I aks if I fix camera intrinsic in feature_extraction step at the beginning, does COLMAP return camera poses in real world metrics? If I want to get the camera poses in real world metrics, what should I do? Thank you very much!

kevinchan04 avatar Apr 26 '23 07:04 kevinchan04

Hi @kevinchan04 , you cannot get camera poses in real world metrics from images alone (independently of whether you know the precise intrinsics or not) as this information is lost when capturing the 3D world in 2D images. You will need to scale the scene based on known distances (e.g., knowing that the distance between a pairs of cameras should be X meters).

tsattler avatar Apr 26 '23 08:04 tsattler

Hi @tsattler, I am sorry for not opening a new issue; I think it may relate to your reply above. What if I had the RGB-D images, which means that I have depth information of points, where should I change in the code base so that I can use that depth info to obtain the real scale of the sense?

hellovuong avatar May 01 '23 18:05 hellovuong

You can use it to scale the 3D model once it is generated by Colmap.

tsattler avatar May 02 '23 20:05 tsattler