44#include <pcl/common/io.h>
45#include <pcl/common/point_tests.h>
46#include <pcl/filters/local_maximum.h>
47#include <pcl/filters/project_inliers.h>
48#include <pcl/ModelCoefficients.h>
49#include <pcl/search/organized.h>
50#include <pcl/search/kdtree.h>
53template <
typename Po
intT>
void
59 PCL_WARN (
"[pcl::%s::applyFilter] No input dataset given!\n", getClassName ().
c_str ());
68 applyFilterIndices (indices);
73template <
typename Po
intT>
void
80 coefficients->values.resize (4);
81 coefficients->values[0] = coefficients->values[1] = 0;
82 coefficients->values[2] = 1.0;
83 coefficients->values[3] = 0;
88 proj.setInputCloud (input_);
89 proj.setModelCoefficients (coefficients);
95 if (input_->isOrganized ())
103 indices.resize (indices_->size ());
104 removed_indices_->resize (indices_->size ());
107 std::vector<bool>
point_is_max (indices_->size (),
false);
113 for (
const auto&
iii : (*indices_))
137 PCL_WARN (
"[pcl::%s::applyFilter] Searching for neighbors within radius %f failed.\n", getClassName ().
c_str (), radius_);
173 if (extract_removed_indices_)
175 (*removed_indices_)[
rii++] =
iii;
186 indices.resize (
oii);
187 removed_indices_->resize (
rii);
190#define PCL_INSTANTIATE_LocalMaximum(T) template class PCL_EXPORTS pcl::LocalMaximum<T>;
Iterator class for point clouds with or without given indices.
std::size_t size() const
Size of the range the iterator is going through.
void applyFilter(PointCloud &output) override
Downsample a Point Cloud by eliminating points that are locally maximal in z.
void applyFilterIndices(Indices &indices)
Filtered results are indexed by an indices array.
typename FilterIndices< PointT >::PointCloud PointCloud
shared_ptr< PointCloud< PointT > > Ptr
search::KdTree is a wrapper class which inherits the pcl::KdTree class for performing search function...
OrganizedNeighbor is a class for optimized nearest neigbhor search in organized point clouds.
bool isFinite(const PointT &pt)
Tests if the 3D components of a point are all finite param[in] pt point to be tested return true if f...
IndicesAllocator<> Indices
Type used for indices in PCL.
shared_ptr< ::pcl::ModelCoefficients > Ptr
A point structure representing Euclidean xyz coordinates, and the RGB color.