0

我有一个简单的捆绑调整问题,有两个摄像头和 230 个点,我试图使用 Ceres 解决。我的目标是获得绝对最快的解决方案,但我看到的结果似乎与有关捆绑调整问题的文档相矛盾。

如此处所述:

one way to solve this problem is to set Solver::Options::linear_solver_type to SPARSE_NORMAL_CHOLESKY and call Solve(). And while this is a reasonable thing to do, bundle adjustment problems have a special sparsity structure that can be exploited to solve them much more efficiently. Ceres provides three specialized solvers (collectively known as Schur-based solvers) for this task.

但是,当我使用时DENSE_NORMAL_CHOLESKY,使用求解器设置:

options.sparse_linear_algebra_library_type = SUITE_SPARSE;
options.linear_solver_type = ceres::DENSE_NORMAL_CHOLESKY;
options.minimizer_progress_to_stdout = false;
options.logging_type = ceres::SILENT;
options.max_num_iterations = 20;

它给了我:

Time (in seconds):
Preprocessor                         0.006372

Residual only evaluation           0.000359 (12)
Jacobian & residual evaluation     0.003254 (12)
Linear solver                      0.001549 (12)
Minimizer                            0.008216

Postprocessor                        0.000008
Total                                0.014596

但是,当我切换到 SCHUR 求解器时,如下所示:

options.use_explicit_schur_complement = true;
options.sparse_linear_algebra_library_type = SUITE_SPARSE;
options.linear_solver_type = ceres::ITERATIVE_SCHUR; 
options.minimizer_progress_to_stdout = false;
options.logging_type = ceres::SILENT;
options.max_num_iterations = 20;
options.preconditioner_type = SCHUR_JACOBI;

它运行速度较慢,具有:

Time (in seconds):
Preprocessor                         0.007213

  Residual only evaluation           0.000306 (10)
  Jacobian & residual evaluation     0.002611 (10)
  Linear solver                      0.007781 (10)
Minimizer                            0.013027

Postprocessor                        0.000009
Total                                0.020249

我能做些什么来获得更快的结果吗?我尝试过订购各种 linear_solver_type 和不同的预处理器。设置 options.num_threads = 8; 也没有明显的区别。我错过了什么吗?

4

1 回答 1

0

使用解析导数。你的大部分时间都花在了那里。

于 2019-01-29T18:41:31.093 回答