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