41 #include <pcl/features/feature.h>
73 template <
typename Po
intInT,
typename Po
intOutT = GASDSignature512>
79 using Ptr = shared_ptr<GASDEstimation<PointInT, PointOutT> >;
80 using ConstPtr = shared_ptr<const GASDEstimation<PointInT, PointOutT> >;
88 GASDEstimation (
const Eigen::Vector3f &view_direction = Eigen::Vector3f (0.0f, 0.0f, 1.0f),
89 const std::size_t shape_half_grid_size = 4,
90 const std::size_t shape_hists_size = 1,
92 view_direction_ (view_direction),
93 shape_half_grid_size_ (shape_half_grid_size),
94 shape_hists_size_ (shape_hists_size),
95 shape_interp_ (shape_interp)
108 view_direction_ = dir;
117 shape_half_grid_size_ = shgs;
128 shape_hists_size_ = shs;
137 shape_interp_ = interp;
143 const Eigen::Matrix4f&
186 const float max_coord,
187 const std::size_t half_grid_size,
190 const float hist_incr,
191 std::vector<Eigen::VectorXf> &hists);
202 Eigen::Matrix4f transform_;
205 Eigen::Vector3f view_direction_;
208 std::size_t shape_half_grid_size_;
211 std::size_t shape_hists_size_;
218 computeAlignmentTransform ();
228 copyShapeHistogramsToOutput (
const std::size_t grid_size,
229 const std::size_t hists_size,
230 const std::vector<Eigen::VectorXf> &hists,
255 template <
typename Po
intInT,
typename Po
intOutT = GASDSignature984>
260 using Ptr = shared_ptr<GASDColorEstimation<PointInT, PointOutT> >;
261 using ConstPtr = shared_ptr<const GASDColorEstimation<PointInT, PointOutT> >;
273 const std::size_t shape_half_grid_size = 3,
274 const std::size_t shape_hists_size = 1,
275 const std::size_t color_half_grid_size = 2,
276 const std::size_t color_hists_size = 12,
279 GASDEstimation<PointInT, PointOutT> (view_direction, shape_half_grid_size, shape_hists_size, shape_interp),
280 color_half_grid_size_ (color_half_grid_size),
281 color_hists_size_ (color_hists_size),
282 color_interp_ (color_interp)
293 color_half_grid_size_ = chgs;
302 color_hists_size_ = chs;
311 color_interp_ = interp;
328 std::size_t color_half_grid_size_;
331 std::size_t color_hists_size_;
344 copyColorHistogramsToOutput (
const std::size_t grid_size,
345 const std::size_t hists_size,
346 std::vector<Eigen::VectorXf> &hists,
359 #ifdef PCL_NO_PRECOMPILE
360 #include <pcl/features/impl/gasd.hpp>
Feature represents the base feature class.
pcl::PointCloud< GASDSignature512 > PointCloudOut
double search_radius_
The nearest neighbors search radius for each point.
int k_
The number of K nearest neighbors to use for each point.
shared_ptr< Feature< PointInT, PointOutT > > Ptr
std::string feature_name_
The feature name.
shared_ptr< const Feature< PointInT, PointOutT > > ConstPtr
GASDColorEstimation estimates the Globally Aligned Spatial Distribution (GASD) descriptor for a given...
void setColorHistsInterpMethod(const HistogramInterpolationMethod interp)
Set the color histograms interpolation method.
void setColorHistsSize(const std::size_t chs)
Set the color histograms size (number of bins in the hue histogram for each cell of the 3D regular gr...
void setColorHalfGridSize(const std::size_t chgs)
Set the color half grid size.
GASDColorEstimation(const Eigen::Vector3f &view_direction=Eigen::Vector3f(0.0f, 0.0f, 1.0f), const std::size_t shape_half_grid_size=3, const std::size_t shape_hists_size=1, const std::size_t color_half_grid_size=2, const std::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...
std::size_t pos_
Current position of output descriptor point cloud.
GASDEstimation(const Eigen::Vector3f &view_direction=Eigen::Vector3f(0.0f, 0.0f, 1.0f), const std::size_t shape_half_grid_size=4, const std::size_t shape_hists_size=1, const HistogramInterpolationMethod shape_interp=INTERP_TRILINEAR)
Constructor.
float max_coord_
Normalization factor with respect to axis-aligned bounding cube centered on the origin.
void computeFeature(PointCloudOut &output) override
Estimate GASD descriptor.
void setShapeHistsSize(const std::size_t shs)
Set the shape histograms size.
void setShapeHistsInterpMethod(const HistogramInterpolationMethod interp)
Set the shape histograms interpolation method.
PointCloudIn shape_samples_
Point cloud aligned to the canonical coordinate system.
const Eigen::Matrix4f & getTransform() const
Returns the transformation aligning the point cloud to the canonical coordinate system.
float hist_incr_
Normalized sample contribution with respect to the total number of points in the cloud.
shared_ptr< const GASDEstimation< PointInT, PointOutT > > ConstPtr
shared_ptr< GASDEstimation< PointInT, PointOutT > > Ptr
void setShapeHalfGridSize(const std::size_t shgs)
Set the shape half grid size.
void compute(PointCloudOut &output)
Overloaded computed method from pcl::Feature.
void addSampleToHistograms(const Eigen::Vector4f &p, const float max_coord, const std::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.
void setViewDirection(const Eigen::Vector3f &dir)
Set the view direction.
HistogramInterpolationMethod
Different histogram interpolation methods.
@ INTERP_NONE
no interpolation
@ INTERP_QUADRILINEAR
quadrilinear interpolation
@ INTERP_TRILINEAR
trilinear interpolation