36 #ifndef PCL_CUDA_FILTERS_VOXELGRID_H_ 37 #define PCL_CUDA_FILTERS_VOXELGRID_H_ 39 #include <pcl_cuda/filters/filter.h> 40 #include <pcl_cuda/filters/passthrough.h> 41 #include <thrust/count.h> 42 #include <thrust/remove.h> 43 #include <vector_types.h> 50 template <
typename CloudT>
56 typedef typename PCLCUDABase<CloudT>::PointCloud
PointCloud;
73 std::cerr <<
"applyFilter" << std::endl;
96 output.points.resize (input_->points.size ());
98 Device<PointXYZRGB>::type::iterator nr_points = thrust::copy_if (input_->points.begin (), input_->points.end (), output.points.begin (),
isFiniteAOS ());
99 output.points.resize (nr_points - output.points.begin ());
134 output.resize (input_->size ());
136 Device<float>::type::iterator nr_points = thrust::copy_if (input_->points_x.begin (), input_->points_x.end (), output.points_x.begin (),
isFiniteSOA ());
137 nr_points = thrust::copy_if (input_->points_y.begin (), input_->points_y.end (), output.points_y.begin (),
isFiniteSOA ());
138 nr_points = thrust::copy_if (input_->points_z.begin (), input_->points_z.end (), output.points_z.begin (),
isFiniteSOA ());
139 output.resize (nr_points - output.points_z.begin ());
148 PointCloud::zip_iterator result = thrust::remove_if (output.zip_begin (), output.zip_end (),
isFiniteZIPSOA ());
149 PointCloud::iterator_tuple result_tuple = result.get_iterator_tuple ();
150 PointCloud::float_iterator xiter = thrust::get<0> (result_tuple),
151 yiter = thrust::get<1> (result_tuple),
152 ziter = thrust::get<2> (result_tuple);
154 unsigned badpoints =
distance (xiter, output.points_x.end ());
155 unsigned goodpoints =
distance (output.points_x.begin (), xiter);
157 output.resize (goodpoints);
169 #endif //#ifndef PCL_FILTERS_VOXELGRID_H_ void applyFilter(PointCloud &output)
Filter a Point Cloud.
PointCloud::Ptr PointCloudPtr
PointCloud::ConstPtr PointCloudConstPtr
Check if a specific point is valid or not.
Check if a specific point is valid or not.
boost::shared_ptr< PointCloud< PointT > > Ptr
VoxelGrid()
Empty constructor.
VoxelGrid assembles a local 3D grid over a given PointCloud, and downsamples + filters the data...
VoxelGrid()
Empty constructor.
VoxelGrid()
Empty constructor.
float distance(const PointT &p1, const PointT &p2)
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
PCLCUDABase< PointCloudAOS< Device > >::PointCloud PointCloud
Removes points with x, y, or z equal to NaN.
Check if a specific point is valid or not.
void applyFilter(PointCloud &output)
Filter a Point Cloud.
std::string filter_name_
The filter name.
PCLCUDABase< CloudT >::PointCloud PointCloud
void applyFilter(PointCloud &output)
Filter a Point Cloud.