Point Cloud Library (PCL)  1.8.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 #ifndef PCL_RECOGNITION_HOUGH_3D_H_
41 #define PCL_RECOGNITION_HOUGH_3D_H_
42 
43 #include <pcl/recognition/cg/correspondence_grouping.h>
44 #include <pcl/recognition/boost.h>
45 #include <pcl/point_types.h>
46 
47 namespace pcl
48 {
49  namespace recognition
50  {
51  /** \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.
52  * \author Federico Tombari (original), Tommaso Cavallari (PCL port)
53  * \ingroup recognition
54  */
55  class PCL_EXPORTS HoughSpace3D
56  {
57 
58  public:
59 
60  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
61 
62  /** \brief Constructor
63  *
64  * \param[in] min_coord minimum (x,y,z) coordinates of the Hough space
65  * \param[in] bin_size size of each bing of the Hough space.
66  * \param[in] max_coord maximum (x,y,z) coordinates of the Hough space.
67  */
68  HoughSpace3D (const Eigen::Vector3d &min_coord, const Eigen::Vector3d &bin_size, const Eigen::Vector3d &max_coord);
69 
70  /** \brief Reset all cast votes. */
71  void
72  reset ();
73 
74  /** \brief Casting a vote for a given position in the Hough space.
75  *
76  * \param[in] single_vote_coord coordinates of the vote being cast (in absolute coordinates)
77  * \param[in] weight weight associated with the vote.
78  * \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.
79  * \return the index of the bin in which the vote has been cast.
80  */
81  int
82  vote (const Eigen::Vector3d &single_vote_coord, double weight, int voter_id);
83 
84  /** \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.
85  *
86  * \param[in] single_vote_coord coordinates of the vote being cast.
87  * \param[in] weight weight associated with the vote.
88  * \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.
89  * \return the index of the bin in which the vote has been cast.
90  */
91  int
92  voteInt (const Eigen::Vector3d &single_vote_coord, double weight, int voter_id);
93 
94  /** \brief Find the bins with most votes.
95  *
96  * \param[in] min_threshold the minimum number of votes to be included in a bin in order to have its value returned.
97  * 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.
98  * \param[out] maxima_values the list of Hough Space bin values greater than min_threshold.
99  * \param[out] maxima_voter_ids for each value returned, a list of the voter ids who cast a vote in that position.
100  * \return The min_threshold used, either set by the user or found by this method.
101  */
102  double
103  findMaxima (double min_threshold, std::vector<double> & maxima_values, std::vector<std::vector<int> > &maxima_voter_ids);
104 
105  protected:
106 
107  /** \brief Minimum coordinate in the Hough Space. */
108  Eigen::Vector3d min_coord_;
109 
110  /** \brief Size of each bin in the Hough Space. */
111  Eigen::Vector3d bin_size_;
112 
113  /** \brief Number of bins for each dimension. */
114  Eigen::Vector3i bin_count_;
115 
116  /** \brief Used to access hough_space_ as if it was a matrix. */
117  int partial_bin_products_[4];
118 
119  /** \brief Total number of bins in the Hough Space. */
121 
122  /** \brief The Hough Space. */
123  std::vector<double> hough_space_;
124  //boost::unordered_map<int, double> hough_space_;
125 
126  /** \brief List of voters for each bin. */
127  boost::unordered_map<int, std::vector<int> > voter_ids_;
128  };
129  }
130 
131  /** \brief Class implementing a 3D correspondence grouping algorithm that can deal with multiple instances of a model template
132  * found into a given scene. Each correspondence casts a vote for a reference point in a 3D Hough Space.
133  * The remaining 3 DOF are taken into account by associating each correspondence with a local Reference Frame.
134  * The suggested PointModelRfT is pcl::ReferenceFrame
135  *
136  * \note If you use this code in any academic work, please cite the original paper:
137  * - F. Tombari, L. Di Stefano:
138  * Object recognition in 3D scenes with occlusions and clutter by Hough voting.
139  * 2010, Fourth Pacific-Rim Symposium on Image and Video Technology
140  *
141  * \author Federico Tombari (original), Tommaso Cavallari (PCL port)
142  * \ingroup recognition
143  */
144  template<typename PointModelT, typename PointSceneT, typename PointModelRfT = pcl::ReferenceFrame, typename PointSceneRfT = pcl::ReferenceFrame>
145  class Hough3DGrouping : public CorrespondenceGrouping<PointModelT, PointSceneT>
146  {
147  public:
151 
155 
157  typedef typename PointCloud::Ptr PointCloudPtr;
159 
161 
162  /** \brief Constructor */
164  : input_rf_ ()
165  , scene_rf_ ()
166  , needs_training_ (true)
167  , model_votes_ ()
168  , hough_threshold_ (-1)
169  , hough_bin_size_ (1.0)
170  , use_interpolation_ (true)
171  , use_distance_weight_ (false)
173  , local_rf_search_radius_ (0.0f)
174  , hough_space_ ()
176  , hough_space_initialized_ (false)
177  {}
178 
179  /** \brief Provide a pointer to the input dataset.
180  * \param[in] cloud the const boost shared pointer to a PointCloud message.
181  */
182  inline void
184  {
186  needs_training_ = true;
187  hough_space_initialized_ = false;
188  input_rf_.reset();
189  }
190 
191  /** \brief Provide a pointer to the input dataset's reference frames.
192  * Each point in the reference frame cloud should be the reference frame of
193  * the correspondent point in the input dataset.
194  *
195  * \param[in] input_rf the pointer to the input cloud's reference frames.
196  */
197  inline void
199  {
200  input_rf_ = input_rf;
201  needs_training_ = true;
202  hough_space_initialized_ = false;
203  }
204 
205  /** \brief Getter for the input dataset's reference frames.
206  * Each point in the reference frame cloud should be the reference frame of
207  * the correspondent point in the input dataset.
208  *
209  * \return the pointer to the input cloud's reference frames.
210  */
211  inline ModelRfCloudConstPtr
212  getInputRf () const
213  {
214  return (input_rf_);
215  }
216 
217  /** \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)
218  *
219  * \param[in] scene the const boost shared pointer to a PointCloud message.
220  */
221  inline void
223  {
224  scene_ = scene;
225  hough_space_initialized_ = false;
226  scene_rf_.reset();
227  }
228 
229  /** \brief Provide a pointer to the scene dataset's reference frames.
230  * Each point in the reference frame cloud should be the reference frame of
231  * the correspondent point in the scene dataset.
232  *
233  * \param[in] scene_rf the pointer to the scene cloud's reference frames.
234  */
235  inline void
237  {
238  scene_rf_ = scene_rf;
239  hough_space_initialized_ = false;
240  }
241 
242  /** \brief Getter for the scene dataset's reference frames.
243  * Each point in the reference frame cloud should be the reference frame of
244  * the correspondent point in the scene dataset.
245  *
246  * \return the pointer to the scene cloud's reference frames.
247  */
248  inline SceneRfCloudConstPtr
249  getSceneRf () const
250  {
251  return (scene_rf_);
252  }
253 
254  /** \brief Provide a pointer to the precomputed correspondences between points in the input dataset and
255  * points in the scene dataset. The correspondences are going to be clustered into different model instances
256  * by the algorithm.
257  *
258  * \param[in] corrs the correspondences between the model and the scene.
259  */
260  inline void
262  {
263  model_scene_corrs_ = corrs;
264  hough_space_initialized_ = false;
265  }
266 
267  /** \brief Sets the minimum number of votes in the Hough space needed to infer the presence of a model instance into the scene cloud.
268  *
269  * \param[in] threshold the threshold for the Hough space voting, if set between -1 and 0 the maximum vote in the
270  * entire space is automatically calculated and -threshold the maximum value is used as a threshold. This means
271  * that a value between -1 and 0 should be used only if at least one instance of the model is always present in
272  * the scene, or if this false positive can be filtered later.
273  */
274  inline void
275  setHoughThreshold (double threshold)
276  {
277  hough_threshold_ = threshold;
278  }
279 
280  /** \brief Gets the minimum number of votes in the Hough space needed to infer the presence of a model instance into the scene cloud.
281  *
282  * \return the threshold for the Hough space voting.
283  */
284  inline double
286  {
287  return (hough_threshold_);
288  }
289 
290  /** \brief Sets the size of each bin into the Hough space.
291  *
292  * \param[in] bin_size the size of each Hough space's bin.
293  */
294  inline void
295  setHoughBinSize (double bin_size)
296  {
297  hough_bin_size_ = bin_size;
298  hough_space_initialized_ = false;
299  }
300 
301  /** \brief Gets the size of each bin into the Hough space.
302  *
303  * \return the size of each Hough space's bin.
304  */
305  inline double
307  {
308  return (hough_bin_size_);
309  }
310 
311  /** \brief Sets whether the vote casting procedure interpolates
312  * the score between neighboring bins of the Hough space or not.
313  *
314  * \param[in] use_interpolation the algorithm should interpolate the vote score between neighboring bins.
315  */
316  inline void
317  setUseInterpolation (bool use_interpolation)
318  {
319  use_interpolation_ = use_interpolation;
320  hough_space_initialized_ = false;
321  }
322 
323  /** \brief Gets whether the vote casting procedure interpolates
324  * the score between neighboring bins of the Hough space or not.
325  *
326  * \return if the algorithm should interpolate the vote score between neighboring bins.
327  */
328  inline bool
330  {
331  return (use_interpolation_);
332  }
333 
334  /** \brief Sets whether the vote casting procedure uses the correspondence's distance as a score.
335  *
336  * \param[in] use_distance_weight the algorithm should use the weighted distance when calculating the Hough voting score.
337  */
338  inline void
339  setUseDistanceWeight (bool use_distance_weight)
340  {
341  use_distance_weight_ = use_distance_weight;
342  hough_space_initialized_ = false;
343  }
344 
345  /** \brief Gets whether the vote casting procedure uses the correspondence's distance as a score.
346  *
347  * \return if the algorithm should use the weighted distance when calculating the Hough voting score.
348  */
349  inline bool
351  {
352  return (use_distance_weight_);
353  }
354 
355  /** \brief If the Local reference frame has not been set for either the model cloud or the scene cloud,
356  * this algorithm makes the computation itself but needs a suitable search radius to compute the normals
357  * in order to subsequently compute the RF (if not set a default 15 nearest neighbors search is performed).
358  *
359  * \param[in] local_rf_normals_search_radius the normals search radius for the local reference frame calculation.
360  */
361  inline void
362  setLocalRfNormalsSearchRadius (float local_rf_normals_search_radius)
363  {
364  local_rf_normals_search_radius_ = local_rf_normals_search_radius;
365  needs_training_ = true;
366  hough_space_initialized_ = false;
367  }
368 
369  /** \brief If the Local reference frame has not been set for either the model cloud or the scene cloud,
370  * this algorithm makes the computation itself but needs a suitable search radius to compute the normals
371  * in order to subsequently compute the RF (if not set a default 15 nearest neighbors search is performed).
372  *
373  * \return the normals search radius for the local reference frame calculation.
374  */
375  inline float
377  {
379  }
380 
381  /** \brief If the Local reference frame has not been set for either the model cloud or the scene cloud,
382  * this algorithm makes the computation itself but needs a suitable search radius to do so.
383  * \attention This parameter NEEDS to be set if the reference frames are not precomputed externally,
384  * otherwise the recognition results won't be correct.
385  *
386  * \param[in] local_rf_search_radius the search radius for the local reference frame calculation.
387  */
388  inline void
389  setLocalRfSearchRadius (float local_rf_search_radius)
390  {
391  local_rf_search_radius_ = local_rf_search_radius;
392  needs_training_ = true;
393  hough_space_initialized_ = false;
394  }
395 
396  /** \brief If the Local reference frame has not been set for either the model cloud or the scene cloud,
397  * this algorithm makes the computation itself but needs a suitable search radius to do so.
398  * \attention This parameter NEEDS to be set if the reference frames are not precomputed externally,
399  * otherwise the recognition results won't be correct.
400  *
401  * \return the search radius for the local reference frame calculation.
402  */
403  inline float
405  {
406  return (local_rf_search_radius_);
407  }
408 
409  /** \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.
410  * 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.
411  *
412  * \return true if the training had been successful or false if errors have occurred.
413  */
414  bool
415  train ();
416 
417  /** \brief The main function, recognizes instances of the model into the scene set by the user.
418  *
419  * \param[out] transformations a vector containing one transformation matrix for each instance of the model recognized into the scene.
420  *
421  * \return true if the recognition had been successful or false if errors have occurred.
422  */
423  bool
424  recognize (std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > &transformations);
425 
426  /** \brief The main function, recognizes instances of the model into the scene set by the user.
427  *
428  * \param[out] transformations a vector containing one transformation matrix for each instance of the model recognized into the scene.
429  * \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).
430  *
431  * \return true if the recognition had been successful or false if errors have occurred.
432  */
433  bool
434  recognize (std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > &transformations, std::vector<pcl::Correspondences> &clustered_corrs);
435 
436  protected:
440 
441  /** \brief The input Rf cloud. */
443 
444  /** \brief The scene Rf cloud. */
446 
447  /** \brief If the training of the Hough space is needed; set on change of either the input cloud or the input_rf. */
449 
450  /** \brief The result of the training. The vector between each model point and the centroid of the model adjusted by its local reference frame.*/
451  std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > model_votes_;
452 
453  /** \brief The minimum number of votes in the Hough space needed to infer the presence of a model instance into the scene cloud. */
455 
456  /** \brief The size of each bin of the hough space. */
458 
459  /** \brief Use the interpolation between neighboring Hough bins when casting votes. */
461 
462  /** \brief Use the weighted correspondence distance when casting votes. */
464 
465  /** \brief Normals search radius for the potential Rf calculation. */
467 
468  /** \brief Search radius for the potential Rf calculation. */
470 
471  /** \brief The Hough space. */
472  boost::shared_ptr<pcl::recognition::HoughSpace3D> hough_space_;
473 
474  /** \brief Transformations found by clusterCorrespondences method. */
475  std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > found_transformations_;
476 
477  /** \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.
478  * Reset on the change of any parameter except the hough_threshold.
479  */
481 
482  /** \brief Cluster the input correspondences in order to distinguish between different instances of the model into the scene.
483  *
484  * \param[out] model_instances a vector containing the clustered correspondences for each model found on the scene.
485  * \return true if the clustering had been successful or false if errors have occurred.
486  */
487  void
488  clusterCorrespondences (std::vector<Correspondences> &model_instances);
489 
490  /* \brief Finds the transformation matrix between the input and the scene cloud for a set of correspondences using a RANSAC algorithm.
491  * \param[in] the scene cloud in which the PointSceneT has been converted to PointModelT.
492  * \param[in] corrs a set of correspondences.
493  * \param[out] transform the transformation matrix between the input cloud and the scene cloud that aligns the found correspondences.
494  * \return true if the recognition had been successful or false if errors have occurred.
495  */
496  //bool
497  //getTransformMatrix (const PointCloudConstPtr &scene_cloud, const Correspondences &corrs, Eigen::Matrix4f &transform);
498 
499  /** \brief The Hough space voting procedure.
500  * \return true if the voting had been successful or false if errors have occurred.
501  */
502  bool
503  houghVoting ();
504 
505  /** \brief Computes the reference frame for an input cloud.
506  * \param[in] input the input cloud.
507  * \param[out] rf the resulting reference frame.
508  */
509  template<typename PointType, typename PointRfType> void
510  computeRf (const boost::shared_ptr<const pcl::PointCloud<PointType> > &input, pcl::PointCloud<PointRfType> &rf);
511  };
512 }
513 
514 #ifdef PCL_NO_PRECOMPILE
515 #include <pcl/recognition/impl/cg/hough_3d.hpp>
516 #endif
517 
518 #endif // PCL_RECOGNITION_HOUGH_3D_H_
boost::unordered_map< int, std::vector< int > > voter_ids_
List of voters for each bin.
Definition: hough_3d.h:127
Eigen::Vector3i bin_count_
Number of bins for each dimension.
Definition: hough_3d.h:114
ModelRfCloud::ConstPtr ModelRfCloudConstPtr
Definition: hough_3d.h:150
bool train()
Call this function after setting the input, the input_rf and the hough_bin_size parameters to perform...
Definition: hough_3d.hpp:84
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
Definition: point_cloud.h:429
std::vector< double > hough_space_
The Hough Space.
Definition: hough_3d.h:123
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:404
pcl::PointCloud< PointSceneRfT > SceneRfCloud
Definition: hough_3d.h:152
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:376
boost::shared_ptr< PointCloud< PointT > > Ptr
Definition: point_cloud.h:428
int total_bins_count_
Total number of bins in the Hough Space.
Definition: hough_3d.h:120
void setUseDistanceWeight(bool use_distance_weight)
Sets whether the vote casting procedure uses the correspondence's distance as a score.
Definition: hough_3d.h:339
void setModelSceneCorrespondences(const CorrespondencesConstPtr &corrs)
Provide a pointer to the precomputed correspondences between points in the input dataset and points i...
Definition: hough_3d.h:261
SceneRfCloud::Ptr SceneRfCloudPtr
Definition: hough_3d.h:153
void computeRf(const boost::shared_ptr< const pcl::PointCloud< PointType > > &input, pcl::PointCloud< PointRfType > &rf)
Computes the reference frame for an input cloud.
Definition: hough_3d.hpp:54
SceneRfCloudConstPtr scene_rf_
The scene Rf cloud.
Definition: hough_3d.h:445
pcl::PointCloud< PointModelT > PointCloud
Definition: hough_3d.h:156
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:285
SceneRfCloud::ConstPtr SceneRfCloudConstPtr
Definition: hough_3d.h:154
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:362
SceneRfCloudConstPtr getSceneRf() const
Getter for the scene dataset's reference frames.
Definition: hough_3d.h:249
bool houghVoting()
The Hough space voting procedure.
Definition: hough_3d.hpp:137
boost::shared_ptr< pcl::recognition::HoughSpace3D > hough_space_
The Hough space.
Definition: hough_3d.h:472
float local_rf_normals_search_radius_
Normals search radius for the potential Rf calculation.
Definition: hough_3d.h:466
bool recognize(std::vector< Eigen::Matrix4f, Eigen::aligned_allocator< Eigen::Matrix4f > > &transformations)
The main function, recognizes instances of the model into the scene set by the user.
Definition: hough_3d.hpp:333
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:480
Eigen::Vector3d bin_size_
Size of each bin in the Hough Space.
Definition: hough_3d.h:111
bool use_distance_weight_
Use the weighted correspondence distance when casting votes.
Definition: hough_3d.h:463
bool getUseDistanceWeight() const
Gets whether the vote casting procedure uses the correspondence's distance as a score.
Definition: hough_3d.h:350
void setInputRf(const ModelRfCloudConstPtr &input_rf)
Provide a pointer to the input dataset's reference frames.
Definition: hough_3d.h:198
PointCloud::ConstPtr PointCloudConstPtr
Definition: hough_3d.h:158
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:448
boost::shared_ptr< const Correspondences > CorrespondencesConstPtr
ModelRfCloud::Ptr ModelRfCloudPtr
Definition: hough_3d.h:149
CorrespondencesConstPtr model_scene_corrs_
The correspondences between points in the input and the scene datasets.
Hough3DGrouping()
Constructor.
Definition: hough_3d.h:163
void clusterCorrespondences(std::vector< Correspondences > &model_instances)
Cluster the input correspondences in order to distinguish between different instances of the model in...
Definition: hough_3d.hpp:258
ModelRfCloudConstPtr input_rf_
The input Rf cloud.
Definition: hough_3d.h:442
void setInputCloud(const PointCloudConstPtr &cloud)
Provide a pointer to the input dataset.
Definition: hough_3d.h:183
pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::SceneCloudConstPtr SceneCloudConstPtr
Definition: hough_3d.h:160
bool use_interpolation_
Use the interpolation between neighboring Hough bins when casting votes.
Definition: hough_3d.h:460
Class implementing a 3D correspondence grouping algorithm that can deal with multiple instances of a ...
Definition: hough_3d.h:145
PointCloud represents the base class in PCL for storing collections of 3D points. ...
void setSceneCloud(const SceneCloudConstPtr &scene)
Provide a pointer to the scene dataset (i.e.
Definition: hough_3d.h:222
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:469
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Provide a pointer to the input dataset.
Definition: pcl_base.hpp:66
SceneCloudConstPtr scene_
The scene cloud.
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:454
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:275
Eigen::Vector3d min_coord_
Minimum coordinate in the Hough Space.
Definition: hough_3d.h:108
std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f > > model_votes_
The result of the training.
Definition: hough_3d.h:451
ModelRfCloudConstPtr getInputRf() const
Getter for the input dataset's reference frames.
Definition: hough_3d.h:212
pcl::PointCloud< PointModelRfT > ModelRfCloud
Definition: hough_3d.h:148
std::vector< Eigen::Matrix4f, Eigen::aligned_allocator< Eigen::Matrix4f > > found_transformations_
Transformations found by clusterCorrespondences method.
Definition: hough_3d.h:475
void setUseInterpolation(bool use_interpolation)
Sets whether the vote casting procedure interpolates the score between neighboring bins of the Hough ...
Definition: hough_3d.h:317
double hough_bin_size_
The size of each bin of the hough space.
Definition: hough_3d.h:457
double getHoughBinSize() const
Gets the size of each bin into the Hough space.
Definition: hough_3d.h:306
HoughSpace3D is a 3D voting space.
Definition: hough_3d.h:55
bool getUseInterpolation() const
Gets whether the vote casting procedure interpolates the score between neighboring bins of the Hough ...
Definition: hough_3d.h:329
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:389
void setSceneRf(const SceneRfCloudConstPtr &scene_rf)
Provide a pointer to the scene dataset's reference frames.
Definition: hough_3d.h:236
PointCloud::Ptr PointCloudPtr
Definition: hough_3d.h:157
void setHoughBinSize(double bin_size)
Sets the size of each bin into the Hough space.
Definition: hough_3d.h:295