Point Cloud Library (PCL)  1.9.1-dev
hough_3d.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010-2012, Willow Garage, Inc.
6  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of Willow Garage, Inc. nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  * $Id:$
37  *
38  */
39 
40 #pragma once
41 
42 #include <pcl/recognition/cg/correspondence_grouping.h>
43 #include <pcl/recognition/boost.h>
44 #include <pcl/point_types.h>
45 
46 namespace pcl
47 {
48  namespace recognition
49  {
50  /** \brief HoughSpace3D is a 3D voting space. Cast votes can be interpolated in order to better deal with approximations introduced by bin quantization. A weight can also be associated with each vote.
51  * \author Federico Tombari (original), Tommaso Cavallari (PCL port)
52  * \ingroup recognition
53  */
54  class PCL_EXPORTS HoughSpace3D
55  {
56 
57  public:
58 
59  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
60 
61  typedef boost::shared_ptr<HoughSpace3D> Ptr;
62 
63  /** \brief Constructor
64  *
65  * \param[in] min_coord minimum (x,y,z) coordinates of the Hough space
66  * \param[in] bin_size size of each bing of the Hough space.
67  * \param[in] max_coord maximum (x,y,z) coordinates of the Hough space.
68  */
69  HoughSpace3D (const Eigen::Vector3d &min_coord, const Eigen::Vector3d &bin_size, const Eigen::Vector3d &max_coord);
70 
71  /** \brief Reset all cast votes. */
72  void
73  reset ();
74 
75  /** \brief Casting a vote for a given position in the Hough space.
76  *
77  * \param[in] single_vote_coord coordinates of the vote being cast (in absolute coordinates)
78  * \param[in] weight weight associated with the vote.
79  * \param[in] voter_id the numeric id of the voter. Useful to trace back the voting correspondence, if the vote is returned by findMaxima as part of a maximum of the Hough Space.
80  * \return the index of the bin in which the vote has been cast.
81  */
82  int
83  vote (const Eigen::Vector3d &single_vote_coord, double weight, int voter_id);
84 
85  /** \brief Vote for a given position in the 3D space. The weight is interpolated between the bin pointed by single_vote_coord and its neighbors.
86  *
87  * \param[in] single_vote_coord coordinates of the vote being cast.
88  * \param[in] weight weight associated with the vote.
89  * \param[in] voter_id the numeric id of the voter. Useful to trace back the voting correspondence, if the vote is returned by findMaxima as a part of a maximum of the Hough Space.
90  * \return the index of the bin in which the vote has been cast.
91  */
92  int
93  voteInt (const Eigen::Vector3d &single_vote_coord, double weight, int voter_id);
94 
95  /** \brief Find the bins with most votes.
96  *
97  * \param[in] min_threshold the minimum number of votes to be included in a bin in order to have its value returned.
98  * If set to a value between -1 and 0 the Hough space maximum_vote is found and the returned values are all the votes greater than -min_threshold * maximum_vote.
99  * \param[out] maxima_values the list of Hough Space bin values greater than min_threshold.
100  * \param[out] maxima_voter_ids for each value returned, a list of the voter ids who cast a vote in that position.
101  * \return The min_threshold used, either set by the user or found by this method.
102  */
103  double
104  findMaxima (double min_threshold, std::vector<double> & maxima_values, std::vector<std::vector<int> > &maxima_voter_ids);
105 
106  protected:
107 
108  /** \brief Minimum coordinate in the Hough Space. */
109  Eigen::Vector3d min_coord_;
110 
111  /** \brief Size of each bin in the Hough Space. */
112  Eigen::Vector3d bin_size_;
113 
114  /** \brief Number of bins for each dimension. */
115  Eigen::Vector3i bin_count_;
116 
117  /** \brief Used to access hough_space_ as if it was a matrix. */
118  int partial_bin_products_[4];
119 
120  /** \brief Total number of bins in the Hough Space. */
122 
123  /** \brief The Hough Space. */
124  std::vector<double> hough_space_;
125  //boost::unordered_map<int, double> hough_space_;
126 
127  /** \brief List of voters for each bin. */
128  boost::unordered_map<int, std::vector<int> > voter_ids_;
129  };
130  }
131 
132  /** \brief Class implementing a 3D correspondence grouping algorithm that can deal with multiple instances of a model template
133  * found into a given scene. Each correspondence casts a vote for a reference point in a 3D Hough Space.
134  * The remaining 3 DOF are taken into account by associating each correspondence with a local Reference Frame.
135  * The suggested PointModelRfT is pcl::ReferenceFrame
136  *
137  * \note If you use this code in any academic work, please cite the original paper:
138  * - F. Tombari, L. Di Stefano:
139  * Object recognition in 3D scenes with occlusions and clutter by Hough voting.
140  * 2010, Fourth Pacific-Rim Symposium on Image and Video Technology
141  *
142  * \author Federico Tombari (original), Tommaso Cavallari (PCL port)
143  * \ingroup recognition
144  */
145  template<typename PointModelT, typename PointSceneT, typename PointModelRfT = pcl::ReferenceFrame, typename PointSceneRfT = pcl::ReferenceFrame>
146  class Hough3DGrouping : public CorrespondenceGrouping<PointModelT, PointSceneT>
147  {
148  public:
152 
156 
158  typedef typename PointCloud::Ptr PointCloudPtr;
160 
162 
163  /** \brief Constructor */
165  : input_rf_ ()
166  , scene_rf_ ()
167  , needs_training_ (true)
168  ,hough_threshold_ (-1)
169  , hough_bin_size_ (1.0)
170  , use_interpolation_ (true)
171  , use_distance_weight_ (false)
172  , local_rf_normals_search_radius_ (0.0f)
173  , local_rf_search_radius_ (0.0f)
174  , hough_space_initialized_ (false)
175  {}
176 
177  /** \brief Provide a pointer to the input dataset.
178  * \param[in] cloud the const boost shared pointer to a PointCloud message.
179  */
180  inline void
181  setInputCloud (const PointCloudConstPtr &cloud) override
182  {
184  needs_training_ = true;
185  hough_space_initialized_ = false;
186  input_rf_.reset();
187  }
188 
189  /** \brief Provide a pointer to the input dataset's reference frames.
190  * Each point in the reference frame cloud should be the reference frame of
191  * the correspondent point in the input dataset.
192  *
193  * \param[in] input_rf the pointer to the input cloud's reference frames.
194  */
195  inline void
196  setInputRf (const ModelRfCloudConstPtr &input_rf)
197  {
198  input_rf_ = input_rf;
199  needs_training_ = true;
200  hough_space_initialized_ = false;
201  }
202 
203  /** \brief Getter for the input dataset's reference frames.
204  * Each point in the reference frame cloud should be the reference frame of
205  * the correspondent point in the input dataset.
206  *
207  * \return the pointer to the input cloud's reference frames.
208  */
209  inline ModelRfCloudConstPtr
210  getInputRf () const
211  {
212  return (input_rf_);
213  }
214 
215  /** \brief Provide a pointer to the scene dataset (i.e. the cloud in which the algorithm has to search for instances of the input model)
216  *
217  * \param[in] scene the const boost shared pointer to a PointCloud message.
218  */
219  inline void
220  setSceneCloud (const SceneCloudConstPtr &scene) override
221  {
222  scene_ = scene;
223  hough_space_initialized_ = false;
224  scene_rf_.reset();
225  }
226 
227  /** \brief Provide a pointer to the scene dataset's reference frames.
228  * Each point in the reference frame cloud should be the reference frame of
229  * the correspondent point in the scene dataset.
230  *
231  * \param[in] scene_rf the pointer to the scene cloud's reference frames.
232  */
233  inline void
234  setSceneRf (const SceneRfCloudConstPtr &scene_rf)
235  {
236  scene_rf_ = scene_rf;
237  hough_space_initialized_ = false;
238  }
239 
240  /** \brief Getter for the scene dataset's reference frames.
241  * Each point in the reference frame cloud should be the reference frame of
242  * the correspondent point in the scene dataset.
243  *
244  * \return the pointer to the scene cloud's reference frames.
245  */
246  inline SceneRfCloudConstPtr
247  getSceneRf () const
248  {
249  return (scene_rf_);
250  }
251 
252  /** \brief Provide a pointer to the precomputed correspondences between points in the input dataset and
253  * points in the scene dataset. The correspondences are going to be clustered into different model instances
254  * by the algorithm.
255  *
256  * \param[in] corrs the correspondences between the model and the scene.
257  */
258  inline void
260  {
261  model_scene_corrs_ = corrs;
262  hough_space_initialized_ = false;
263  }
264 
265  /** \brief Sets the minimum number of votes in the Hough space needed to infer the presence of a model instance into the scene cloud.
266  *
267  * \param[in] threshold the threshold for the Hough space voting, if set between -1 and 0 the maximum vote in the
268  * entire space is automatically calculated and -threshold the maximum value is used as a threshold. This means
269  * that a value between -1 and 0 should be used only if at least one instance of the model is always present in
270  * the scene, or if this false positive can be filtered later.
271  */
272  inline void
273  setHoughThreshold (double threshold)
274  {
275  hough_threshold_ = threshold;
276  }
277 
278  /** \brief Gets the minimum number of votes in the Hough space needed to infer the presence of a model instance into the scene cloud.
279  *
280  * \return the threshold for the Hough space voting.
281  */
282  inline double
284  {
285  return (hough_threshold_);
286  }
287 
288  /** \brief Sets the size of each bin into the Hough space.
289  *
290  * \param[in] bin_size the size of each Hough space's bin.
291  */
292  inline void
293  setHoughBinSize (double bin_size)
294  {
295  hough_bin_size_ = bin_size;
296  hough_space_initialized_ = false;
297  }
298 
299  /** \brief Gets the size of each bin into the Hough space.
300  *
301  * \return the size of each Hough space's bin.
302  */
303  inline double
305  {
306  return (hough_bin_size_);
307  }
308 
309  /** \brief Sets whether the vote casting procedure interpolates
310  * the score between neighboring bins of the Hough space or not.
311  *
312  * \param[in] use_interpolation the algorithm should interpolate the vote score between neighboring bins.
313  */
314  inline void
315  setUseInterpolation (bool use_interpolation)
316  {
317  use_interpolation_ = use_interpolation;
318  hough_space_initialized_ = false;
319  }
320 
321  /** \brief Gets whether the vote casting procedure interpolates
322  * the score between neighboring bins of the Hough space or not.
323  *
324  * \return if the algorithm should interpolate the vote score between neighboring bins.
325  */
326  inline bool
328  {
329  return (use_interpolation_);
330  }
331 
332  /** \brief Sets whether the vote casting procedure uses the correspondence's distance as a score.
333  *
334  * \param[in] use_distance_weight the algorithm should use the weighted distance when calculating the Hough voting score.
335  */
336  inline void
337  setUseDistanceWeight (bool use_distance_weight)
338  {
339  use_distance_weight_ = use_distance_weight;
340  hough_space_initialized_ = false;
341  }
342 
343  /** \brief Gets whether the vote casting procedure uses the correspondence's distance as a score.
344  *
345  * \return if the algorithm should use the weighted distance when calculating the Hough voting score.
346  */
347  inline bool
349  {
350  return (use_distance_weight_);
351  }
352 
353  /** \brief If the Local reference frame has not been set for either the model cloud or the scene cloud,
354  * this algorithm makes the computation itself but needs a suitable search radius to compute the normals
355  * in order to subsequently compute the RF (if not set a default 15 nearest neighbors search is performed).
356  *
357  * \param[in] local_rf_normals_search_radius the normals search radius for the local reference frame calculation.
358  */
359  inline void
360  setLocalRfNormalsSearchRadius (float local_rf_normals_search_radius)
361  {
362  local_rf_normals_search_radius_ = local_rf_normals_search_radius;
363  needs_training_ = true;
364  hough_space_initialized_ = false;
365  }
366 
367  /** \brief If the Local reference frame has not been set for either the model cloud or the scene cloud,
368  * this algorithm makes the computation itself but needs a suitable search radius to compute the normals
369  * in order to subsequently compute the RF (if not set a default 15 nearest neighbors search is performed).
370  *
371  * \return the normals search radius for the local reference frame calculation.
372  */
373  inline float
375  {
376  return (local_rf_normals_search_radius_);
377  }
378 
379  /** \brief If the Local reference frame has not been set for either the model cloud or the scene cloud,
380  * this algorithm makes the computation itself but needs a suitable search radius to do so.
381  * \attention This parameter NEEDS to be set if the reference frames are not precomputed externally,
382  * otherwise the recognition results won't be correct.
383  *
384  * \param[in] local_rf_search_radius the search radius for the local reference frame calculation.
385  */
386  inline void
387  setLocalRfSearchRadius (float local_rf_search_radius)
388  {
389  local_rf_search_radius_ = local_rf_search_radius;
390  needs_training_ = true;
391  hough_space_initialized_ = false;
392  }
393 
394  /** \brief If the Local reference frame has not been set for either the model cloud or the scene cloud,
395  * this algorithm makes the computation itself but needs a suitable search radius to do so.
396  * \attention This parameter NEEDS to be set if the reference frames are not precomputed externally,
397  * otherwise the recognition results won't be correct.
398  *
399  * \return the search radius for the local reference frame calculation.
400  */
401  inline float
403  {
404  return (local_rf_search_radius_);
405  }
406 
407  /** \brief Call this function after setting the input, the input_rf and the hough_bin_size parameters to perform an off line training of the algorithm. This might be useful if one wants to perform once and for all a pre-computation of votes that only concern the models, increasing the on-line efficiency of the grouping algorithm.
408  * The algorithm is automatically trained on the first invocation of the recognize method or the cluster method if this training function has not been manually invoked.
409  *
410  * \return true if the training had been successful or false if errors have occurred.
411  */
412  bool
413  train ();
414 
415  /** \brief The main function, recognizes instances of the model into the scene set by the user.
416  *
417  * \param[out] transformations a vector containing one transformation matrix for each instance of the model recognized into the scene.
418  *
419  * \return true if the recognition had been successful or false if errors have occurred.
420  */
421  bool
422  recognize (std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > &transformations);
423 
424  /** \brief The main function, recognizes instances of the model into the scene set by the user.
425  *
426  * \param[out] transformations a vector containing one transformation matrix for each instance of the model recognized into the scene.
427  * \param[out] clustered_corrs a vector containing the correspondences for each instance of the model found within the input data (the same output of clusterCorrespondences).
428  *
429  * \return true if the recognition had been successful or false if errors have occurred.
430  */
431  bool
432  recognize (std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > &transformations, std::vector<pcl::Correspondences> &clustered_corrs);
433 
434  protected:
438 
439  /** \brief The input Rf cloud. */
440  ModelRfCloudConstPtr input_rf_;
441 
442  /** \brief The scene Rf cloud. */
443  SceneRfCloudConstPtr scene_rf_;
444 
445  /** \brief If the training of the Hough space is needed; set on change of either the input cloud or the input_rf. */
447 
448  /** \brief The result of the training. The vector between each model point and the centroid of the model adjusted by its local reference frame.*/
449  std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > model_votes_;
450 
451  /** \brief The minimum number of votes in the Hough space needed to infer the presence of a model instance into the scene cloud. */
453 
454  /** \brief The size of each bin of the hough space. */
456 
457  /** \brief Use the interpolation between neighboring Hough bins when casting votes. */
459 
460  /** \brief Use the weighted correspondence distance when casting votes. */
462 
463  /** \brief Normals search radius for the potential Rf calculation. */
465 
466  /** \brief Search radius for the potential Rf calculation. */
468 
469  /** \brief The Hough space. */
471 
472  /** \brief Transformations found by clusterCorrespondences method. */
473  std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > found_transformations_;
474 
475  /** \brief Whether the Hough space already contains the correct votes for the current input parameters and so the cluster and recognize calls don't need to recompute each value.
476  * Reset on the change of any parameter except the hough_threshold.
477  */
479 
480  /** \brief Cluster the input correspondences in order to distinguish between different instances of the model into the scene.
481  *
482  * \param[out] model_instances a vector containing the clustered correspondences for each model found on the scene.
483  * \return true if the clustering had been successful or false if errors have occurred.
484  */
485  void
486  clusterCorrespondences (std::vector<Correspondences> &model_instances) override;
487 
488  /* \brief Finds the transformation matrix between the input and the scene cloud for a set of correspondences using a RANSAC algorithm.
489  * \param[in] the scene cloud in which the PointSceneT has been converted to PointModelT.
490  * \param[in] corrs a set of correspondences.
491  * \param[out] transform the transformation matrix between the input cloud and the scene cloud that aligns the found correspondences.
492  * \return true if the recognition had been successful or false if errors have occurred.
493  */
494  //bool
495  //getTransformMatrix (const PointCloudConstPtr &scene_cloud, const Correspondences &corrs, Eigen::Matrix4f &transform);
496 
497  /** \brief The Hough space voting procedure.
498  * \return true if the voting had been successful or false if errors have occurred.
499  */
500  bool
501  houghVoting ();
502 
503  /** \brief Computes the reference frame for an input cloud.
504  * \param[in] input the input cloud.
505  * \param[out] rf the resulting reference frame.
506  */
507  template<typename PointType, typename PointRfType> void
508  computeRf (const typename pcl::PointCloud<PointType>::ConstPtr &input, pcl::PointCloud<PointRfType> &rf);
509  };
510 }
511 
512 #ifdef PCL_NO_PRECOMPILE
513 #include <pcl/recognition/impl/cg/hough_3d.hpp>
514 #endif
boost::unordered_map< int, std::vector< int > > voter_ids_
List of voters for each bin.
Definition: hough_3d.h:128
Eigen::Vector3i bin_count_
Number of bins for each dimension.
Definition: hough_3d.h:115
ModelRfCloud::ConstPtr ModelRfCloudConstPtr
Definition: hough_3d.h:151
std::vector< double > hough_space_
The Hough Space.
Definition: hough_3d.h:124
float getLocalRfSearchRadius() const
If the Local reference frame has not been set for either the model cloud or the scene cloud...
Definition: hough_3d.h:402
pcl::PointCloud< PointSceneRfT > SceneRfCloud
Definition: hough_3d.h:153
float getLocalRfNormalsSearchRadius() const
If the Local reference frame has not been set for either the model cloud or the scene cloud...
Definition: hough_3d.h:374
int total_bins_count_
Total number of bins in the Hough Space.
Definition: hough_3d.h:121
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:44
void setUseDistanceWeight(bool use_distance_weight)
Sets whether the vote casting procedure uses the correspondence&#39;s distance as a score.
Definition: hough_3d.h:337
SceneRfCloud::Ptr SceneRfCloudPtr
Definition: hough_3d.h:154
SceneRfCloudConstPtr scene_rf_
The scene Rf cloud.
Definition: hough_3d.h:443
pcl::PointCloud< PointModelT > PointCloud
Definition: hough_3d.h:157
double getHoughThreshold() const
Gets the minimum number of votes in the Hough space needed to infer the presence of a model instance ...
Definition: hough_3d.h:283
SceneRfCloud::ConstPtr SceneRfCloudConstPtr
Definition: hough_3d.h:155
void setLocalRfNormalsSearchRadius(float local_rf_normals_search_radius)
If the Local reference frame has not been set for either the model cloud or the scene cloud...
Definition: hough_3d.h:360
SceneRfCloudConstPtr getSceneRf() const
Getter for the scene dataset&#39;s reference frames.
Definition: hough_3d.h:247
float local_rf_normals_search_radius_
Normals search radius for the potential Rf calculation.
Definition: hough_3d.h:464
bool hough_space_initialized_
Whether the Hough space already contains the correct votes for the current input parameters and so th...
Definition: hough_3d.h:478
Eigen::Vector3d bin_size_
Size of each bin in the Hough Space.
Definition: hough_3d.h:112
pcl::recognition::HoughSpace3D::Ptr hough_space_
The Hough space.
Definition: hough_3d.h:470
boost::shared_ptr< PointCloud< PointT > > Ptr
Definition: point_cloud.h:427
bool use_distance_weight_
Use the weighted correspondence distance when casting votes.
Definition: hough_3d.h:461
bool getUseDistanceWeight() const
Gets whether the vote casting procedure uses the correspondence&#39;s distance as a score.
Definition: hough_3d.h:348
void setInputRf(const ModelRfCloudConstPtr &input_rf)
Provide a pointer to the input dataset&#39;s reference frames.
Definition: hough_3d.h:196
PointCloud::ConstPtr PointCloudConstPtr
Definition: hough_3d.h:159
bool needs_training_
If the training of the Hough space is needed; set on change of either the input cloud or the input_rf...
Definition: hough_3d.h:446
boost::shared_ptr< const Correspondences > CorrespondencesConstPtr
void setSceneCloud(const SceneCloudConstPtr &scene) override
Provide a pointer to the scene dataset (i.e.
Definition: hough_3d.h:220
ModelRfCloud::Ptr ModelRfCloudPtr
Definition: hough_3d.h:150
void setModelSceneCorrespondences(const CorrespondencesConstPtr &corrs) override
Provide a pointer to the precomputed correspondences between points in the input dataset and points i...
Definition: hough_3d.h:259
Hough3DGrouping()
Constructor.
Definition: hough_3d.h:164
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef boost::shared_ptr< HoughSpace3D > Ptr
Definition: hough_3d.h:61
ModelRfCloudConstPtr input_rf_
The input Rf cloud.
Definition: hough_3d.h:440
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
Definition: point_cloud.h:428
pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::SceneCloudConstPtr SceneCloudConstPtr
Definition: hough_3d.h:161
bool use_interpolation_
Use the interpolation between neighboring Hough bins when casting votes.
Definition: hough_3d.h:458
Class implementing a 3D correspondence grouping algorithm that can deal with multiple instances of a ...
Definition: hough_3d.h:146
PointCloud represents the base class in PCL for storing collections of 3D points. ...
SceneCloud::ConstPtr SceneCloudConstPtr
Abstract base class for Correspondence Grouping algorithms.
float local_rf_search_radius_
Search radius for the potential Rf calculation.
Definition: hough_3d.h:467
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Provide a pointer to the input dataset.
Definition: pcl_base.hpp:65
void setInputCloud(const PointCloudConstPtr &cloud) override
Provide a pointer to the input dataset.
Definition: hough_3d.h:181
double hough_threshold_
The minimum number of votes in the Hough space needed to infer the presence of a model instance into ...
Definition: hough_3d.h:452
void setHoughThreshold(double threshold)
Sets the minimum number of votes in the Hough space needed to infer the presence of a model instance ...
Definition: hough_3d.h:273
Eigen::Vector3d min_coord_
Minimum coordinate in the Hough Space.
Definition: hough_3d.h:109
std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f > > model_votes_
The result of the training.
Definition: hough_3d.h:449
ModelRfCloudConstPtr getInputRf() const
Getter for the input dataset&#39;s reference frames.
Definition: hough_3d.h:210
pcl::PointCloud< PointModelRfT > ModelRfCloud
Definition: hough_3d.h:149
std::vector< Eigen::Matrix4f, Eigen::aligned_allocator< Eigen::Matrix4f > > found_transformations_
Transformations found by clusterCorrespondences method.
Definition: hough_3d.h:473
void setUseInterpolation(bool use_interpolation)
Sets whether the vote casting procedure interpolates the score between neighboring bins of the Hough ...
Definition: hough_3d.h:315
double hough_bin_size_
The size of each bin of the hough space.
Definition: hough_3d.h:455
double getHoughBinSize() const
Gets the size of each bin into the Hough space.
Definition: hough_3d.h:304
HoughSpace3D is a 3D voting space.
Definition: hough_3d.h:54
bool getUseInterpolation() const
Gets whether the vote casting procedure interpolates the score between neighboring bins of the Hough ...
Definition: hough_3d.h:327
void setLocalRfSearchRadius(float local_rf_search_radius)
If the Local reference frame has not been set for either the model cloud or the scene cloud...
Definition: hough_3d.h:387
void setSceneRf(const SceneRfCloudConstPtr &scene_rf)
Provide a pointer to the scene dataset&#39;s reference frames.
Definition: hough_3d.h:234
PointCloud::Ptr PointCloudPtr
Definition: hough_3d.h:158
void setHoughBinSize(double bin_size)
Sets the size of each bin into the Hough space.
Definition: hough_3d.h:293