41 #include <thrust/sequence.h>
42 #include <thrust/count.h>
43 #include <thrust/remove.h>
44 #include <pcl/cuda/point_cloud.h>
45 #include <thrust/random/linear_congruential_engine.h>
47 #include <pcl/pcl_exports.h>
59 template <
typename Tuple> __inline__ __host__ __device__
int
66 __inline__ __host__ __device__
bool
72 __inline__ __host__ __device__
bool
76 return (isnan (pt.
x) | isnan (pt.
y) | isnan (pt.
z)) == 1;
78 return (std::isnan (pt.
x) | std::isnan (pt.
y) | std::isnan (pt.
z)) == 1;
86 template <
template <
typename>
class Storage>
94 using Ptr = shared_ptr<SampleConsensusModel>;
95 using ConstPtr = shared_ptr<const SampleConsensusModel>;
97 using Indices =
typename Storage<int>::type;
98 using IndicesPtr = shared_ptr<typename Storage<int>::type>;
175 {
return ((*inliers_stencil)[samples[i]] != -1);};
224 float3 ¢roid) = 0;
338 inline shared_ptr<typename Storage<float4>::type>
354 shared_ptr<typename Storage<float4>::type>
normals_;
PointCloudAOS represents an AOS (Array of Structs) PointCloud implementation for CUDA processing.
shared_ptr< const PointCloudAOS< Storage > > ConstPtr
shared_ptr< PointCloudAOS< Storage > > Ptr
SampleConsensusModel represents the base model class.
virtual int countWithinDistance(const Coefficients &model_coefficients, float threshold)=0
virtual int selectWithinDistance(const Coefficients &model_coefficients, float threshold, IndicesPtr &inliers, IndicesPtr &inliers_stencil)=0
Select all the points which respect the given model coefficients as inliers.
IndicesPtr getIndices() const
Get a pointer to the vector of indices used.
shared_ptr< typename Storage< float4 >::type > getNormals()
float radius_min_
The minimum and maximum radius limits for the model.
virtual bool computeModelCoefficients(const Indices &samples, Coefficients &model_coefficients)=0
Check whether the given index samples can form a valid model, compute the model coefficients from the...
IndicesPtr indices_stencil_
A pointer to the vector of point indices (stencil) to use.
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Provide a pointer to the input dataset.
IndicesPtr indices_
A pointer to the vector of point indices to use.
shared_ptr< const Coefficients > CoefficientsConstPtr
void setNormals(shared_ptr< typename Storage< float4 >::type > normals)
virtual int selectWithinDistance(Hypotheses &h, int idx, float threshold, IndicesPtr &inliers_stencil, float3 ¢roid)=0
typename Storage< float4 >::type Hypotheses
typename PointCloud::Ptr PointCloudPtr
shared_ptr< typename Storage< float4 >::type > normals_
void setRadiusLimits(float min_radius, float max_radius)
Set the minimum and maximum allowable radius limits for the model (applicable to models that estimate...
virtual int countWithinDistance(const Hypotheses &h, int idx, float threshold)=0
int deleteIndices(const Hypotheses &h, int idx, IndicesPtr &inliers, const IndicesPtr &inliers_delete)
virtual bool generateModelHypotheses(Hypotheses &h, Samples &s, int max_iterations)=0
shared_ptr< const SampleConsensusModel > ConstPtr
PointCloudConstPtr getInputCloud() const
Get a pointer to the input point cloud dataset.
virtual bool generateModelHypotheses(Hypotheses &h, int max_iterations)=0
SampleConsensusModel(const PointCloudConstPtr &cloud)
Constructor for base SampleConsensusModel.
unsigned int nr_indices_in_stencil_
number of indices left in indices_stencil_
shared_ptr< const typename Storage< int >::type > IndicesConstPtr
virtual ~SampleConsensusModel()=default
Destructor for base SampleConsensusModel.
thrust::minstd_rand rngl_
Linear-Congruent random number generator engine.
shared_ptr< Coefficients > CoefficientsPtr
virtual void getSamples(int &iterations, Indices &samples)=0
Get a set of random data samples and return them as point indices.
virtual int selectWithinDistance(const Hypotheses &h, int idx, float threshold, IndicesPtr &inliers, IndicesPtr &inliers_stencil)=0
shared_ptr< typename Storage< int >::type > IndicesPtr
int deleteIndices(const IndicesPtr &indices_stencil)
typename PointCloud::ConstPtr PointCloudConstPtr
typename Storage< float >::type Coefficients
virtual bool isSampleInlier(IndicesPtr &inliers_stencil, Samples &samples, unsigned int &i)
typename Storage< int >::type Indices
PointCloudConstPtr input_
A boost shared pointer to the point cloud data array.
shared_ptr< SampleConsensusModel > Ptr
typename Storage< int >::type Samples
void getRadiusLimits(float &min_radius, float &max_radius)
Get the minimum and maximum allowable radius limits for the model as set by the user.
shared_ptr< Indices > IndicesPtr
Check if a certain tuple is a point inlier.
__inline__ __host__ __device__ int operator()(const Tuple &t)
Default point xyz-rgb structure.
Check if a certain tuple is a point inlier.
__inline__ __host__ __device__ bool operator()(int x)
__inline__ __host__ __device__ bool operator()(PointXYZRGB pt)