40 #ifndef PCL_CUDA_SAMPLE_CONSENSUS_MODEL_1POINT_PLANE_H_
41 #define PCL_CUDA_SAMPLE_CONSENSUS_MODEL_1POINT_PLANE_H_
43 #include <pcl/cuda/sample_consensus/sac_model.h>
44 #include <thrust/random.h>
57 coefficients(coeff), threshold(thresh)
60 template <
typename Tuple> __inline__ __host__ __device__
bool
65 template <
template <
typename>
class Storage>
70 const typename Storage<PointXYZRGB>::type &
input_;
73 coefficients(coeff), threshold(thresh), input_(input)
76 __inline__ __host__ __device__
int
87 coefficients(coeff), threshold(thresh)
90 template <
typename Tuple> __inline__ __host__ __device__
int
101 coefficients(coeff), threshold(thresh)
104 __inline__ __host__ __device__
int
116 coefficients(coeff), threshold(thresh), angle_threshold (angle_thresh)
119 template <
typename Tuple> __inline__ __host__ __device__
int
131 coefficients(coeff), threshold(thresh), angle_threshold (angle_thresh)
134 __inline__ __host__ __device__
int
146 coefficients(coeff), threshold(thresh), angle_threshold (angle_thresh)
149 template <
typename Tuple>
150 __inline__ __host__ __device__
int
157 template <
template <
typename>
class Storage>
180 typedef boost::shared_ptr<SampleConsensusModel1PointPlane>
Ptr;
193 getSamples (
int &iterations, Indices &samples);
220 float threshold, IndicesPtr &inliers, IndicesPtr &inliers_stencil);
224 IndicesPtr &inliers, IndicesPtr &inliers_stencil);
228 IndicesPtr &inliers_stencil,
242 template <
template <
typename>
class Storage>
256 input(_input), indices(_indices), nr_indices(_nr_indices), bad_value(bad)
260 __inline__ __host__ __device__ float4
266 template <
template <
typename>
class Storage>
281 thrust::default_random_engine
rng;
284 input(_input), normals_(normals), indices(_indices), width_(width), height_(height), nr_indices(_nr_indices), bad_value(bad)
289 __inline__ __host__ __device__ thrust::tuple<int,float4>
297 __inline__ __host__ __device__
303 __inline__ __host__ __device__
306 thrust::default_random_engine rng(
m_seed);
318 #endif //#ifndef PCL_CUDA_SAMPLE_CONSENSUS_MODEL_PLANE_H_
SampleConsensusModel< Storage >::Indices Indices
Check if a certain tuple is a point inlier.
SampleConsensusModel< Storage >::Coefficients Coefficients
SampleConsensusModel< Storage >::Hypotheses Hypotheses
CheckPlanarInlier(float4 coeff, float thresh)
SampleConsensusModel< Storage >::Indices Indices
SampleConsensusModel represents the base model class.
const PointXYZRGB * input
boost::shared_ptr< typename Storage< int >::type > IndicesPtr
This file defines compatibility wrappers for low level I/O functions.
SampleConsensusModel1PointPlane(const PointCloudConstPtr &cloud)
Constructor for base SampleConsensusModel1PointPlane.
PointCloudAOS represents an AOS (Array of Structs) PointCloud implementation for CUDA processing...
__inline__ __host__ __device__ int operator()(const Tuple &t, const int &idx)
int selectWithinDistance(const Coefficients &model_coefficients, float threshold, IndicesPtr &inliers, IndicesPtr &inliers_stencil)
Select all the points which respect the given model coefficients as inliers.
Storage< int >::type Samples
PointCloud::ConstPtr PointCloudConstPtr
__inline__ __host__ __device__ thrust::tuple< int, float4 > operator()(int t)
boost::shared_ptr< const typename Storage< int >::type > IndicesConstPtr
Storage< float >::type Coefficients
SampleConsensusModel< Storage >::IndicesConstPtr IndicesConstPtr
Create1PointPlaneSampleHypothesis(const PointXYZRGB *_input, const float4 *normals, const int *_indices, int width, int height, int _nr_indices, float bad)
SampleConsensusModel1PointPlane defines a model for 3D plane segmentation.
SampleConsensusModel< Storage >::PointCloud PointCloud
Storage< int >::type Indices
SampleConsensusModel< Storage >::IndicesPtr IndicesPtr
__inline__ __host__ __device__ int operator()(const PointXYZRGB &pt, const int &idx)
Check if a certain tuple is a point inlier.
CheckPlanarInlierNormalIndices(float4 coeff, float thresh, float angle_thresh)
SampleConsensusModel< Storage >::PointCloud PointCloud
CheckPlanarInlierIndices(float4 coeff, float thresh)
Storage< float4 >::type Hypotheses
Check if a certain tuple is a point inlier.
__inline__ __host__ __device__ int operator()(const Tuple &pt, const int &idx)
Check if a certain tuple is a point inlier.
SampleConsensusModel< Storage >::Samples Samples
SampleConsensusModel< Storage >::IndicesConstPtr IndicesConstPtr
void getSamples(int &iterations, Indices &samples)
Get 3 random non-collinear points as data samples and return them as point indices.
__inline__ __host__ __device__ int operator()(const int &idx)
SampleConsensusModel< Storage >::PointCloud PointCloud
static const int MAX_ITERATIONS_COLLINEAR
Define the maximum number of iterations for collinearity checks.
boost::shared_ptr< PointCloudAOS< Storage > > Ptr
Check if a certain tuple is a point inlier.
SampleConsensusModel< Storage >::IndicesConstPtr IndicesConstPtr
int countWithinDistance(const Coefficients &model_coefficients, float threshold)
const PointXYZRGB * input
thrust::default_random_engine rng
__inline__ __host__ __device__ int operator()(const PointXYZRGB &pt, const int &idx)
__inline__ __host__ __device__ parallel_random_generator(unsigned int seed)
boost::shared_ptr< SampleConsensusModel1PointPlane > Ptr
SampleConsensusModel< Storage >::Indices Indices
CheckPlanarInlierKinectNormalIndices(float4 coeff, float thresh, float angle_thresh)
CheckPlanarInlierKinectIndices(float4 coeff, float thresh, float angle_thresh)
__inline__ __host__ __device__ bool operator()(const Tuple &t)
NewCheckPlanarInlier(float4 coeff, float thresh, const typename Storage< PointXYZRGB >::type &input)
boost::shared_ptr< const PointCloudAOS< Storage > > ConstPtr
Create1PointPlaneHypothesis(const PointXYZRGB *_input, const int *_indices, int _nr_indices, float bad)
Default point xyz-rgb structure.
PointCloud::Ptr PointCloudPtr
Check if a certain tuple is a point inlier.
__inline__ __host__ __device__ unsigned int operator()(const unsigned int n) const
PointCloud::ConstPtr PointCloudConstPtr
__inline__ __host__ __device__ int operator()(const Tuple &t)
bool computeModelCoefficients(const Indices &samples, Coefficients &model_coefficients)
Check whether the given index samples can form a valid plane model, compute the model coefficients fr...
__inline__ __host__ __device__ float4 operator()(int t)
PointCloud::ConstPtr PointCloudConstPtr
CountPlanarInlier(float4 coeff, float thresh)
Check if a certain tuple is a point inlier.
Check if a certain tuple is a point inlier.
Check if a certain tuple is a point inlier.
const Storage< PointXYZRGB >::type & input_
bool generateModelHypotheses(Hypotheses &h, int max_iterations)