Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
pcl
registration
transformation_estimation_symmetric_point_to_plane_lls.h
1
/*
2
* Software License Agreement (BSD License)
3
*
4
* Point Cloud Library (PCL) - www.pointclouds.org
5
* Copyright (c) 2019-, Open Perception, Inc.
6
*
7
* All rights reserved.
8
*
9
* Redistribution and use in source and binary forms, with or without
10
* modification, are permitted provided that the following conditions
11
* are met:
12
*
13
* * Redistributions of source code must retain the above copyright
14
* notice, this list of conditions and the following disclaimer.
15
* * Redistributions in binary form must reproduce the above
16
* copyright notice, this list of conditions and the following
17
* disclaimer in the documentation and/or other materials provided
18
* with the distribution.
19
* * Neither the name of the copyright holder(s) nor the names of its
20
* contributors may be used to endorse or promote products derived
21
* from this software without specific prior written permission.
22
*
23
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34
* POSSIBILITY OF SUCH DAMAGE.
35
*
36
*/
37
38
#pragma once
39
40
#include <pcl/registration/transformation_estimation.h>
41
#include <pcl/cloud_iterator.h>
42
43
namespace
pcl
{
44
namespace
registration
{
45
/** \brief @b TransformationEstimationSymmetricPointToPlaneLLS implements a Linear Least
46
* Squares (LLS) approximation for minimizing the symmetric point-to-plane distance
47
* between two clouds of corresponding points with normals.
48
*
49
* For additional details, see
50
* "Linear Least-Squares Optimization for Point-to-Plane ICP Surface Registration",
51
* Kok-Lim Low, 2004 "A Symmetric Objective Function for ICP", Szymon Rusinkiewicz, 2019
52
*
53
* \note The class is templated on the source and target point types as well as on the
54
* output scalar of the transformation matrix (i.e., float or double). Default: float.
55
* \author Matthew Cong
56
* \ingroup registration
57
*/
58
template
<
typename
Po
int
Source,
typename
Po
int
Target,
typename
Scalar =
float
>
59
class
TransformationEstimationSymmetricPointToPlaneLLS
60
:
public
TransformationEstimation
<PointSource, PointTarget, Scalar> {
61
public
:
62
using
Ptr
= shared_ptr<
TransformationEstimationSymmetricPointToPlaneLLS
<PointSource,
63
PointTarget,
64
Scalar>>;
65
using
ConstPtr
=
66
shared_ptr<
const
TransformationEstimationSymmetricPointToPlaneLLS
<PointSource,
67
PointTarget,
68
Scalar>>;
69
70
using
Matrix4
=
71
typename
TransformationEstimation<PointSource, PointTarget, Scalar>::Matrix4
;
72
using
Vector6
= Eigen::Matrix<Scalar, 6, 1>;
73
74
TransformationEstimationSymmetricPointToPlaneLLS
() =
default
;
75
~TransformationEstimationSymmetricPointToPlaneLLS
()
override
=
default
;
76
77
/** \brief Estimate a rigid rotation transformation between a source and a target
78
* point cloud using SVD. \param[in] cloud_src the source point cloud dataset
79
* \param[in] cloud_tgt the target point cloud dataset
80
* \param[out] transformation_matrix the resultant transformation matrix
81
*/
82
inline
void
83
estimateRigidTransformation
(
const
pcl::PointCloud<PointSource>
& cloud_src,
84
const
pcl::PointCloud<PointTarget>
& cloud_tgt,
85
Matrix4
& transformation_matrix)
const override
;
86
87
/** \brief Estimate a rigid rotation transformation between a source and a target
88
* point cloud using SVD. \param[in] cloud_src the source point cloud dataset
89
* \param[in] indices_src the vector of indices describing the points of interest in
90
* \a cloud_src
91
* \param[in] cloud_tgt the target point cloud dataset
92
* \param[out] transformation_matrix the resultant transformation matrix
93
*/
94
inline
void
95
estimateRigidTransformation
(
const
pcl::PointCloud<PointSource>
& cloud_src,
96
const
pcl::Indices
& indices_src,
97
const
pcl::PointCloud<PointTarget>
& cloud_tgt,
98
Matrix4
& transformation_matrix)
const override
;
99
100
/** \brief Estimate a rigid rotation transformation between a source and a target
101
* point cloud using SVD. \param[in] cloud_src the source point cloud dataset
102
* \param[in] indices_src the vector of indices describing the points of interest in
103
* \a cloud_src
104
* \param[in] cloud_tgt the target point cloud dataset
105
* \param[in] indices_tgt the vector of indices describing the correspondences of the
106
* interest points from \a indices_src
107
* \param[out] transformation_matrix the resultant transformation matrix
108
*/
109
inline
void
110
estimateRigidTransformation
(
const
pcl::PointCloud<PointSource>
& cloud_src,
111
const
pcl::Indices
& indices_src,
112
const
pcl::PointCloud<PointTarget>
& cloud_tgt,
113
const
pcl::Indices
& indices_tgt,
114
Matrix4
& transformation_matrix)
const override
;
115
116
/** \brief Estimate a rigid rotation transformation between a source and a target
117
* point cloud using SVD. \param[in] cloud_src the source point cloud dataset
118
* \param[in] cloud_tgt the target point cloud dataset
119
* \param[in] correspondences the vector of correspondences between source and target
120
* point cloud \param[out] transformation_matrix the resultant transformation matrix
121
*/
122
inline
void
123
estimateRigidTransformation
(
const
pcl::PointCloud<PointSource>
& cloud_src,
124
const
pcl::PointCloud<PointTarget>
& cloud_tgt,
125
const
pcl::Correspondences
& correspondences,
126
Matrix4
& transformation_matrix)
const override
;
127
128
/** \brief Set whether or not to negate source or target normals on a per-point basis
129
* such that they point in the same direction. \param[in]
130
* enforce_same_direction_normals whether to negate source or target normals on a
131
* per-point basis such that they point in the same direction.
132
*/
133
inline
void
134
setEnforceSameDirectionNormals
(
bool
enforce_same_direction_normals);
135
136
/** \brief Obtain whether source or target normals are negated on a per-point basis
137
* such that they point in the same direction or not */
138
inline
bool
139
getEnforceSameDirectionNormals
();
140
141
protected
:
142
/** \brief Estimate a rigid rotation transformation between a source and a target
143
* \param[in] source_it an iterator over the source point cloud dataset
144
* \param[in] target_it an iterator over the target point cloud dataset
145
* \param[out] transformation_matrix the resultant transformation matrix
146
*/
147
void
148
estimateRigidTransformation
(
ConstCloudIterator<PointSource>
& source_it,
149
ConstCloudIterator<PointTarget>
& target_it,
150
Matrix4
& transformation_matrix)
const
;
151
152
/** \brief Construct a 4 by 4 transformation matrix from the provided rotation and
153
* translation. \param[in] parameters (alpha, beta, gamma, tx, ty, tz) specifying
154
* rotation about the x, y, and z-axis and translation along the the x, y, and z-axis
155
* respectively \param[out] transformation_matrix the resultant transformation matrix
156
*/
157
inline
void
158
constructTransformationMatrix
(
const
Vector6
& parameters,
159
Matrix4
& transformation_matrix)
const
;
160
161
/** \brief Whether or not to negate source and/or target normals such that they point
162
* in the same direction */
163
bool
enforce_same_direction_normals_
{
true
};
164
};
165
}
// namespace registration
166
}
// namespace pcl
167
168
#include <pcl/registration/impl/transformation_estimation_symmetric_point_to_plane_lls.hpp>
pcl::ConstCloudIterator
Iterator class for point clouds with or without given indices.
Definition
cloud_iterator.h:121
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition
point_cloud.h:174
pcl::registration::TransformationEstimation< PointSource, PointTarget, float >::TransformationEstimation
TransformationEstimation()=default
pcl::registration::TransformationEstimation::Matrix4
Eigen::Matrix< Scalar, 4, 4 > Matrix4
Definition
transformation_estimation.h:64
pcl::registration::TransformationEstimationSymmetricPointToPlaneLLS::enforce_same_direction_normals_
bool enforce_same_direction_normals_
Whether or not to negate source and/or target normals such that they point in the same direction.
Definition
transformation_estimation_symmetric_point_to_plane_lls.h:163
pcl::registration::TransformationEstimationSymmetricPointToPlaneLLS::Vector6
Eigen::Matrix< Scalar, 6, 1 > Vector6
Definition
transformation_estimation_symmetric_point_to_plane_lls.h:72
pcl::registration::TransformationEstimationSymmetricPointToPlaneLLS::TransformationEstimationSymmetricPointToPlaneLLS
TransformationEstimationSymmetricPointToPlaneLLS()=default
pcl::registration::TransformationEstimationSymmetricPointToPlaneLLS::getEnforceSameDirectionNormals
bool getEnforceSameDirectionNormals()
Obtain whether source or target normals are negated on a per-point basis such that they point in the ...
Definition
transformation_estimation_symmetric_point_to_plane_lls.hpp:214
pcl::registration::TransformationEstimationSymmetricPointToPlaneLLS::Ptr
shared_ptr< TransformationEstimationSymmetricPointToPlaneLLS< PointSource, PointTarget, Scalar > > Ptr
Definition
transformation_estimation_symmetric_point_to_plane_lls.h:62
pcl::registration::TransformationEstimationSymmetricPointToPlaneLLS::estimateRigidTransformation
void estimateRigidTransformation(const pcl::PointCloud< PointSource > &cloud_src, const pcl::PointCloud< PointTarget > &cloud_tgt, Matrix4 &transformation_matrix) const override
Estimate a rigid rotation transformation between a source and a target point cloud using SVD.
Definition
transformation_estimation_symmetric_point_to_plane_lls.hpp:49
pcl::registration::TransformationEstimationSymmetricPointToPlaneLLS::Matrix4
typename TransformationEstimation< PointSource, PointTarget, Scalar >::Matrix4 Matrix4
Definition
transformation_estimation_symmetric_point_to_plane_lls.h:70
pcl::registration::TransformationEstimationSymmetricPointToPlaneLLS::ConstPtr
shared_ptr< const TransformationEstimationSymmetricPointToPlaneLLS< PointSource, PointTarget, Scalar > > ConstPtr
Definition
transformation_estimation_symmetric_point_to_plane_lls.h:65
pcl::registration::TransformationEstimationSymmetricPointToPlaneLLS::setEnforceSameDirectionNormals
void setEnforceSameDirectionNormals(bool enforce_same_direction_normals)
Set whether or not to negate source or target normals on a per-point basis such that they point in th...
Definition
transformation_estimation_symmetric_point_to_plane_lls.hpp:206
pcl::registration::TransformationEstimationSymmetricPointToPlaneLLS::~TransformationEstimationSymmetricPointToPlaneLLS
~TransformationEstimationSymmetricPointToPlaneLLS() override=default
pcl::registration::TransformationEstimationSymmetricPointToPlaneLLS::constructTransformationMatrix
void constructTransformationMatrix(const Vector6 ¶meters, Matrix4 &transformation_matrix) const
Construct a 4 by 4 transformation matrix from the provided rotation and translation.
Definition
transformation_estimation_symmetric_point_to_plane_lls.hpp:131
pcl::registration
Definition
convergence_criteria.h:46
pcl
Definition
convolution.h:46
pcl::Correspondences
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
Definition
correspondence.h:89
pcl::Indices
IndicesAllocator<> Indices
Type used for indices in PCL.
Definition
types.h:133