38 #ifndef PCL_CUDA_SAMPLE_CONSENSUS_MODEL_H_
39 #define PCL_CUDA_SAMPLE_CONSENSUS_MODEL_H_
42 #include <thrust/sequence.h>
43 #include <thrust/count.h>
44 #include <thrust/remove.h>
45 #include <pcl/cuda/point_cloud.h>
46 #include <thrust/random/linear_congruential_engine.h>
48 #include <pcl/pcl_exports.h>
60 template <
typename Tuple> __inline__ __host__ __device__
int
67 __inline__ __host__ __device__
bool
73 __inline__ __host__ __device__
bool
77 return (isnan (pt.
x) | isnan (pt.
y) | isnan (pt.
z)) == 1;
79 return (pcl_isnan (pt.
x) | pcl_isnan (pt.
y) | pcl_isnan (pt.
z)) == 1;
87 template <
template <
typename>
class Storage>
95 typedef boost::shared_ptr<SampleConsensusModel>
Ptr;
96 typedef boost::shared_ptr<const SampleConsensusModel>
ConstPtr;
98 typedef typename Storage<int>::type
Indices;
99 typedef boost::shared_ptr<typename Storage<int>::type>
IndicesPtr;
152 getSamples (
int &iterations, Indices &samples) = 0;
172 {
return ((*inliers_stencil)[samples[i]] != -1);};
212 IndicesPtr &inliers, IndicesPtr &inliers_stencil) = 0;
216 IndicesPtr &inliers, IndicesPtr &inliers_stencil) = 0;
220 IndicesPtr &inliers_stencil,
221 float3 ¢roid) = 0;
232 deleteIndices (
const Hypotheses &h,
int idx, IndicesPtr &inliers,
const IndicesPtr &inliers_delete);
268 inline PointCloudConstPtr
335 inline boost::shared_ptr<typename Storage<float4>::type>
351 boost::shared_ptr<typename Storage<float4>::type>
normals_;
423 #endif //#ifndef PCL_CUDA_SAMPLE_CONSENSUS_MODEL_H_
PointCloudConstPtr input_
A boost shared pointer to the point cloud data array.
SampleConsensusModel represents the base model class.
boost::shared_ptr< typename Storage< int >::type > IndicesPtr
virtual bool isSampleInlier(IndicesPtr &inliers_stencil, Samples &samples, unsigned int &i)
This file defines compatibility wrappers for low level I/O functions.
PointCloudAOS represents an AOS (Array of Structs) PointCloud implementation for CUDA processing...
void setRadiusLimits(float min_radius, float max_radius)
Set the minimum and maximum allowable radius limits for the model (applicable to models that estimate...
__inline__ __host__ __device__ bool operator()(int x)
Storage< int >::type Samples
Check if a certain tuple is a point inlier.
virtual int countWithinDistance(const Coefficients &model_coefficients, float threshold)=0
boost::shared_ptr< const typename Storage< int >::type > IndicesConstPtr
Storage< float >::type Coefficients
Storage< int >::type Indices
IndicesPtr indices_
A pointer to the vector of point indices to use.
PointCloudConstPtr getInputCloud() const
Get a pointer to the input point cloud dataset.
Storage< float4 >::type Hypotheses
PointCloud::ConstPtr PointCloudConstPtr
boost::shared_ptr< SampleConsensusModel > Ptr
int deleteIndices(const IndicesPtr &indices_stencil)
SampleConsensusModel(const PointCloudConstPtr &cloud)
Constructor for base SampleConsensusModel.
Check if a certain tuple is a point inlier.
boost::shared_ptr< typename Storage< float4 >::type > getNormals()
virtual bool generateModelHypotheses(Hypotheses &h, int max_iterations)=0
IndicesPtr getIndices() const
Get a pointer to the vector of indices used.
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Provide a pointer to the input dataset.
boost::shared_ptr< PointCloudAOS< Storage > > Ptr
boost::shared_ptr< Coefficients > CoefficientsPtr
boost::shared_ptr< const SampleConsensusModel > ConstPtr
__inline__ __host__ __device__ int operator()(const Tuple &t)
thrust::minstd_rand rngl_
Linear-Congruent random number generator engine.
float radius_min_
The minimum and maximum radius limits for the model.
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.
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...
boost::shared_ptr< const PointCloudAOS< Storage > > ConstPtr
PointCloudAOS< Storage > PointCloud
IndicesPtr indices_stencil_
A pointer to the vector of point indices (stencil) to use.
Default point xyz-rgb structure.
__inline__ __host__ __device__ bool operator()(PointXYZRGB pt)
unsigned int nr_indices_in_stencil_
number of indices left in indices_stencil_
void setNormals(boost::shared_ptr< typename Storage< float4 >::type > normals)
boost::shared_ptr< typename Storage< float4 >::type > normals_
boost::shared_ptr< const Coefficients > CoefficientsConstPtr
PointCloud::Ptr PointCloudPtr
virtual ~SampleConsensusModel()
Destructor for base SampleConsensusModel.
virtual void getSamples(int &iterations, Indices &samples)=0
Get a set of random data samples and return them as point indices.
void getRadiusLimits(float &min_radius, float &max_radius)
Get the minimum and maximum allowable radius limits for the model as set by the user.