Ceres 线性求解器选择
Reference:
相关文章:
该操作常应用于 Ceres 配置求解器时:
ceres::Solver::Options options;
options.linear_solver_type = ceres::DENSE_SCHUR;
LinearSolverType 里面定义了 8 8 8 种线性求解器,分别是:
- DENSE_NORMAL_CHOLESKY: Solve the normal equations using a dense Cholesky solver(based on Eigen);
- DENSE_QR: Solve the normal equations using a dense QR solver(based on Eigen)。用于一个小的(几百个参数)或稠密问题;
- SPARSE_NORMAL_CHOLESKY: Solve the normal equations using a sparse cholesky solver(requires SuiteSparse or CXSparse)。用于一般的稀疏问题(即雅克比矩阵有大量的零);
- DENSE_SCHUR: Solves the reduced linear system using a dense Cholesky solver(based on Eigen)。用于多达一百个相机的 BA 问题;
- SPARSE_SCHUR: Solves the reduced linear system using a sparse Cholesky solver(based on CHOLMOD)。用于具有稀疏舒尔补/简化相机矩阵(sparse Schur Complement/Reduced camera matrices)的较大 BA 问题;
- ITERATIVE_SCHUR: Solves the reduced linear system using Conjugate Gradients(based on a new Ceres implementation)。如果没有
SPARSE_SCHUR
的库,可以使用带SCHUR_JACOBI
的ITERATIVE_SCHUR
替代。对于大的 BA 问题(几千台摄像机或更多),使用ITERATIVE_SCHUR
求解器。这里有许多前置条件选择。SCHUR_JACOBI
提供了速度和精度的完美平衡。如果解决中等规模的问题,其中DENSE SCHUR
太慢,但没有SuiteSparse
,那么这也是推荐的选项。 - CGNR: Conjugate gradients on the normal equations。使用共轭梯度法(Conjugate Gradient Normal Residual)。适用于具有稀疏结构的问题,但求解速度较慢。