39 #ifndef PCL_FEATURES_GASD_H_
40 #define PCL_FEATURES_GASD_H_
42 #include <pcl/features/feature.h>
43 #include <pcl/common/common.h>
44 #include <pcl/point_cloud.h>
76 template <
typename Po
intInT,
typename Po
intOutT = GASDSignature512>
82 typedef boost::shared_ptr<GASDEstimation<PointInT, PointOutT> >
Ptr;
83 typedef boost::shared_ptr<const GASDEstimation<PointInT, PointOutT> >
ConstPtr;
91 GASDEstimation (
const Eigen::Vector3f &view_direction = Eigen::Vector3f (0.0f, 0.0f, 1.0f),
92 const size_t shape_half_grid_size = 4,
93 const size_t shape_hists_size = 1,
95 view_direction_ (view_direction),
96 shape_half_grid_size_ (shape_half_grid_size),
97 shape_hists_size_ (shape_hists_size),
98 shape_interp_ (shape_interp)
111 view_direction_ = dir;
120 shape_half_grid_size_ = shgs;
131 shape_hists_size_ = shs;
140 shape_interp_ = interp;
146 const Eigen::Matrix4f&
189 const float max_coord,
190 const size_t half_grid_size,
193 const float hist_incr,
194 std::vector<Eigen::VectorXf> &hists);
205 Eigen::Matrix4f transform_;
208 Eigen::Vector3f view_direction_;
211 size_t shape_half_grid_size_;
214 size_t shape_hists_size_;
221 computeAlignmentTransform ();
231 copyShapeHistogramsToOutput (
const size_t grid_size,
232 const size_t hists_size,
233 const std::vector<Eigen::VectorXf> &hists,
258 template <
typename Po
intInT,
typename Po
intOutT = GASDSignature984>
263 typedef boost::shared_ptr<GASDColorEstimation<PointInT, PointOutT> >
Ptr;
264 typedef boost::shared_ptr<const GASDColorEstimation<PointInT, PointOutT> >
ConstPtr;
276 const size_t shape_half_grid_size = 3,
277 const size_t shape_hists_size = 1,
278 const size_t color_half_grid_size = 2,
279 const size_t color_hists_size = 12,
282 GASDEstimation<PointInT, PointOutT> (view_direction, shape_half_grid_size, shape_hists_size, shape_interp),
283 color_half_grid_size_ (color_half_grid_size),
284 color_hists_size_ (color_hists_size),
285 color_interp_ (color_interp)
296 color_half_grid_size_ = chgs;
305 color_hists_size_ = chs;
314 color_interp_ = interp;
331 size_t color_half_grid_size_;
334 size_t color_hists_size_;
347 copyColorHistogramsToOutput (
const size_t grid_size,
348 const size_t hists_size,
349 std::vector<Eigen::VectorXf> &hists,
362 #ifdef PCL_NO_PRECOMPILE
363 #include <pcl/features/impl/gasd.hpp>
366 #endif //#ifndef PCL_FEATURES_GASD_H_
quadrilinear interpolation
void compute(PointCloudOut &output)
Overloaded computed method from pcl::Feature.
std::string feature_name_
The feature name.
This file defines compatibility wrappers for low level I/O functions.
int k_
The number of K nearest neighbors to use for each point.
PointCloudIn shape_samples_
Point cloud aligned to the canonical coordinate system.
GASDColorEstimation estimates the Globally Aligned Spatial Distribution (GASD) descriptor for a given...
boost::shared_ptr< GASDEstimation< PointInT, PointOutT > > Ptr
pcl::PointCloud< PointOutT > PointCloudOut
boost::shared_ptr< GASDColorEstimation< PointInT, PointOutT > > Ptr
void setColorHalfGridSize(const size_t chgs)
Set the color half grid size.
void setShapeHistsInterpMethod(const HistogramInterpolationMethod interp)
Set the shape histograms interpolation method.
void setColorHistsInterpMethod(const HistogramInterpolationMethod interp)
Set the color histograms interpolation method.
boost::shared_ptr< const GASDEstimation< PointInT, PointOutT > > ConstPtr
void setViewDirection(const Eigen::Vector3f &dir)
Set the view direction.
HistogramInterpolationMethod
Different histogram interpolation methods.
void setShapeHalfGridSize(const size_t shgs)
Set the shape half grid size.
float hist_incr_
Normalized sample contribution with respect to the total number of points in the cloud.
boost::shared_ptr< const GASDColorEstimation< PointInT, PointOutT > > ConstPtr
void computeFeature(PointCloudOut &output)
Estimate GASD descriptor.
GASDColorEstimation(const Eigen::Vector3f &view_direction=Eigen::Vector3f(0.0f, 0.0f, 1.0f), const size_t shape_half_grid_size=3, const size_t shape_hists_size=1, const size_t color_half_grid_size=2, const size_t color_hists_size=12, const HistogramInterpolationMethod shape_interp=INTERP_NONE, const HistogramInterpolationMethod color_interp=INTERP_NONE)
Constructor.
GASDEstimation estimates the Globally Aligned Spatial Distribution (GASD) descriptor for a given poin...
float max_coord_
Normalization factor with respect to axis-aligned bounding cube centered on the origin.
void setShapeHistsSize(const size_t shs)
Set the shape histograms size.
GASDEstimation(const Eigen::Vector3f &view_direction=Eigen::Vector3f(0.0f, 0.0f, 1.0f), const size_t shape_half_grid_size=4, const size_t shape_hists_size=1, const HistogramInterpolationMethod shape_interp=INTERP_TRILINEAR)
Constructor.
const Eigen::Matrix4f & getTransform() const
Returns the transformation aligning the point cloud to the canonical coordinate system.
void addSampleToHistograms(const Eigen::Vector4f &p, const float max_coord, const size_t half_grid_size, const HistogramInterpolationMethod interp, const float hbin, const float hist_incr, std::vector< Eigen::VectorXf > &hists)
add a sample to its respective histogram, optionally performing interpolation.
Feature represents the base feature class.
size_t pos_
Current position of output descriptor point cloud.
void setColorHistsSize(const size_t chs)
Set the color histograms size (number of bins in the hue histogram for each cell of the 3D regular gr...
double search_radius_
The nearest neighbors search radius for each point.