Point Cloud Library (PCL)  1.15.1-dev
implicit_shape_model.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2011, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage, Inc. nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  */
35 
36 #pragma once
37 
38 #include <vector>
39 #include <fstream>
40 #include <Eigen/src/Core/Matrix.h>
41 #include <pcl/memory.h>
42 #include <pcl/pcl_macros.h>
43 #include <pcl/point_types.h>
44 #include <pcl/point_representation.h>
45 #include <pcl/features/feature.h>
46 
47 namespace pcl
48 {
49  /** \brief This struct is used for storing peak. */
50  struct EIGEN_ALIGN16 ISMPeak
51  {
52  /** \brief Point were this peak is located. */
54 
55  /** \brief Density of this peak. */
56  double density;
57 
58  /** \brief Determines which class this peak belongs. */
59  int class_id;
60 
62  };
63 
64  namespace features
65  {
66  /** \brief This class is used for storing, analyzing and manipulating votes
67  * obtained from ISM algorithm. */
68  template <typename PointT>
70  {
71  public:
72 
73  using Ptr = shared_ptr<ISMVoteList<PointT> >;
74  using ConstPtr = shared_ptr<const ISMVoteList<PointT>>;
75 
76  /** \brief Empty constructor with member variables initialization. */
78 
79  /** \brief virtual descriptor. */
80  virtual
81  ~ISMVoteList ();
82 
83  /** \brief This method simply adds another vote to the list.
84  * \param[in] in_vote vote to add
85  * \param[in] vote_origin origin of the added vote
86  * \param[in] in_class class for which this vote is cast
87  */
88  void
89  addVote (pcl::InterestPoint& in_vote, const PointT &vote_origin, int in_class);
90 
91  /** \brief Returns the colored cloud that consists of votes for center (blue points) and
92  * initial point cloud (if it was passed).
93  * \param[in] cloud cloud that needs to be merged with votes for visualizing. */
95  getColoredCloud (typename pcl::PointCloud<PointT>::Ptr cloud = 0);
96 
97  /** \brief This method finds the strongest peaks (points were density has most higher values).
98  * It is based on the non maxima suppression principles.
99  * \param[out] out_peaks it will contain the strongest peaks
100  * \param[in] in_class_id class of interest for which peaks are evaluated
101  * \param[in] in_non_maxima_radius non maxima suppression radius. The shapes radius is recommended for this value.
102  * \param in_sigma
103  */
104  void
105  findStrongestPeaks (std::vector<ISMPeak, Eigen::aligned_allocator<ISMPeak> > &out_peaks, int in_class_id, double in_non_maxima_radius, double in_sigma);
106 
107  /** \brief Returns the density at the specified point.
108  * \param[in] point point of interest
109  * \param[in] sigma_dist
110  */
111  double
112  getDensityAtPoint (const PointT &point, double sigma_dist);
113 
114  /** \brief This method simply returns the number of votes. */
115  unsigned int
116  getNumberOfVotes ();
117 
118  protected:
119 
120  /** \brief this method is simply setting up the search tree. */
121  void
122  validateTree ();
123 
124  Eigen::Vector3f
125  shiftMean (const Eigen::Vector3f& snapPt, const double in_dSigmaDist);
126 
127  protected:
128 
129  /** \brief Stores all votes. */
131 
132  /** \brief Signalizes if the tree is valid. */
133  bool tree_is_valid_{false};
134 
135  /** \brief Stores the origins of the votes. */
137 
138  /** \brief Stores classes for which every single vote was cast. */
139  std::vector<int> votes_class_{};
140 
141  /** \brief Stores the search tree. */
143 
144  /** \brief Stores neighbours indices. */
145  pcl::Indices k_ind_{};
146 
147  /** \brief Stores square distances to the corresponding neighbours. */
148  std::vector<float> k_sqr_dist_{};
149  };
150 
151  /** \brief The assignment of this structure is to store the statistical/learned weights and other information
152  * of the trained Implicit Shape Model algorithm.
153  */
155  {
156  using Ptr = shared_ptr<ISMModel>;
157  using ConstPtr = shared_ptr<const ISMModel>;
158 
159  /** \brief Simple constructor that initializes the structure. */
161 
162  /** \brief Copy constructor for deep copy. */
163  ISMModel (ISMModel const & copy);
164 
165  /** Destructor that frees memory. */
166  virtual
167  ~ISMModel ();
168 
169  /** \brief This method simply saves the trained model for later usage.
170  * \param[in] file_name path to file for saving model
171  */
172  bool
173  saveModelToFile (std::string& file_name);
174 
175  /** \brief This method loads the trained model from file.
176  * \param[in] file_name path to file which stores trained model
177  */
178  bool
179  loadModelFromfile (std::string& file_name);
180 
181  /** \brief this method resets all variables and frees memory. */
182  void
183  reset ();
184 
185  /** Operator overloading for deep copy. */
186  ISMModel & operator = (const ISMModel& other);
187 
188  /** \brief Stores statistical weights. */
189  std::vector<std::vector<float> > statistical_weights_{};
190 
191  /** \brief Stores learned weights. */
192  std::vector<float> learned_weights_{};
193 
194  /** \brief Stores the class label for every direction. */
195  std::vector<unsigned int> classes_{};
196 
197  /** \brief Stores the sigma value for each class. This values were used to compute the learned weights. */
198  std::vector<float> sigmas_{};
199 
200  /** \brief Stores the directions to objects center for each visual word. */
201  Eigen::MatrixXf directions_to_center_;
202 
203  /** \brief Stores the centers of the clusters that were obtained during the visual words clusterization. */
204  Eigen::MatrixXf clusters_centers_;
205 
206  /** \brief This is an array of clusters. Each cluster stores the indices of the visual words that it contains. */
207  std::vector<std::vector<unsigned int> > clusters_{};
208 
209  /** \brief Stores the number of classes. */
210  unsigned int number_of_classes_{0};
211 
212  /** \brief Stores the number of visual words. */
213  unsigned int number_of_visual_words_{0};
214 
215  /** \brief Stores the number of clusters. */
216  unsigned int number_of_clusters_{0};
217 
218  /** \brief Stores descriptors dimension. */
219  unsigned int descriptors_dimension_{0};
220 
222  };
223  }
224 
225  namespace ism
226  {
227  /** \brief This class implements Implicit Shape Model algorithm described in
228  * "Hough Transforms and 3D SURF for robust three dimensional classification"
229  * by Jan Knopp, Mukta Prasad, Geert Willems, Radu Timofte, and Luc Van Gool.
230  * It has two main member functions. One for training, using the data for which we know
231  * which class it belongs to. And second for investigating a cloud for the presence
232  * of the class of interest.
233  * Implementation of the ISM algorithm described in "Hough Transforms and 3D SURF for robust three dimensional classification"
234  * by Jan Knopp, Mukta Prasad, Geert Willems, Radu Timofte, and Luc Van Gool
235  *
236  * Authors: Roman Shapovalov, Alexander Velizhev, Sergey Ushakov
237  * \ingroup recognition
238  */
239  template <int FeatureSize, typename PointT, typename NormalT = pcl::Normal>
241  {
242  public:
243 
246  using FeaturePtr = typename Feature::Ptr;
247 
248  protected:
249 
250  /** \brief This structure stores the information about the keypoint. */
252  {
253  /** \brief Location info constructor.
254  * \param[in] model_num number of training model.
255  * \param[in] dir_to_center expected direction to center
256  * \param[in] origin initial point
257  * \param[in] normal normal of the initial point
258  */
259  LocationInfo (unsigned int model_num, const PointT& dir_to_center, const PointT& origin, const NormalT& normal) :
260  model_num_ (model_num),
261  dir_to_center_ (dir_to_center),
262  point_ (origin),
263  normal_ (normal) {};
264 
265  /** \brief Tells from which training model this keypoint was extracted. */
266  unsigned int model_num_;
267 
268  /** \brief Expected direction to center for this keypoint. */
270 
271  /** \brief Stores the initial point. */
273 
274  /** \brief Stores the normal of the initial point. */
276  };
277 
278  /** \brief This structure is used for determining the end of the
279  * k-means clustering process. */
281  {
282  enum
283  {
284  COUNT = 1,
285  EPS = 2
286  };
287 
288  /** \brief Termination criteria constructor.
289  * \param[in] type defines the condition of termination(max iter., desired accuracy)
290  * \param[in] max_count defines the max number of iterations
291  * \param[in] epsilon defines the desired accuracy
292  */
293  TermCriteria(int type, int max_count, float epsilon) :
294  type_ (type),
295  max_count_ (max_count),
296  epsilon_ (epsilon) {};
297 
298  /** \brief Flag that determines when the k-means clustering must be stopped.
299  * If type_ equals COUNT then it must be stopped when the max number of iterations will be
300  * reached. If type_ eaquals EPS then it must be stopped when the desired accuracy will be reached.
301  * These flags can be used together, in that case the clustering will be finished when one of these
302  * conditions will be reached.
303  */
304  int type_;
305 
306  /** \brief Defines maximum number of iterations for k-means clustering. */
308 
309  /** \brief Defines the accuracy for k-means clustering. */
310  float epsilon_;
311  };
312 
313  /** \brief Structure for storing the visual word. */
315  {
316  /** \brief Empty constructor with member variables initialization. */
318 
319  dir_to_center_ (0.0f, 0.0f, 0.0f) {};
320 
321  /** \brief Which class this vote belongs. */
322  int class_{-1};
323 
324  /** \brief Weight of the vote. */
325  float learned_weight_{0.0f};
326 
327  /** \brief Expected direction to center. */
329  };
330 
331  public:
332 
333  /** \brief Simple constructor that initializes everything. */
335 
336  /** \brief Simple destructor. */
337  virtual
339 
340  /** \brief This method simply returns the clouds that were set as the training clouds. */
341  std::vector<typename pcl::PointCloud<PointT>::Ptr>
342  getTrainingClouds ();
343 
344  /** \brief Allows to set clouds for training the ISM model.
345  * \param[in] training_clouds array of point clouds for training
346  */
347  void
348  setTrainingClouds (const std::vector< typename pcl::PointCloud<PointT>::Ptr >& training_clouds);
349 
350  /** \brief Returns the array of classes that indicates which class the corresponding training cloud belongs. */
351  std::vector<unsigned int>
352  getTrainingClasses ();
353 
354  /** \brief Allows to set the class labels for the corresponding training clouds.
355  * \param[in] training_classes array of class labels
356  */
357  void
358  setTrainingClasses (const std::vector<unsigned int>& training_classes);
359 
360  /** \brief This method returns the corresponding cloud of normals for every training point cloud. */
361  std::vector<typename pcl::PointCloud<NormalT>::Ptr>
362  getTrainingNormals ();
363 
364  /** \brief Allows to set normals for the training clouds that were passed through setTrainingClouds method.
365  * \param[in] training_normals array of clouds, each cloud is the cloud of normals
366  */
367  void
368  setTrainingNormals (const std::vector< typename pcl::PointCloud<NormalT>::Ptr >& training_normals);
369 
370  /** \brief Returns the sampling size used for cloud simplification. */
371  float
372  getSamplingSize ();
373 
374  /** \brief Changes the sampling size used for cloud simplification.
375  * \param[in] sampling_size desired size of grid bin
376  */
377  void
378  setSamplingSize (float sampling_size);
379 
380  /** \brief Returns the current feature estimator used for extraction of the descriptors. */
381  FeaturePtr
382  getFeatureEstimator ();
383 
384  /** \brief Changes the feature estimator.
385  * \param[in] feature feature estimator that will be used to extract the descriptors.
386  * Note that it must be fully initialized and configured.
387  */
388  void
389  setFeatureEstimator (FeaturePtr feature);
390 
391  /** \brief Returns the number of clusters used for descriptor clustering. */
392  unsigned int
393  getNumberOfClusters ();
394 
395  /** \brief Changes the number of clusters.
396  * \param num_of_clusters desired number of clusters
397  */
398  void
399  setNumberOfClusters (unsigned int num_of_clusters);
400 
401  /** \brief Returns the array of sigma values. */
402  std::vector<float>
403  getSigmaDists ();
404 
405  /** \brief This method allows to set the value of sigma used for calculating the learned weights for every single class.
406  * \param[in] training_sigmas new sigmas for every class. If you want these values to be computed automatically,
407  * just pass the empty array. The automatic regime calculates the maximum distance between the objects points and takes 10% of
408  * this value as recommended in the article. If there are several objects of the same class,
409  * then it computes the average maximum distance and takes 10%. Note that each class has its own sigma value.
410  */
411  void
412  setSigmaDists (const std::vector<float>& training_sigmas);
413 
414  /** \brief Returns the state of Nvot coeff from [Knopp et al., 2010, (4)],
415  * if set to false then coeff is taken as 1.0. It is just a kind of heuristic.
416  * The default behavior is as in the article. So you can ignore this if you want.
417  */
418  bool
419  getNVotState ();
420 
421  /** \brief Changes the state of the Nvot coeff from [Knopp et al., 2010, (4)].
422  * \param[in] state desired state, if false then Nvot is taken as 1.0
423  */
424  void
425  setNVotState (bool state);
426 
427  /** \brief This method performs training and forms a visual vocabulary. It returns a trained model that
428  * can be saved to file for later usage.
429  * \param[out] trained_model trained model
430  */
431  bool
432  trainISM (ISMModelPtr& trained_model);
433 
434  /** \brief This function is searching for the class of interest in a given cloud
435  * and returns the list of votes.
436  * \param[in] model trained model which will be used for searching the objects
437  * \param[in] in_cloud input cloud that need to be investigated
438  * \param[in] in_normals cloud of normals corresponding to the input cloud
439  * \param[in] in_class_of_interest class which we are looking for
440  */
442  findObjects (ISMModelPtr model, typename pcl::PointCloud<PointT>::Ptr in_cloud, typename pcl::PointCloud<Normal>::Ptr in_normals, int in_class_of_interest);
443 
444  protected:
445 
446  /** \brief Extracts the descriptors from the input clouds.
447  * \param[out] histograms it will store the descriptors for each key point
448  * \param[out] locations it will contain the comprehensive information (such as direction, initial keypoint)
449  * for the corresponding descriptors
450  */
451  bool
452  extractDescriptors (std::vector<pcl::Histogram<FeatureSize> >& histograms,
453  std::vector<LocationInfo, Eigen::aligned_allocator<LocationInfo> >& locations);
454 
455  /** \brief This method performs descriptor clustering.
456  * \param[in] histograms descriptors to cluster
457  * \param[out] labels it contains labels for each descriptor
458  * \param[out] clusters_centers stores the centers of clusters
459  */
460  bool
461  clusterDescriptors (std::vector< pcl::Histogram<FeatureSize> >& histograms, Eigen::MatrixXi& labels, Eigen::MatrixXf& clusters_centers);
462 
463  /** \brief This method calculates the value of sigma used for calculating the learned weights for every single class.
464  * \param[out] sigmas computed sigmas.
465  */
466  void
467  calculateSigmas (std::vector<float>& sigmas);
468 
469  /** \brief This function forms a visual vocabulary and evaluates weights
470  * described in [Knopp et al., 2010, (5)].
471  * \param[in] locations array containing description of each keypoint: its position, which cloud belongs
472  * and expected direction to center
473  * \param[in] labels labels that were obtained during k-means clustering
474  * \param[in] sigmas array of sigmas for each class
475  * \param[in] clusters clusters that were obtained during k-means clustering
476  * \param[out] statistical_weights stores the computed statistical weights
477  * \param[out] learned_weights stores the computed learned weights
478  */
479  void
480  calculateWeights (const std::vector< LocationInfo, Eigen::aligned_allocator<LocationInfo> >& locations,
481  const Eigen::MatrixXi &labels,
482  std::vector<float>& sigmas,
483  std::vector<std::vector<unsigned int> >& clusters,
484  std::vector<std::vector<float> >& statistical_weights,
485  std::vector<float>& learned_weights);
486 
487  /** \brief Simplifies the cloud using voxel grid principles.
488  * \param[in] in_point_cloud cloud that need to be simplified
489  * \param[in] in_normal_cloud normals of the cloud that need to be simplified
490  * \param[out] out_sampled_point_cloud simplified cloud
491  * \param[out] out_sampled_normal_cloud and the corresponding normals
492  */
493  void
494  simplifyCloud (typename pcl::PointCloud<PointT>::ConstPtr in_point_cloud,
495  typename pcl::PointCloud<NormalT>::ConstPtr in_normal_cloud,
496  typename pcl::PointCloud<PointT>::Ptr out_sampled_point_cloud,
497  typename pcl::PointCloud<NormalT>::Ptr out_sampled_normal_cloud);
498 
499  /** \brief This method simply shifts the clouds points relative to the passed point.
500  * \param[in] in_cloud cloud to shift
501  * \param[in] shift_point point relative to which the cloud will be shifted
502  */
503  void
504  shiftCloud (typename pcl::PointCloud<PointT>::Ptr in_cloud, Eigen::Vector3f shift_point);
505 
506  /** \brief This method simply computes the rotation matrix, so that the given normal
507  * would match the Y axis after the transformation. This is done because the algorithm needs to be invariant
508  * to the affine transformations.
509  * \param[in] in_normal normal for which the rotation matrix need to be computed
510  */
511  Eigen::Matrix3f
512  alignYCoordWithNormal (const NormalT& in_normal);
513 
514  /** \brief This method applies transform set in in_transform to vector io_vector.
515  * \param[in] io_vec vector that need to be transformed
516  * \param[in] in_transform matrix that contains the transformation
517  */
518  void
519  applyTransform (Eigen::Vector3f& io_vec, const Eigen::Matrix3f& in_transform);
520 
521  /** \brief This method estimates features for the given point cloud.
522  * \param[in] sampled_point_cloud sampled point cloud for which the features must be computed
523  * \param[in] normal_cloud normals for the original point cloud
524  * \param[out] feature_cloud it will store the computed histograms (features) for the given cloud
525  */
526  void
527  estimateFeatures (typename pcl::PointCloud<PointT>::Ptr sampled_point_cloud,
528  typename pcl::PointCloud<NormalT>::Ptr normal_cloud,
529  typename pcl::PointCloud<pcl::Histogram<FeatureSize> >::Ptr feature_cloud);
530 
531  /** \brief Performs K-means clustering.
532  * \param[in] points_to_cluster points to cluster
533  * \param[in] number_of_clusters desired number of clusters
534  * \param[out] io_labels output parameter, which stores the label for each point
535  * \param[in] criteria defines when the computational process need to be finished. For example if the
536  * desired accuracy is achieved or the iteration number exceeds given value
537  * \param[in] attempts number of attempts to compute clustering
538  * \param[in] flags if set to USE_INITIAL_LABELS then initial approximation of labels is taken from io_labels
539  * \param[out] cluster_centers it will store the cluster centers
540  */
541  double
542  computeKMeansClustering (const Eigen::MatrixXf& points_to_cluster,
543  int number_of_clusters,
544  Eigen::MatrixXi& io_labels,
545  TermCriteria criteria,
546  int attempts,
547  int flags,
548  Eigen::MatrixXf& cluster_centers);
549 
550  /** \brief Generates centers for clusters as described in
551  * Arthur, David and Sergei Vassilvitski (2007) k-means++: The Advantages of Careful Seeding.
552  * \param[in] data points to cluster
553  * \param[out] out_centers it will contain generated centers
554  * \param[in] number_of_clusters defines the number of desired cluster centers
555  * \param[in] trials number of trials to generate a center
556  */
557  void
558  generateCentersPP (const Eigen::MatrixXf& data,
559  Eigen::MatrixXf& out_centers,
560  int number_of_clusters,
561  int trials);
562 
563  /** \brief Generates random center for cluster.
564  * \param[in] boxes contains min and max values for each dimension
565  * \param[out] center it will the contain generated center
566  */
567  void
568  generateRandomCenter (const std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> >& boxes, Eigen::VectorXf& center);
569 
570  /** \brief Computes the square distance between two vectors.
571  * \param[in] vec_1 first vector
572  * \param[in] vec_2 second vector
573  */
574  float
575  computeDistance (Eigen::VectorXf& vec_1, Eigen::VectorXf& vec_2);
576 
577  /** \brief Forbids the assignment operator. */
579  operator= (const ImplicitShapeModelEstimation&);
580 
581  protected:
582 
583  /** \brief Stores the clouds used for training. */
584  std::vector<typename pcl::PointCloud<PointT>::Ptr> training_clouds_{};
585 
586  /** \brief Stores the class number for each cloud from training_clouds_. */
587  std::vector<unsigned int> training_classes_{};
588 
589  /** \brief Stores the normals for each training cloud. */
590  std::vector<typename pcl::PointCloud<NormalT>::Ptr> training_normals_{};
591 
592  /** \brief This array stores the sigma values for each training class. If this array has a size equals 0, then
593  * sigma values will be calculated automatically.
594  */
595  std::vector<float> training_sigmas_{};
596 
597  /** \brief This value is used for the simplification. It sets the size of grid bin. */
598  float sampling_size_{0.1f};
599 
600  /** \brief Stores the feature estimator. */
602 
603  /** \brief Number of clusters, is used for clustering descriptors during the training. */
604  unsigned int number_of_clusters_{184};
605 
606  /** \brief If set to false then Nvot coeff from [Knopp et al., 2010, (4)] is equal 1.0. */
607  bool n_vot_ON_{true};
608 
609  /** \brief This const value is used for indicating that for k-means clustering centers must
610  * be generated as described in
611  * Arthur, David and Sergei Vassilvitski (2007) k-means++: The Advantages of Careful Seeding. */
612  static const int PP_CENTERS = 2;
613 
614  /** \brief This const value is used for indicating that input labels must be taken as the
615  * initial approximation for k-means clustering. */
616  static const int USE_INITIAL_LABELS = 1;
617  };
618  }
619 }
620 
621 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::ISMPeak,
622  (float, x, x)
623  (float, y, y)
624  (float, z, z)
625  (float, density, ism_density)
626  (float, class_id, ism_class_id)
627 )
Feature represents the base feature class.
Definition: feature.h:107
shared_ptr< Feature< PointInT, PointOutT > > Ptr
Definition: feature.h:114
shared_ptr< PointCloud< PointT > > Ptr
Definition: point_cloud.h:414
shared_ptr< const PointCloud< PointT > > ConstPtr
Definition: point_cloud.h:415
This class is used for storing, analyzing and manipulating votes obtained from ISM algorithm.
shared_ptr< ISMVoteList< PointT > > Ptr
shared_ptr< const ISMVoteList< PointT > > ConstPtr
ISMVoteList()
Empty constructor with member variables initialization.
This class implements Implicit Shape Model algorithm described in "Hough Transforms and 3D SURF for r...
pcl::features::ISMModel::Ptr ISMModelPtr
ImplicitShapeModelEstimation()
Simple constructor that initializes everything.
Feature::Ptr feature_estimator_
Stores the feature estimator.
shared_ptr< pcl::search::Search< PointT > > Ptr
Definition: search.h:81
Defines all the PCL implemented PointT point type structures.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Definition: memory.h:86
Defines functions, macros and traits for allocating and using memory.
IndicesAllocator<> Indices
Type used for indices in PCL.
Definition: types.h:133
Defines all the PCL and non-PCL macros used.
#define PCL_EXPORTS
Definition: pcl_macros.h:322
A point structure representing an N-D histogram.
This struct is used for storing peak.
PCL_ADD_POINT4D
Point were this peak is located.
double density
Density of this peak.
int class_id
Determines which class this peak belongs.
A point structure representing an interest point with Euclidean xyz coordinates, and an interest valu...
A point structure representing normal coordinates and the surface curvature estimate.
A point structure representing Euclidean xyz coordinates.
A point structure representing Euclidean xyz coordinates, and the RGB color.
The assignment of this structure is to store the statistical/learned weights and other information of...
shared_ptr< ISMModel > Ptr
shared_ptr< const ISMModel > ConstPtr
Eigen::MatrixXf clusters_centers_
Stores the centers of the clusters that were obtained during the visual words clusterization.
ISMModel()
Simple constructor that initializes the structure.
Eigen::MatrixXf directions_to_center_
Stores the directions to objects center for each visual word.
This structure stores the information about the keypoint.
NormalT normal_
Stores the normal of the initial point.
unsigned int model_num_
Tells from which training model this keypoint was extracted.
LocationInfo(unsigned int model_num, const PointT &dir_to_center, const PointT &origin, const NormalT &normal)
Location info constructor.
PointT dir_to_center_
Expected direction to center for this keypoint.
This structure is used for determining the end of the k-means clustering process.
int type_
Flag that determines when the k-means clustering must be stopped.
float epsilon_
Defines the accuracy for k-means clustering.
TermCriteria(int type, int max_count, float epsilon)
Termination criteria constructor.
int max_count_
Defines maximum number of iterations for k-means clustering.
pcl::PointXYZ dir_to_center_
Expected direction to center.
VisualWordStat()
Empty constructor with member variables initialization.