资源简介
slambook-master.tar.gz
代码片段和文件信息
#include
#include
#include “ceres/ceres.h“
#include “SnavelyReprojectionerror.h“
#include “common/BALProblem.h“
#include “common/BundleParams.h“
using namespace ceres;
void SetLinearSolver(ceres::Solver::Options* options const BundleParams& params)
{
CHECK(ceres::StringToLinearSolverType(params.linear_solver &options->linear_solver_type));
CHECK(ceres::StringToSparseLinearAlgebraLibraryType(params.sparse_linear_algebra_library &options->sparse_linear_algebra_library_type));
CHECK(ceres::StringToDenseLinearAlgebraLibraryType(params.dense_linear_algebra_library &options->dense_linear_algebra_library_type));
options->num_linear_solver_threads = params.num_threads;
}
void SetOrdering(BALProblem* bal_problem ceres::Solver::Options* options const BundleParams& params)
{
const int num_points = bal_problem->num_points();
const int point_block_size = bal_problem->point_block_size();
double* points = bal_problem->mutable_points();
const int num_cameras = bal_problem->num_cameras();
const int camera_block_size = bal_problem->camera_block_size();
double* cameras = bal_problem->mutable_cameras();
if (params.ordering == “automatic“)
return;
ceres::ParameterBlockOrdering* ordering = new ceres::ParameterBlockOrdering;
// The points come before the cameras
for(int i = 0; i < num_points; ++i)
ordering->AddElementToGroup(points + point_block_size * i 0);
for(int i = 0; i < num_cameras; ++i)
ordering->AddElementToGroup(cameras + camera_block_size * i 1);
options->linear_solver_ordering.reset(ordering);
}
void SetMinimizerOptions(Solver::Options* options const BundleParams& params){
options->max_num_iterations = params.num_iterations;
options->minimizer_progress_to_stdout = true;
options->num_threads = params.num_threads;
// options->eta = params.eta;
// options->max_solver_time_in_seconds = params.max_solver_time;
CHECK(StringToTrustRegionStrategyType(params.trust_region_strategy
&options->trust_region_strategy_type));
}
void SetSolverOptionsFromFlags(BALProblem* bal_problem
const BundleParams& params Solver::Options* options){
SetMinimizerOptions(optionsparams);
SetLinearSolver(optionsparams);
SetOrdering(bal_problem optionsparams);
}
void BuildProblem(BALProblem* bal_problem Problem* problem const BundleParams& params)
{
const int point_block_size = bal_problem->point_block_size();
const int camera_block_size = bal_problem->camera_block_size();
double* points = bal_problem->mutable_points();
double* cameras = bal_problem->mutable_cameras();
// Observations is 2 * num_observations long array observations
// [u_1 u_2 ... u_n] where each u_i is two dimensional the x
// and y position of the observation.
const double* observations = bal_problem->observations();
相关资源
- 2019美赛特等奖论文.zip
- 数据结构-邓俊辉-完整扫描版.pdf
- CiscoAnyConnect4.8.01090.rar
- Keil5c51v960a.rar
- 213123.zip
- 禾匠V4-4.2.9五端全插件独立版.zip
- 《OpenCV3编程入门》书本配套源代码及
- 机器人手册第1卷机器人基础_CN.pdf
- 嵌入式LINUX基础教程第2版.pdf
-
xm
lSpy2018及激活.rar - 《Django2.0入门与实践》PDF+李健.pdf
- 第4章CSS布局.zip
- 华农软件工程大二考试复习资料.zip
- PASS11.rar
- 数理统计与数据分析原书第3版完整中
- ManageEngine_NetFlowAnalyzer_9.0.zip
- u010269719_10776937.zip
- 简易新闻App.rar
- ghcms(jb51.net).rar
- majiang.rar
- CD2.0.pdf
- Windows程序设计(第5版珍藏版).扫描
- 编程珠玑第2版•修订版.[美]JonBentle
- CPrime第6版.pdf.zip
- 打开量化投资的黑箱__原书第2版__美里
- 深网-Google搜不到的世界.pdf
- 常微分方程教程-丁同仁.pdf
- Location.zip
- gradle1.6.rar
- com.dezhou2.rar
评论
共有 条评论