Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
pcl
filters
shadowpoints.h
1
/*
2
* Software License Agreement (BSD License)
3
*
4
* Point Cloud Library (PCL) - www.pointclouds.org
5
* Copyright (c) 2009-2011, Willow Garage, 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/filters/filter_indices.h>
41
42
namespace
pcl
43
{
44
/** \brief @b ShadowPoints removes the ghost points appearing on edge discontinuties
45
*
46
* \author Aravindhan K Krishnan. This code is ported from libpointmatcher (https://github.com/ethz-asl/libpointmatcher)
47
* \ingroup filters
48
*/
49
template
<
typename
Po
int
T,
typename
NormalT>
50
class
ShadowPoints
:
public
FilterIndices
<PointT>
51
{
52
using
FilterIndices
<PointT>
::filter_name_
;
53
using
FilterIndices
<PointT>
::getClassName
;
54
using
FilterIndices
<PointT>
::indices_
;
55
using
FilterIndices
<PointT>
::input_
;
56
using
FilterIndices
<PointT>
::removed_indices_
;
57
using
FilterIndices
<PointT>
::extract_removed_indices_
;
58
using
FilterIndices
<PointT>
::negative_
;
59
using
FilterIndices
<PointT>
::user_filter_value_
;
60
using
FilterIndices
<PointT>
::keep_organized_
;
61
62
using
PointCloud =
typename
FilterIndices<PointT>::PointCloud
;
63
using
PointCloudPtr =
typename
PointCloud::Ptr
;
64
using
PointCloudConstPtr =
typename
PointCloud::ConstPtr
;
65
using
NormalsPtr =
typename
pcl::PointCloud<NormalT>::Ptr
;
66
67
public
:
68
69
using
Ptr
= shared_ptr< ShadowPoints<PointT, NormalT> >;
70
using
ConstPtr
= shared_ptr< const ShadowPoints<PointT, NormalT> >;
71
72
/** \brief Empty constructor. */
73
ShadowPoints
(
bool
extract_removed_indices =
false
) :
74
FilterIndices
<PointT> (extract_removed_indices),
75
input_normals_
()
76
{
77
filter_name_
=
"ShadowPoints"
;
78
}
79
80
/** \brief Set the normals computed on the input point cloud
81
* \param[in] normals the normals computed for the input cloud
82
*/
83
inline
void
84
setNormals
(
const
NormalsPtr &normals) {
input_normals_
= normals; }
85
86
/** \brief Get the normals computed on the input point cloud */
87
inline
NormalsPtr
88
getNormals
()
const
{
return
(
input_normals_
); }
89
90
/** \brief Set the threshold for shadow points rejection
91
* \param[in] threshold the threshold
92
*/
93
inline
void
94
setThreshold
(
float
threshold) { threshold_ = threshold; }
95
96
/** \brief Get the threshold for shadow points rejection */
97
inline
float
98
getThreshold
()
const
{
return
threshold_; }
99
100
protected
:
101
102
/** \brief The normals computed at each point in the input cloud */
103
NormalsPtr
input_normals_
;
104
105
/** \brief Sample of point indices into a separate PointCloud
106
* \param[out] output the resultant point cloud
107
*/
108
void
109
applyFilter
(PointCloud &output)
override
;
110
111
/** \brief Sample of point indices
112
* \param[out] indices the resultant point cloud indices
113
*/
114
void
115
applyFilter
(
Indices
&indices)
override
;
116
117
private
:
118
119
/** \brief Threshold for shadow point rejection
120
*/
121
float
threshold_{0.1f};
122
};
123
}
124
125
#ifdef PCL_NO_PRECOMPILE
126
#include <pcl/filters/impl/shadowpoints.hpp>
127
#endif
pcl::Filter::extract_removed_indices_
bool extract_removed_indices_
Set to true if we want to return the indices of the removed points.
Definition
filter.h:161
pcl::Filter::getClassName
const std::string & getClassName() const
Get a string representation of the name of this class.
Definition
filter.h:174
pcl::Filter::filter_name_
std::string filter_name_
The filter name.
Definition
filter.h:158
pcl::Filter::removed_indices_
IndicesPtr removed_indices_
Indices of the points that are removed.
Definition
filter.h:155
pcl::FilterIndices::user_filter_value_
float user_filter_value_
The user given value that the filtered point dimensions should be set to (default = NaN).
Definition
filter_indices.h:173
pcl::FilterIndices::keep_organized_
bool keep_organized_
False = remove points (default), true = redefine points, keep structure.
Definition
filter_indices.h:170
pcl::FilterIndices::FilterIndices
FilterIndices(bool extract_removed_indices=false)
Constructor.
Definition
filter_indices.h:87
pcl::FilterIndices::negative_
bool negative_
False = normal filter behavior (default), true = inverted behavior.
Definition
filter_indices.h:167
pcl::FilterIndices::PointCloud
pcl::PointCloud< PointT > PointCloud
Definition
filter_indices.h:78
pcl::PCLBase::input_
PointCloudConstPtr input_
The input point cloud dataset.
Definition
pcl_base.h:147
pcl::PCLBase::indices_
IndicesPtr indices_
A pointer to the vector of point indices to use.
Definition
pcl_base.h:150
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::ShadowPoints::setNormals
void setNormals(const NormalsPtr &normals)
Set the normals computed on the input point cloud.
Definition
shadowpoints.h:84
pcl::ShadowPoints::ConstPtr
shared_ptr< const ShadowPoints< PointT, NormalT > > ConstPtr
Definition
shadowpoints.h:70
pcl::ShadowPoints::input_normals_
NormalsPtr input_normals_
The normals computed at each point in the input cloud.
Definition
shadowpoints.h:103
pcl::ShadowPoints::getNormals
NormalsPtr getNormals() const
Get the normals computed on the input point cloud.
Definition
shadowpoints.h:88
pcl::ShadowPoints::getThreshold
float getThreshold() const
Get the threshold for shadow points rejection.
Definition
shadowpoints.h:98
pcl::ShadowPoints::applyFilter
void applyFilter(PointCloud &output) override
Sample of point indices into a separate PointCloud.
Definition
shadowpoints.hpp:47
pcl::ShadowPoints::Ptr
shared_ptr< ShadowPoints< PointT, NormalT > > Ptr
Definition
shadowpoints.h:69
pcl::ShadowPoints::setThreshold
void setThreshold(float threshold)
Set the threshold for shadow points rejection.
Definition
shadowpoints.h:94
pcl::ShadowPoints::ShadowPoints
ShadowPoints(bool extract_removed_indices=false)
Empty constructor.
Definition
shadowpoints.h:73
pcl
Definition
convolution.h:46
pcl::Indices
IndicesAllocator<> Indices
Type used for indices in PCL.
Definition
types.h:133