谷类动物的花捆调整,DENSE_NORMAL_CHOLESKY比SCHUR快,但不是吗?

时间:2018-11-06 13:09:54

标签: ceres-solver

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

here所述:

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;也没有明显的区别。我想念什么吗?

1 个答案:

答案 0 :(得分:0)

使用分析导数。您的大部分时间都花在了这里。