11 template <
typename TargetPo
intCloud,
typename SourcePo
intCloud,
typename TargetTree,
typename CorrespondenceRejector,
typename Factor>
14 const TargetPointCloud&
target,
15 const SourcePointCloud&
source,
17 const CorrespondenceRejector&
rejector,
18 const Eigen::Isometry3d&
T,
26 H(Eigen::Matrix<double, 6, 6>::Zero()),
27 b(Eigen::Matrix<double, 6, 1>::Zero()),
37 H(Eigen::Matrix<double, 6, 6>::Zero()),
38 b(Eigen::Matrix<double, 6, 1>::Zero()),
42 Eigen::Matrix<double, 6, 6> Ht =
H;
43 Eigen::Matrix<double, 6, 1> bt =
b;
46 for (
size_t i = r.begin(); i != r.end(); i++) {
47 Eigen::Matrix<double, 6, 6> Hi;
48 Eigen::Matrix<double, 6, 1> bi;
75 const Eigen::Isometry3d&
T;
78 Eigen::Matrix<double, 6, 6>
H;
79 Eigen::Matrix<double, 6, 1>
b;
84 template <
typename TargetPo
intCloud,
typename SourcePo
intCloud,
typename Factor>
97 for (
size_t i = r.begin(); i != r.end(); i++) {
107 const Eigen::Isometry3d&
T;
117 template <
typename TargetPo
intCloud,
typename SourcePo
intCloud,
typename TargetTree,
typename CorrespondenceRejector,
typename Factor>
118 std::tuple<Eigen::Matrix<double, 6, 6>, Eigen::Matrix<double, 6, 1>,
double>
linearize(
119 const TargetPointCloud& target,
120 const SourcePointCloud& source,
121 const TargetTree& target_tree,
122 const CorrespondenceRejector& rejector,
123 const Eigen::Isometry3d& T,
124 std::vector<Factor>& factors)
const {
128 tbb::parallel_reduce(tbb::blocked_range<size_t>(0, factors.size(), 8), sum);
130 return {sum.
H, sum.
b, sum.
e};
133 template <
typename TargetPo
intCloud,
typename SourcePo
intCloud,
typename Factor>
134 double error(
const TargetPointCloud& target,
const SourcePointCloud& source,
const Eigen::Isometry3d& T, std::vector<Factor>& factors)
const {
136 tbb::parallel_reduce(tbb::blocked_range<size_t>(0, factors.size(), 16), sum);
Definition: flat_container.hpp:12
Summation for evaluated errors.
Definition: reduction_tbb.hpp:85
const TargetPointCloud & target
Definition: reduction_tbb.hpp:105
void join(const ErrorSum &y)
Definition: reduction_tbb.hpp:103
void operator()(const tbb::blocked_range< size_t > &r)
Definition: reduction_tbb.hpp:95
const Eigen::Isometry3d & T
Definition: reduction_tbb.hpp:107
double e
Definition: reduction_tbb.hpp:110
ErrorSum(ErrorSum &x, tbb::split)
Definition: reduction_tbb.hpp:93
ErrorSum(const TargetPointCloud &target, const SourcePointCloud &source, const Eigen::Isometry3d &T, std::vector< Factor > &factors)
Definition: reduction_tbb.hpp:86
const SourcePointCloud & source
Definition: reduction_tbb.hpp:106
std::vector< Factor > & factors
Definition: reduction_tbb.hpp:108
Summation for linearized systems.
Definition: reduction_tbb.hpp:12
void join(const LinearizeSum &y)
Definition: reduction_tbb.hpp:65
LinearizeSum(LinearizeSum &x, tbb::split)
Definition: reduction_tbb.hpp:30
std::vector< Factor > & factors
Definition: reduction_tbb.hpp:76
const SourcePointCloud & source
Definition: reduction_tbb.hpp:72
const Eigen::Isometry3d & T
Definition: reduction_tbb.hpp:75
const CorrespondenceRejector & rejector
Definition: reduction_tbb.hpp:74
const TargetTree & target_tree
Definition: reduction_tbb.hpp:73
Eigen::Matrix< double, 6, 1 > b
Definition: reduction_tbb.hpp:79
const TargetPointCloud & target
Definition: reduction_tbb.hpp:71
double e
Definition: reduction_tbb.hpp:80
Eigen::Matrix< double, 6, 6 > H
Definition: reduction_tbb.hpp:78
void operator()(const tbb::blocked_range< size_t > &r)
Definition: reduction_tbb.hpp:41
LinearizeSum(const TargetPointCloud &target, const SourcePointCloud &source, const TargetTree &target_tree, const CorrespondenceRejector &rejector, const Eigen::Isometry3d &T, std::vector< Factor > &factors)
Definition: reduction_tbb.hpp:13
Parallel reduction with TBB backend.
Definition: reduction_tbb.hpp:114
double error(const TargetPointCloud &target, const SourcePointCloud &source, const Eigen::Isometry3d &T, std::vector< Factor > &factors) const
Definition: reduction_tbb.hpp:134
std::tuple< Eigen::Matrix< double, 6, 6 >, Eigen::Matrix< double, 6, 1 >, double > linearize(const TargetPointCloud &target, const SourcePointCloud &source, const TargetTree &target_tree, const CorrespondenceRejector &rejector, const Eigen::Isometry3d &T, std::vector< Factor > &factors) const
Definition: reduction_tbb.hpp:118
ParallelReductionTBB()
Definition: reduction_tbb.hpp:115