Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
pcl
keypoints
smoothed_surfaces_keypoint.h
1
/*
2
* Software License Agreement (BSD License)
3
*
4
* Copyright (c) 2011, Alexandru-Eugen Ichim
5
* Willow Garage, Inc
6
* All rights reserved.
7
*
8
* Redistribution and use in source and binary forms, with or without
9
* modification, are permitted provided that the following conditions
10
* are met:
11
*
12
* * Redistributions of source code must retain the above copyright
13
* notice, this list of conditions and the following disclaimer.
14
* * Redistributions in binary form must reproduce the above
15
* copyright notice, this list of conditions and the following
16
* disclaimer in the documentation and/or other materials provided
17
* with the distribution.
18
* * Neither the name of Willow Garage, Inc. nor the names of its
19
* contributors may be used to endorse or promote products derived
20
* from this software without specific prior written permission.
21
*
22
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33
* POSSIBILITY OF SUCH DAMAGE.
34
*
35
* $Id$
36
*/
37
38
#pragma once
39
40
#include <pcl/keypoints/keypoint.h>
41
42
namespace
pcl
43
{
44
/** \brief
45
* Based on the paper:
46
* Xinju Li and Igor Guskov
47
* Multi-scale features for approximate alignment of point-based surfaces
48
* Proceedings of the third Eurographics symposium on Geometry processing
49
* July 2005, Vienna, Austria
50
*
51
* \author Alexandru-Eugen Ichim
52
*/
53
template
<
typename
Po
int
T,
typename
Po
int
NT>
54
class
SmoothedSurfacesKeypoint
:
public
Keypoint
<PointT, PointT>
55
{
56
public
:
57
using
Ptr
= shared_ptr<SmoothedSurfacesKeypoint<PointT, PointNT> >;
58
using
ConstPtr
= shared_ptr<const SmoothedSurfacesKeypoint<PointT, PointNT> >;
59
60
using
PCLBase
<PointT>
::input_
;
61
using
Keypoint
<PointT, PointT>
::name_
;
62
using
Keypoint
<PointT, PointT>
::tree_
;
63
using
Keypoint
<PointT, PointT>
::keypoints_indices_
;
64
using
Keypoint
<PointT, PointT>
::initCompute
;
65
66
using
PointCloudT
=
pcl::PointCloud<PointT>
;
67
using
PointCloudTConstPtr
=
typename
PointCloudT::ConstPtr
;
68
using
PointCloudNT
=
pcl::PointCloud<PointNT>
;
69
using
PointCloudNTConstPtr
=
typename
PointCloudNT::ConstPtr
;
70
using
PointCloudTPtr
=
typename
PointCloudT::Ptr
;
71
using
KdTreePtr
=
typename
Keypoint<PointT, PointT>::KdTreePtr
;
72
73
SmoothedSurfacesKeypoint
()
74
:
Keypoint
<PointT, PointT> (),
75
clouds_ (),
76
cloud_normals_ (),
77
cloud_trees_ (),
78
normals_ ()
79
{
80
name_
=
"SmoothedSurfacesKeypoint"
;
81
82
// hack to pass the initCompute () check of Keypoint - although it is never used in SmoothedSurfacesKeypoint
83
Keypoint<PointT, PointT>::search_radius_
= 0.1;
84
}
85
86
void
87
addSmoothedPointCloud
(
const
PointCloudTConstPtr
&cloud,
88
const
PointCloudNTConstPtr
&normals,
89
KdTreePtr
&kdtree,
90
float
&scale);
91
92
93
void
94
resetClouds
();
95
96
inline
void
97
setNeighborhoodConstant
(
float
neighborhood_constant) { neighborhood_constant_ = neighborhood_constant; }
98
99
inline
float
100
getNeighborhoodConstant
() {
return
neighborhood_constant_; }
101
102
inline
void
103
setInputNormals
(
const
PointCloudNTConstPtr
&normals) { normals_ = normals; }
104
105
inline
void
106
setInputScale
(
float
input_scale) { input_scale_ = input_scale; }
107
108
void
109
detectKeypoints
(PointCloudT &output)
override
;
110
111
protected
:
112
bool
113
initCompute
()
override
;
114
115
private
:
116
float
neighborhood_constant_{0.5f};
117
std::vector<PointCloudTConstPtr> clouds_;
118
std::vector<PointCloudNTConstPtr> cloud_normals_;
119
std::vector<KdTreePtr> cloud_trees_;
120
PointCloudNTConstPtr
normals_;
121
std::vector<std::pair<float, std::size_t> > scales_;
122
float
input_scale_{0.0f};
123
std::size_t input_index_{0u};
124
125
static
bool
126
compareScalesFunction (
const
std::pair<float, std::size_t> &a,
127
const
std::pair<float, std::size_t> &b) {
return
a.first < b.first; }
128
};
129
}
pcl::Keypoint< PointT, PointT >::Keypoint
Keypoint()=default
pcl::Keypoint< PointT, PointT >::name_
std::string name_
Definition
keypoint.h:167
pcl::Keypoint< PointT, PointT >::keypoints_indices_
pcl::PointIndicesPtr keypoints_indices_
Definition
keypoint.h:191
pcl::Keypoint::KdTreePtr
typename KdTree::Ptr KdTreePtr
Definition
keypoint.h:65
pcl::Keypoint< PointT, PointT >::tree_
KdTreePtr tree_
Definition
keypoint.h:179
pcl::Keypoint::search_radius_
double search_radius_
The nearest neighbors search radius for each point.
Definition
keypoint.h:185
pcl::PCLBase
PCL base class.
Definition
pcl_base.h:70
pcl::PCLBase< PointInT >::input_
PointCloudConstPtr input_
Definition
pcl_base.h:147
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition
point_cloud.h:174
pcl::PointCloud::Ptr
shared_ptr< PointCloud< PointT > > Ptr
Definition
point_cloud.h:414
pcl::PointCloud::ConstPtr
shared_ptr< const PointCloud< PointT > > ConstPtr
Definition
point_cloud.h:415
pcl::SmoothedSurfacesKeypoint::resetClouds
void resetClouds()
Definition
smoothed_surfaces_keypoint.hpp:61
pcl::SmoothedSurfacesKeypoint::setNeighborhoodConstant
void setNeighborhoodConstant(float neighborhood_constant)
Definition
smoothed_surfaces_keypoint.h:97
pcl::SmoothedSurfacesKeypoint::SmoothedSurfacesKeypoint
SmoothedSurfacesKeypoint()
Definition
smoothed_surfaces_keypoint.h:73
pcl::SmoothedSurfacesKeypoint::setInputNormals
void setInputNormals(const PointCloudNTConstPtr &normals)
Definition
smoothed_surfaces_keypoint.h:103
pcl::SmoothedSurfacesKeypoint::PointCloudNTConstPtr
typename PointCloudNT::ConstPtr PointCloudNTConstPtr
Definition
smoothed_surfaces_keypoint.h:69
pcl::SmoothedSurfacesKeypoint::getNeighborhoodConstant
float getNeighborhoodConstant()
Definition
smoothed_surfaces_keypoint.h:100
pcl::SmoothedSurfacesKeypoint::initCompute
bool initCompute() override
Definition
smoothed_surfaces_keypoint.hpp:182
pcl::SmoothedSurfacesKeypoint::PointCloudTPtr
typename PointCloudT::Ptr PointCloudTPtr
Definition
smoothed_surfaces_keypoint.h:70
pcl::SmoothedSurfacesKeypoint::KdTreePtr
typename Keypoint< PointT, PointT >::KdTreePtr KdTreePtr
Definition
smoothed_surfaces_keypoint.h:71
pcl::SmoothedSurfacesKeypoint::addSmoothedPointCloud
void addSmoothedPointCloud(const PointCloudTConstPtr &cloud, const PointCloudNTConstPtr &normals, KdTreePtr &kdtree, float &scale)
Definition
smoothed_surfaces_keypoint.hpp:47
pcl::SmoothedSurfacesKeypoint::PointCloudNT
pcl::PointCloud< PointNT > PointCloudNT
Definition
smoothed_surfaces_keypoint.h:68
pcl::SmoothedSurfacesKeypoint::ConstPtr
shared_ptr< const SmoothedSurfacesKeypoint< PointT, PointNT > > ConstPtr
Definition
smoothed_surfaces_keypoint.h:58
pcl::SmoothedSurfacesKeypoint::setInputScale
void setInputScale(float input_scale)
Definition
smoothed_surfaces_keypoint.h:106
pcl::SmoothedSurfacesKeypoint::PointCloudTConstPtr
typename PointCloudT::ConstPtr PointCloudTConstPtr
Definition
smoothed_surfaces_keypoint.h:67
pcl::SmoothedSurfacesKeypoint::detectKeypoints
void detectKeypoints(PointCloudT &output) override
Definition
smoothed_surfaces_keypoint.hpp:71
pcl::SmoothedSurfacesKeypoint::Ptr
shared_ptr< SmoothedSurfacesKeypoint< PointT, PointNT > > Ptr
Definition
smoothed_surfaces_keypoint.h:57
pcl::SmoothedSurfacesKeypoint::PointCloudT
pcl::PointCloud< PointT > PointCloudT
Definition
smoothed_surfaces_keypoint.h:66
pcl
Definition
convolution.h:46