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