36 #ifndef PCL_CUDA_FILTERS_PASSTHROUGH_H_ 37 #define PCL_CUDA_FILTERS_PASSTHROUGH_H_ 39 #include <pcl_cuda/filters/filter.h> 40 #include <thrust/count.h> 41 #include <thrust/remove.h> 42 #include <vector_types.h> 50 __inline__ __device__
bool 54 return (isfinite (pt.x) && isfinite (pt.y) && isfinite (pt.z));
61 __inline__ __device__
bool 64 return (isfinite (pt));
71 __inline__ __device__
bool 75 return (!isfinite (get<0> (tuple)) ||
76 !isfinite (get<1> (tuple)) ||
77 !isfinite (get<2> (tuple)));
85 template <
typename CloudT>
91 typedef typename PCLCUDABase<CloudT>::PointCloud
PointCloud;
98 filter_name_ =
"PassThrough";
108 std::cerr <<
"applyFilter" << std::endl;
120 filter_name_ =
"PassThroughAOS";
131 output.points.resize (input_->points.size ());
133 Device<PointXYZRGB>::type::iterator nr_points = thrust::copy_if (input_->points.begin (), input_->points.end (), output.points.begin (),
isFiniteAOS ());
135 output.points.resize (nr_points - output.points.begin ());
150 filter_name_ =
"PassThroughSOA";
170 output.resize (input_->size ());
172 Device<float>::type::iterator nr_points = thrust::copy_if (input_->points_x.begin (), input_->points_x.end (), output.points_x.begin (),
isFiniteSOA ());
173 nr_points = thrust::copy_if (input_->points_y.begin (), input_->points_y.end (), output.points_y.begin (),
isFiniteSOA ());
174 nr_points = thrust::copy_if (input_->points_z.begin (), input_->points_z.end (), output.points_z.begin (),
isFiniteSOA ());
175 output.resize (nr_points - output.points_z.begin ());
184 PointCloud::zip_iterator result = thrust::remove_if (output.zip_begin (), output.zip_end (),
isFiniteZIPSOA ());
185 PointCloud::iterator_tuple result_tuple = result.get_iterator_tuple ();
186 PointCloud::float_iterator xiter = thrust::get<0> (result_tuple),
187 yiter = thrust::get<1> (result_tuple),
188 ziter = thrust::get<2> (result_tuple);
190 unsigned badpoints =
distance (xiter, output.points_x.end ());
191 unsigned goodpoints =
distance (output.points_x.begin (), xiter);
193 output.resize (goodpoints);
205 #endif //#ifndef PCL_FILTERS_PASSTHROUGH_H_ void applyFilter(PointCloud &output)
Filter a Point Cloud.
Check if a specific point is valid or not.
__inline__ __device__ bool operator()(const PointXYZRGB &pt)
Check if a specific point is valid or not.
PassThrough()
Empty constructor.
boost::shared_ptr< PointCloud< PointT > > Ptr
PointCloud::Ptr PointCloudPtr
PassThrough uses the base Filter class methods to pass through all data that satisfies the user given...
PassThrough()
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.
PCLCUDABase< CloudT >::PointCloud PointCloud
Check if a specific point is valid or not.
PassThrough()
Empty constructor.
void applyFilter(PointCloud &output)
Filter a Point Cloud.
void applyFilter(PointCloud &output)
Filter a Point Cloud.
PointCloud::ConstPtr PointCloudConstPtr