Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
pcl
registration
transformation_validation.h
1
/*
2
* Software License Agreement (BSD License)
3
*
4
* Point Cloud Library (PCL) - www.pointclouds.org
5
* Copyright (c) 2010-2011, Willow Garage, Inc.
6
* Copyright (c) 2012-, Open Perception, Inc.
7
*
8
* All rights reserved.
9
*
10
* Redistribution and use in source and binary forms, with or without
11
* modification, are permitted provided that the following conditions
12
* are met:
13
*
14
* * Redistributions of source code must retain the above copyright
15
* notice, this list of conditions and the following disclaimer.
16
* * Redistributions in binary form must reproduce the above
17
* copyright notice, this list of conditions and the following
18
* disclaimer in the documentation and/or other materials provided
19
* with the distribution.
20
* * Neither the name of the copyright holder(s) nor the names of its
21
* contributors may be used to endorse or promote products derived
22
* from this software without specific prior written permission.
23
*
24
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35
* POSSIBILITY OF SUCH DAMAGE.
36
*
37
* $Id$
38
*
39
*/
40
41
#pragma once
42
43
#include <pcl/common/transforms.h>
44
#include <pcl/features/feature.h>
45
#include <pcl/registration/correspondence_types.h>
46
#include <pcl/correspondence.h>
47
48
namespace
pcl
{
49
namespace
registration
{
50
/** \brief TransformationValidation represents the base class for methods
51
* that validate the correctness of a transformation found through \ref
52
* TransformationEstimation.
53
*
54
* The inputs for a validation estimation can take any or all of the following:
55
*
56
* - source point cloud
57
* - target point cloud
58
* - estimated transformation between source and target
59
*
60
* The output is in the form of a score or a confidence measure.
61
*
62
* \note The class is templated on the source and target point types as well as on the
63
* output scalar of the transformation matrix (i.e., float or double). Default: float.
64
* \author Radu B. Rusu
65
* \ingroup registration
66
*/
67
template
<
typename
Po
int
Source,
typename
Po
int
Target,
typename
Scalar =
float
>
68
class
TransformationValidation
{
69
public
:
70
using
Matrix4
= Eigen::Matrix<Scalar, 4, 4>;
71
using
Ptr
= shared_ptr<TransformationValidation<PointSource, PointTarget, Scalar>>;
72
using
ConstPtr
=
73
shared_ptr<const TransformationValidation<PointSource, PointTarget, Scalar>>;
74
75
using
PointCloudSource
=
pcl::PointCloud<PointSource>
;
76
using
PointCloudSourcePtr
=
typename
PointCloudSource::Ptr
;
77
using
PointCloudSourceConstPtr
=
typename
PointCloudSource::ConstPtr
;
78
79
using
PointCloudTarget
=
pcl::PointCloud<PointTarget>
;
80
using
PointCloudTargetPtr
=
typename
PointCloudTarget::Ptr
;
81
using
PointCloudTargetConstPtr
=
typename
PointCloudTarget::ConstPtr
;
82
83
TransformationValidation
() =
default
;
84
virtual
~TransformationValidation
() =
default
;
85
86
/** \brief Validate the given transformation with respect to the input cloud data, and
87
* return a score. Pure virtual.
88
*
89
* \param[in] cloud_src the source point cloud dataset
90
* \param[in] cloud_tgt the target point cloud dataset
91
* \param[out] transformation_matrix the transformation matrix
92
*
93
* \return the score or confidence measure for the given
94
* transformation_matrix with respect to the input data
95
*/
96
virtual
double
97
validateTransformation
(
const
PointCloudSourceConstPtr
& cloud_src,
98
const
PointCloudTargetConstPtr
& cloud_tgt,
99
const
Matrix4
& transformation_matrix)
const
= 0;
100
101
/** \brief Comparator function for deciding which score is better after running the
102
* validation on multiple transforms. Pure virtual.
103
*
104
* \note For example, for Euclidean distances smaller is better, for inliers the
105
* opposite.
106
*
107
* \param[in] score1 the first value
108
* \param[in] score2 the second value
109
*
110
* \return true if score1 is better than score2
111
*/
112
virtual
bool
113
operator()
(
const
double
& score1,
const
double
& score2)
const
= 0;
114
115
/** \brief Check if the score is valid for a specific transformation. Pure virtual.
116
*
117
* \param[in] cloud_src the source point cloud dataset
118
* \param[in] cloud_tgt the target point cloud dataset
119
* \param[out] transformation_matrix the transformation matrix
120
*
121
* \return true if the transformation is valid, false otherwise.
122
*/
123
virtual
bool
124
isValid
(
const
PointCloudSourceConstPtr
& cloud_src,
125
const
PointCloudTargetConstPtr
& cloud_tgt,
126
const
Matrix4
& transformation_matrix)
const
= 0;
127
};
128
}
// namespace registration
129
}
// namespace pcl
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition
point_cloud.h:174
pcl::PointCloud< PointSource >::Ptr
shared_ptr< PointCloud< PointSource > > Ptr
Definition
point_cloud.h:414
pcl::PointCloud< PointSource >::ConstPtr
shared_ptr< const PointCloud< PointSource > > ConstPtr
Definition
point_cloud.h:415
pcl::registration::TransformationValidation::PointCloudSourcePtr
typename PointCloudSource::Ptr PointCloudSourcePtr
Definition
transformation_validation.h:76
pcl::registration::TransformationValidation::validateTransformation
virtual double validateTransformation(const PointCloudSourceConstPtr &cloud_src, const PointCloudTargetConstPtr &cloud_tgt, const Matrix4 &transformation_matrix) const =0
Validate the given transformation with respect to the input cloud data, and return a score.
pcl::registration::TransformationValidation::~TransformationValidation
virtual ~TransformationValidation()=default
pcl::registration::TransformationValidation::operator()
virtual bool operator()(const double &score1, const double &score2) const =0
Comparator function for deciding which score is better after running the validation on multiple trans...
pcl::registration::TransformationValidation::TransformationValidation
TransformationValidation()=default
pcl::registration::TransformationValidation::Matrix4
Eigen::Matrix< Scalar, 4, 4 > Matrix4
Definition
transformation_validation.h:70
pcl::registration::TransformationValidation::PointCloudTarget
pcl::PointCloud< PointTarget > PointCloudTarget
Definition
transformation_validation.h:79
pcl::registration::TransformationValidation::Ptr
shared_ptr< TransformationValidation< PointSource, PointTarget, Scalar > > Ptr
Definition
transformation_validation.h:71
pcl::registration::TransformationValidation::PointCloudSource
pcl::PointCloud< PointSource > PointCloudSource
Definition
transformation_validation.h:75
pcl::registration::TransformationValidation::isValid
virtual bool isValid(const PointCloudSourceConstPtr &cloud_src, const PointCloudTargetConstPtr &cloud_tgt, const Matrix4 &transformation_matrix) const =0
Check if the score is valid for a specific transformation.
pcl::registration::TransformationValidation::ConstPtr
shared_ptr< const TransformationValidation< PointSource, PointTarget, Scalar > > ConstPtr
Definition
transformation_validation.h:72
pcl::registration::TransformationValidation::PointCloudTargetPtr
typename PointCloudTarget::Ptr PointCloudTargetPtr
Definition
transformation_validation.h:80
pcl::registration::TransformationValidation::PointCloudSourceConstPtr
typename PointCloudSource::ConstPtr PointCloudSourceConstPtr
Definition
transformation_validation.h:77
pcl::registration::TransformationValidation::PointCloudTargetConstPtr
typename PointCloudTarget::ConstPtr PointCloudTargetConstPtr
Definition
transformation_validation.h:81
pcl::registration
Definition
convergence_criteria.h:46
pcl
Definition
convolution.h:46