資源簡介
高翔視覺slam代碼整理版,包含個人注釋與代碼解讀以及書中使用到的數據
代碼片段和文件信息
#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????????ordering->AddElementToGroup(points?+?point_block_size?*?i?0);
???????
????
????for(int?i?=?0;?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();
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????80??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\.gitignore
?????文件???14605482??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\3rdparty\ceres-solver.tar.gz
?????文件????1243868??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\3rdparty\DBow3.tar.gz
?????文件????8342066??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\3rdparty\g2o.tar.gz
?????文件????3527776??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\3rdparty\Pangolin.tar.gz
?????文件?????281794??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\3rdparty\Sophus.tar.gz
?????文件?????????23??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\ceres_custombundle\.gitignore
?????文件???????5935??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\ceres_custombundle\ceresBundle.cpp
?????文件????????770??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\ceres_custombundle\CMakeLists.txt
?????文件???????8880??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\ceres_custombundle\common\BALProblem.cpp
?????文件???????3003??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\ceres_custombundle\common\BALProblem.h
?????文件???????2516??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\ceres_custombundle\common\BundleParams.h
?????文件??????13387??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\ceres_custombundle\common\flags\command_args.cpp
?????文件???????3170??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\ceres_custombundle\common\flags\command_args.h
?????文件???????1086??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\ceres_custombundle\common\projection.h
?????文件????????448??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\ceres_custombundle\common\tools\random.h
?????文件???????5451??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\ceres_custombundle\common\tools\rotation.h
?????文件????4783974??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\ceres_custombundle\data\problem-16-22106-pre.txt
?????文件????????211??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\ceres_custombundle\Readme.md
?????文件???????1121??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\ceres_custombundle\SnavelyReprojection
?????文件?????????23??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\g2o_custombundle\.gitignore
?????文件??????12222??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\g2o_custombundle\ceres\autodiff.h
?????文件???????3491??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\g2o_custombundle\ceres\eigen.h
?????文件???????6977??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\g2o_custombundle\ceres\fixed_array.h
?????文件???????3334??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\g2o_custombundle\ceres\fpclassify.h
?????文件??????24025??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\g2o_custombundle\ceres\jet.h
?????文件???????1580??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\g2o_custombundle\ceres\LICENSE
?????文件???????7447??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\g2o_custombundle\ceres\macros.h
?????文件???????8050??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\g2o_custombundle\ceres\manual_constructor.h
?????文件???????6640??2017-12-10?20:58??slambook-master(14講對應代碼)\slambook-master\ch10\g2o_custombundle\ceres\variadic_evaluate.h
............此處省略316個文件信息
- 上一篇:信號分析與處理第二版作者徐科軍
- 下一篇:電子技術基礎.模擬部分.(康華光.第5版)
評論
共有 條評論