colmap / colmap

COLMAP - Structure-from-Motion and Multi-View Stereo
https://colmap.github.io/
Other
7.06k stars 1.44k forks source link

[Rig Bundle Adjust] Crashes when setting up Ceres #1812

Open alex-klimov opened 1 year ago

alex-klimov commented 1 year ago

rig_bundle_adjuster crashes with following stack when setting up cameras:

F0223 07:42:54.837208 30111 problem_impl.cc:510] Parameter block not found: 0x555557723470. You must add the parameter block to the problem before you can set its manifold.
*** Check failure stack trace: ***
    @     0x7ffff7bac1c3  google::LogMessage::Fail()
    @     0x7ffff7bb125b  google::LogMessage::SendToLog()
    @     0x7ffff7babebf  google::LogMessage::Flush()
    @     0x7ffff7bac6ef  google::LogMessageFatal::~LogMessageFatal()
    @     0x555555fdd21c  ceres::internal::ProblemImpl::SetManifold()
    @     0x5555558ce1ad  colmap::BundleAdjuster::ParameterizeCameras()
    @     0x5555558d2ff5  colmap::RigBundleAdjuster::SetUp()
    @     0x5555558d33c4  colmap::RigBundleAdjuster::Solve()
    @     0x555555755fbc  colmap::RunRigBundleAdjuster()
    @     0x5555557077f9  main
    @     0x7fffde6f0083  __libc_start_main
    @     0x555555711dbe  _start

To Reproduce

  utils.run_process(
      f"{colmap_exe} rig_bundle_adjuster --input_path {sparse_folder_bundle}" +
      f" --rig_config_path {cameras_rig_path}" +
      f" --output_path {sparse_folder_rig_bundle} --BundleAdjustment.max_num_iterations=500",
      verbose=verbose)

Expected behavior Rig bundle adjust works without a crash.

Environment:

alex-klimov commented 1 year ago

According to the investigation on our side - this happens when for particular camera re-projection error is too big, so that camera params are not added to Ceres solver (AddImage method). That leads to this crash. What should be a good fix here?