Point Cloud Library (PCL)  1.9.1
ia_fpcs.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2014-, Open Perception, Inc.
6  * Copyright (C) 2008 Ben Gurion University of the Negev, Beer Sheva, Israel.
7  *
8  * All rights reserved
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions 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 the copyright holder(s) 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  */
37 
38 #ifndef PCL_REGISTRATION_IA_FPCS_H_
39 #define PCL_REGISTRATION_IA_FPCS_H_
40 
41 #include <pcl/common/common.h>
42 #include <pcl/registration/registration.h>
43 #include <pcl/registration/matching_candidate.h>
44 
45 namespace pcl
46 {
47  /** \brief Compute the mean point density of a given point cloud.
48  * \param[in] cloud pointer to the input point cloud
49  * \param[in] max_dist maximum distance of a point to be considered as a neighbor
50  * \param[in] nr_threads number of threads to use (default = 1, only used if OpenMP flag is set)
51  * \return the mean point density of a given point cloud
52  */
53  template <typename PointT> inline float
54  getMeanPointDensity (const typename pcl::PointCloud<PointT>::ConstPtr &cloud, float max_dist, int nr_threads = 1);
55 
56  /** \brief Compute the mean point density of a given point cloud.
57  * \param[in] cloud pointer to the input point cloud
58  * \param[in] indices the vector of point indices to use from \a cloud
59  * \param[in] max_dist maximum distance of a point to be considered as a neighbor
60  * \param[in] nr_threads number of threads to use (default = 1, only used if OpenMP flag is set)
61  * \return the mean point density of a given point cloud
62  */
63  template <typename PointT> inline float
64  getMeanPointDensity (const typename pcl::PointCloud<PointT>::ConstPtr &cloud, const std::vector <int> &indices,
65  float max_dist, int nr_threads = 1);
66 
67 
68  namespace registration
69  {
70  /** \brief FPCSInitialAlignment computes corresponding four point congruent sets as described in:
71  * "4-points congruent sets for robust pairwise surface registration", Dror Aiger, Niloy Mitra, Daniel Cohen-Or.
72  * ACM Transactions on Graphics, vol. 27(3), 2008
73  * \author P.W.Theiler
74  * \ingroup registration
75  */
76  template <typename PointSource, typename PointTarget, typename NormalT = pcl::Normal, typename Scalar = float>
77  class FPCSInitialAlignment : public Registration <PointSource, PointTarget, Scalar>
78  {
79  public:
80  /** \cond */
81  typedef boost::shared_ptr <FPCSInitialAlignment <PointSource, PointTarget, NormalT, Scalar> > Ptr;
82  typedef boost::shared_ptr <const FPCSInitialAlignment <PointSource, PointTarget, NormalT, Scalar> > ConstPtr;
83 
86 
90  typedef typename PointCloudSource::iterator PointCloudSourceIterator;
91 
92  typedef pcl::PointCloud <NormalT> Normals;
93  typedef typename Normals::ConstPtr NormalsConstPtr;
94 
97  /** \endcond */
98 
99 
100  /** \brief Constructor.
101  * Resets the maximum number of iterations to 0 thus forcing an internal computation if not set by the user.
102  * Sets the number of RANSAC iterations to 1000 and the standard transformation estimation to TransformationEstimation3Point.
103  */
105 
106  /** \brief Destructor. */
108  {};
109 
110 
111  /** \brief Provide a pointer to the vector of target indices.
112  * \param[in] target_indices a pointer to the target indices
113  */
114  inline void
115  setTargetIndices (const IndicesPtr &target_indices)
116  {
117  target_indices_ = target_indices;
118  };
119 
120  /** \return a pointer to the vector of target indices. */
121  inline IndicesPtr
123  {
124  return (target_indices_);
125  };
126 
127 
128  /** \brief Provide a pointer to the normals of the source point cloud.
129  * \param[in] source_normals pointer to the normals of the source pointer cloud.
130  */
131  inline void
132  setSourceNormals (const NormalsConstPtr &source_normals)
133  {
134  source_normals_ = source_normals;
135  };
136 
137  /** \return the normals of the source point cloud. */
138  inline NormalsConstPtr
140  {
141  return (source_normals_);
142  };
143 
144 
145  /** \brief Provide a pointer to the normals of the target point cloud.
146  * \param[in] target_normals point to the normals of the target point cloud.
147  */
148  inline void
149  setTargetNormals (const NormalsConstPtr &target_normals)
150  {
151  target_normals_ = target_normals;
152  };
153 
154  /** \return the normals of the target point cloud. */
155  inline NormalsConstPtr
157  {
158  return (target_normals_);
159  };
160 
161 
162  /** \brief Set the number of used threads if OpenMP is activated.
163  * \param[in] nr_threads the number of used threads
164  */
165  inline void
166  setNumberOfThreads (int nr_threads)
167  {
168  nr_threads_ = nr_threads;
169  };
170 
171  /** \return the number of threads used if OpenMP is activated. */
172  inline int
174  {
175  return (nr_threads_);
176  };
177 
178 
179  /** \brief Set the constant factor delta which weights the internally calculated parameters.
180  * \param[in] delta the weight factor delta
181  * \param[in] normalize flag if delta should be normalized according to point cloud density
182  */
183  inline void
184  setDelta (float delta, bool normalize = false)
185  {
186  delta_ = delta;
187  normalize_delta_ = normalize;
188  };
189 
190  /** \return the constant factor delta which weights the internally calculated parameters. */
191  inline float
192  getDelta () const
193  {
194  return (delta_);
195  };
196 
197 
198  /** \brief Set the approximate overlap between source and target.
199  * \param[in] approx_overlap the estimated overlap
200  */
201  inline void
202  setApproxOverlap (float approx_overlap)
203  {
204  approx_overlap_ = approx_overlap;
205  };
206 
207  /** \return the approximated overlap between source and target. */
208  inline float
210  {
211  return (approx_overlap_);
212  };
213 
214 
215  /** \brief Set the scoring threshold used for early finishing the method.
216  * \param[in] score_threshold early terminating score criteria
217  */
218  inline void
219  setScoreThreshold (float score_threshold)
220  {
221  score_threshold_ = score_threshold;
222  };
223 
224  /** \return the scoring threshold used for early finishing the method. */
225  inline float
227  {
228  return (score_threshold_);
229  };
230 
231 
232  /** \brief Set the number of source samples to use during alignment.
233  * \param[in] nr_samples the number of source samples
234  */
235  inline void
236  setNumberOfSamples (int nr_samples)
237  {
238  nr_samples_ = nr_samples;
239  };
240 
241  /** \return the number of source samples to use during alignment. */
242  inline int
244  {
245  return (nr_samples_);
246  };
247 
248 
249  /** \brief Set the maximum normal difference between valid point correspondences in degree.
250  * \param[in] max_norm_diff the maximum difference in degree
251  */
252  inline void
253  setMaxNormalDifference (float max_norm_diff)
254  {
255  max_norm_diff_ = max_norm_diff;
256  };
257 
258  /** \return the maximum normal difference between valid point correspondences in degree. */
259  inline float
261  {
262  return (max_norm_diff_);
263  };
264 
265 
266  /** \brief Set the maximum computation time in seconds.
267  * \param[in] max_runtime the maximum runtime of the method in seconds
268  */
269  inline void
270  setMaxComputationTime (int max_runtime)
271  {
272  max_runtime_ = max_runtime;
273  };
274 
275  /** \return the maximum computation time in seconds. */
276  inline int
278  {
279  return (max_runtime_);
280  };
281 
282 
283  /** \return the fitness score of the best scored four-point match. */
284  inline float
286  {
287  return (fitness_score_);
288  };
289 
290  protected:
291 
295 
306 
307 
308  /** \brief Rigid transformation computation method.
309  * \param output the transformed input point cloud dataset using the rigid transformation found
310  * \param guess The computed transforamtion
311  */
312  virtual void
313  computeTransformation (PointCloudSource &output, const Eigen::Matrix4f& guess);
314 
315 
316  /** \brief Internal computation initialization. */
317  virtual bool
318  initCompute ();
319 
320  /** \brief Select an approximately coplanar set of four points from the source cloud.
321  * \param[out] base_indices selected source cloud indices, further used as base (B)
322  * \param[out] ratio the two diagonal intersection ratios (r1,r2) of the base points
323  * \return
324  * * < 0 no coplanar four point sets with large enough sampling distance was found
325  * * = 0 a set of four congruent points was selected
326  */
327  int
328  selectBase (std::vector <int> &base_indices, float (&ratio)[2]);
329 
330  /** \brief Select randomly a triplet of points with large point-to-point distances. The minimum point
331  * sampling distance is calculated based on the estimated point cloud overlap during initialization.
332  *
333  * \param[out] base_indices indices of base B
334  * \return
335  * * < 0 no triangle with large enough base lines could be selected
336  * * = 0 base triangle succesully selected
337  */
338  int
339  selectBaseTriangle (std::vector <int> &base_indices);
340 
341  /** \brief Setup the base (four coplanar points) by ordering the points and computing intersection
342  * ratios and segment to segment distances of base diagonal.
343  *
344  * \param[in,out] base_indices indices of base B (will be reordered)
345  * \param[out] ratio diagonal intersection ratios of base points
346  */
347  void
348  setupBase (std::vector <int> &base_indices, float (&ratio)[2]);
349 
350  /** \brief Calculate intersection ratios and segment to segment distances of base diagonals.
351  * \param[in] base_indices indices of base B
352  * \param[out] ratio diagonal intersection ratios of base points
353  * \return quality value of diagonal intersection
354  */
355  float
356  segmentToSegmentDist (const std::vector <int> &base_indices, float (&ratio)[2]);
357 
358  /** \brief Search for corresponding point pairs given the distance between two base points.
359  *
360  * \param[in] idx1 first index of current base segment (in source cloud)
361  * \param[in] idx2 second index of current base segment (in source cloud)
362  * \param[out] pairs resulting point pairs with point-to-point distance close to ref_dist
363  * \return
364  * * < 0 no corresponding point pair was found
365  * * = 0 at least one point pair candidate was found
366  */
367  virtual int
368  bruteForceCorrespondences (int idx1, int idx2, pcl::Correspondences &pairs);
369 
370  /** \brief Determine base matches by combining the point pair candidate and search for coinciding
371  * intersection points using the diagonal segment ratios of base B. The coincidation threshold is
372  * calculated during initialization (coincidation_limit_).
373  *
374  * \param[in] base_indices indices of base B
375  * \param[out] matches vector of candidate matches w.r.t the base B
376  * \param[in] pairs_a point pairs corresponding to points of 1st diagonal of base B
377  * \param[in] pairs_b point pairs corresponding to points of 2nd diagonal of base B
378  * \param[in] ratio diagonal intersection ratios of base points
379  * \return
380  * * < 0 no base match could be found
381  * * = 0 at least one base match was found
382  */
383  virtual int
385  const std::vector <int> &base_indices,
386  std::vector <std::vector <int> > &matches,
387  const pcl::Correspondences &pairs_a,
388  const pcl::Correspondences &pairs_b,
389  const float (&ratio)[2]);
390 
391  /** \brief Check if outer rectangle distance of matched points fit with the base rectangle.
392  *
393  * \param[in] match_indices indices of match M
394  * \param[in] ds edge lengths of base B
395  * \return
396  * * < 0 at least one edge of the match M has no corresponding one in the base B
397  * * = 0 edges of match M fits to the ones of base B
398  */
399  int
400  checkBaseMatch (const std::vector <int> &match_indices, const float (&ds)[4]);
401 
402  /** \brief Method to handle current candidate matches. Here we validate and evaluate the matches w.r.t the
403  * base and store the best fitting match (together with its score and estimated transformation).
404  * \note For forwards compatibility the results are stored in 'vectors of size 1'.
405  *
406  * \param[in] base_indices indices of base B
407  * \param[in,out] matches vector of candidate matches w.r.t the base B. The candidate matches are
408  * reordered during this step.
409  * \param[out] candidates vector which contains the candidates matches M
410  */
411  virtual void
412  handleMatches (
413  const std::vector <int> &base_indices,
414  std::vector <std::vector <int> > &matches,
415  MatchingCandidates &candidates);
416 
417  /** \brief Sets the correspondences between the base B and the match M by using the distance of each point
418  * to the centroid of the rectangle.
419  *
420  * \param[in] base_indices indices of base B
421  * \param[in] match_indices indices of match M
422  * \param[out] correspondences resulting correspondences
423  */
424  virtual void
426  const std::vector <int> &base_indices,
427  std::vector <int> &match_indices,
428  pcl::Correspondences &correspondences);
429 
430  /** \brief Validate the matching by computing the transformation between the source and target based on the
431  * four matched points and by comparing the mean square error (MSE) to a threshold. The MSE limit was
432  * calculated during initialization (max_mse_).
433  *
434  * \param[in] base_indices indices of base B
435  * \param[in] match_indices indices of match M
436  * \param[in] correspondences corresondences between source and target
437  * \param[out] transformation resulting transformation matrix
438  * \return
439  * * < 0 MSE bigger than max_mse_
440  * * = 0 MSE smaller than max_mse_
441  */
442  virtual int
443  validateMatch (
444  const std::vector <int> &base_indices,
445  const std::vector <int> &match_indices,
446  const pcl::Correspondences &correspondences,
447  Eigen::Matrix4f &transformation);
448 
449  /** \brief Validate the transformation by calculating the number of inliers after transforming the source cloud.
450  * The resulting fitness score is later used as the decision criteria of the best fitting match.
451  *
452  * \param[out] transformation updated orientation matrix using all inliers
453  * \param[out] fitness_score current best fitness_score
454  * \note fitness score is only updated if the score of the current transformation exceeds the input one.
455  * \return
456  * * < 0 if previous result is better than the current one (score remains)
457  * * = 0 current result is better than the previous one (score updated)
458  */
459  virtual int
460  validateTransformation (Eigen::Matrix4f &transformation, float &fitness_score);
461 
462  /** \brief Final computation of best match out of vector of best matches. To avoid cross thread dependencies
463  * during parallel running, a best match for each try was calculated.
464  * \note For forwards compatibility the candidates are stored in vectors of 'vectors of size 1'.
465  * \param[in] candidates vector of candidate matches
466  */
467  virtual void
468  finalCompute (const std::vector <MatchingCandidates > &candidates);
469 
470 
471  /** \brief Normals of source point cloud. */
472  NormalsConstPtr source_normals_;
473 
474  /** \brief Normals of target point cloud. */
475  NormalsConstPtr target_normals_;
476 
477 
478  /** \brief Number of threads for parallelization (standard = 1).
479  * \note Only used if run compiled with OpenMP.
480  */
482 
483  /** \brief Estimated overlap between source and target (standard = 0.5). */
485 
486  /** \brief Delta value of 4pcs algorithm (standard = 1.0).
487  * It can be used as:
488  * * absolute value (normalization = false), value should represent the point accuracy to ensure finding neighbors between source <-> target
489  * * relative value (normalization = true), to adjust the internally calculated point accuracy (= point density)
490  */
491  float delta_;
492 
493  /** \brief Score threshold to stop calculation with success.
494  * If not set by the user it is equal to the approximated overlap
495  */
497 
498  /** \brief The number of points to uniformly sample the source point cloud. (standard = 0 => full cloud). */
500 
501  /** \brief Maximum normal difference of corresponding point pairs in degrees (standard = 90). */
503 
504  /** \brief Maximum allowed computation time in seconds (standard = 0 => ~unlimited). */
506 
507 
508  /** \brief Resulting fitness score of the best match. */
510 
511 
512  /** \brief Estimated diamter of the target point cloud. */
513  float diameter_;
514 
515  /** \brief Estimated squared metric overlap between source and target.
516  * \note Internally calculated using the estimated overlap and the extent of the source cloud.
517  * It is used to derive the minimum sampling distance of the base points as well as to calculated
518  * the number of tries to reliably find a correct match.
519  */
521 
522  /** \brief Use normals flag. */
524 
525  /** \brief Normalize delta flag. */
527 
528 
529  /** \brief A pointer to the vector of source point indices to use after sampling. */
531 
532  /** \brief A pointer to the vector of target point indices to use after sampling. */
534 
535  /** \brief Maximal difference between corresponding point pairs in source and target.
536  * \note Internally calculated using an estimation of the point density.
537  */
539 
540  /** \brief Maximal difference between the length of the base edges and valid match edges.
541  * \note Internally calculated using an estimation of the point density.
542  */
544 
545  /** \brief Maximal distance between coinciding intersection points to find valid matches.
546  * \note Internally calculated using an estimation of the point density.
547  */
549 
550  /** \brief Maximal mean squared errors of a transformation calculated from a candidate match.
551  * \note Internally calculated using an estimation of the point density.
552  */
553  float max_mse_;
554 
555  /** \brief Maximal squared point distance between source and target points to count as inlier.
556  * \note Internally calculated using an estimation of the point density.
557  */
559 
560 
561  /** \brief Definition of a small error. */
562  const float small_error_;
563 
564  };
565  }; // namespace registration
566 }; // namespace pcl
567 
568 #include <pcl/registration/impl/ia_fpcs.hpp>
569 
570 #endif // PCL_REGISTRATION_IA_FPCS_H_
virtual void linkMatchWithBase(const std::vector< int > &base_indices, std::vector< int > &match_indices, pcl::Correspondences &correspondences)
Sets the correspondences between the base B and the match M by using the distance of each point to th...
Definition: ia_fpcs.hpp:760
NormalsConstPtr target_normals_
Normals of target point cloud.
Definition: ia_fpcs.h:475
search::KdTree is a wrapper class which inherits the pcl::KdTree class for performing search function...
Definition: kdtree.h:62
std::vector< MatchingCandidate, Eigen::aligned_allocator< MatchingCandidate > > MatchingCandidates
virtual bool initCompute()
Internal computation initialization.
Definition: ia_fpcs.hpp:232
virtual void computeTransformation(PointCloudSource &output, const Eigen::Matrix4f &guess)
Rigid transformation computation method.
Definition: ia_fpcs.hpp:153
NormalsConstPtr getTargetNormals() const
Definition: ia_fpcs.h:156
NormalsConstPtr source_normals_
Normals of source point cloud.
Definition: ia_fpcs.h:472
float max_base_diameter_sqr_
Estimated squared metric overlap between source and target.
Definition: ia_fpcs.h:520
FPCSInitialAlignment computes corresponding four point congruent sets as described in: "4-points cong...
Definition: ia_fpcs.h:77
boost::shared_ptr< std::vector< int > > IndicesPtr
Definition: pcl_base.h:60
boost::shared_ptr< const Registration< PointSource, PointTarget, Scalar > > ConstPtr
Definition: registration.h:73
virtual int validateTransformation(Eigen::Matrix4f &transformation, float &fitness_score)
Validate the transformation by calculating the number of inliers after transforming the source cloud...
Definition: ia_fpcs.hpp:844
void setNumberOfSamples(int nr_samples)
Set the number of source samples to use during alignment.
Definition: ia_fpcs.h:236
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
int nr_threads_
Number of threads for parallelization (standard = 1).
Definition: ia_fpcs.h:481
float approx_overlap_
Estimated overlap between source and target (standard = 0.5).
Definition: ia_fpcs.h:484
pcl::PointCloud< PointTarget > PointCloudTarget
Definition: registration.h:86
virtual ~FPCSInitialAlignment()
Destructor.
Definition: ia_fpcs.h:107
bool use_normals_
Use normals flag.
Definition: ia_fpcs.h:523
void setMaxNormalDifference(float max_norm_diff)
Set the maximum normal difference between valid point correspondences in degree.
Definition: ia_fpcs.h:253
int nr_samples_
The number of points to uniformly sample the source point cloud.
Definition: ia_fpcs.h:499
pcl::IndicesPtr target_indices_
A pointer to the vector of target point indices to use after sampling.
Definition: ia_fpcs.h:533
boost::shared_ptr< Registration< PointSource, PointTarget, Scalar > > Ptr
Definition: registration.h:72
Container for matching candidate consisting of.
pcl::search::KdTree< PointSource > KdTreeReciprocal
Definition: registration.h:79
VectorType::iterator iterator
Definition: point_cloud.h:440
void setupBase(std::vector< int > &base_indices, float(&ratio)[2])
Setup the base (four coplanar points) by ordering the points and computing intersection ratios and se...
Definition: ia_fpcs.hpp:436
int selectBase(std::vector< int > &base_indices, float(&ratio)[2])
Select an approximately coplanar set of four points from the source cloud.
Definition: ia_fpcs.hpp:334
void setNumberOfThreads(int nr_threads)
Set the number of used threads if OpenMP is activated.
Definition: ia_fpcs.h:166
IndicesPtr getTargetIndices() const
Definition: ia_fpcs.h:122
virtual int validateMatch(const std::vector< int > &base_indices, const std::vector< int > &match_indices, const pcl::Correspondences &correspondences, Eigen::Matrix4f &transformation)
Validate the matching by computing the transformation between the source and target based on the four...
Definition: ia_fpcs.hpp:814
PointCloudSource::Ptr PointCloudSourcePtr
Definition: registration.h:83
boost::shared_ptr< PointCloud< PointSource > > Ptr
Definition: point_cloud.h:428
void setTargetNormals(const NormalsConstPtr &target_normals)
Provide a pointer to the normals of the target point cloud.
Definition: ia_fpcs.h:149
Define standard C methods and C++ classes that are common to all methods.
void setMaxComputationTime(int max_runtime)
Set the maximum computation time in seconds.
Definition: ia_fpcs.h:270
float max_inlier_dist_sqr_
Maximal squared point distance between source and target points to count as inlier.
Definition: ia_fpcs.h:558
void setScoreThreshold(float score_threshold)
Set the scoring threshold used for early finishing the method.
Definition: ia_fpcs.h:219
const float small_error_
Definition of a small error.
Definition: ia_fpcs.h:562
float segmentToSegmentDist(const std::vector< int > &base_indices, float(&ratio)[2])
Calculate intersection ratios and segment to segment distances of base diagonals. ...
Definition: ia_fpcs.hpp:482
void setTargetIndices(const IndicesPtr &target_indices)
Provide a pointer to the vector of target indices.
Definition: ia_fpcs.h:115
boost::shared_ptr< KdTree< PointT, Tree > > Ptr
Definition: kdtree.h:79
float score_threshold_
Score threshold to stop calculation with success.
Definition: ia_fpcs.h:496
virtual void handleMatches(const std::vector< int > &base_indices, std::vector< std::vector< int > > &matches, MatchingCandidates &candidates)
Method to handle current candidate matches.
Definition: ia_fpcs.hpp:724
float delta_
Delta value of 4pcs algorithm (standard = 1.0).
Definition: ia_fpcs.h:491
float max_pair_diff_
Maximal difference between corresponding point pairs in source and target.
Definition: ia_fpcs.h:538
pcl::IndicesPtr source_indices_
A pointer to the vector of source point indices to use after sampling.
Definition: ia_fpcs.h:530
PCL base class.
Definition: pcl_base.h:68
virtual void finalCompute(const std::vector< MatchingCandidates > &candidates)
Final computation of best match out of vector of best matches.
Definition: ia_fpcs.hpp:885
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
float getMeanPointDensity(const typename pcl::PointCloud< PointT >::ConstPtr &cloud, float max_dist, int nr_threads=1)
Compute the mean point density of a given point cloud.
Definition: ia_fpcs.hpp:49
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
Definition: point_cloud.h:429
virtual int bruteForceCorrespondences(int idx1, int idx2, pcl::Correspondences &pairs)
Search for corresponding point pairs given the distance between two base points.
Definition: ia_fpcs.hpp:573
float max_edge_diff_
Maximal difference between the length of the base edges and valid match edges.
Definition: ia_fpcs.h:543
void setApproxOverlap(float approx_overlap)
Set the approximate overlap between source and target.
Definition: ia_fpcs.h:202
Registration represents the base registration class for general purpose, ICP-like methods...
Definition: registration.h:62
void setSourceNormals(const NormalsConstPtr &source_normals)
Provide a pointer to the normals of the source point cloud.
Definition: ia_fpcs.h:132
float max_norm_diff_
Maximum normal difference of corresponding point pairs in degrees (standard = 90).
Definition: ia_fpcs.h:502
float fitness_score_
Resulting fitness score of the best match.
Definition: ia_fpcs.h:509
float diameter_
Estimated diamter of the target point cloud.
Definition: ia_fpcs.h:513
KdTreeReciprocal::Ptr KdTreeReciprocalPtr
Definition: registration.h:80
bool normalize_delta_
Normalize delta flag.
Definition: ia_fpcs.h:526
float coincidation_limit_
Maximal distance between coinciding intersection points to find valid matches.
Definition: ia_fpcs.h:548
virtual int determineBaseMatches(const std::vector< int > &base_indices, std::vector< std::vector< int > > &matches, const pcl::Correspondences &pairs_a, const pcl::Correspondences &pairs_b, const float(&ratio)[2])
Determine base matches by combining the point pair candidate and search for coinciding intersection p...
Definition: ia_fpcs.hpp:627
void setDelta(float delta, bool normalize=false)
Set the constant factor delta which weights the internally calculated parameters. ...
Definition: ia_fpcs.h:184
float max_mse_
Maximal mean squared errors of a transformation calculated from a candidate match.
Definition: ia_fpcs.h:553
pcl::PointCloud< PointSource > PointCloudSource
Definition: registration.h:82
NormalsConstPtr getSourceNormals() const
Definition: ia_fpcs.h:139
int checkBaseMatch(const std::vector< int > &match_indices, const float(&ds)[4])
Check if outer rectangle distance of matched points fit with the base rectangle.
Definition: ia_fpcs.hpp:707
int max_runtime_
Maximum allowed computation time in seconds (standard = 0 => ~unlimited).
Definition: ia_fpcs.h:505
int selectBaseTriangle(std::vector< int > &base_indices)
Select randomly a triplet of points with large point-to-point distances.
Definition: ia_fpcs.hpp:401