Point Cloud Library (PCL)
1.11.1-dev
|
41 #include <pcl/registration/matching_candidate.h>
42 #include <pcl/registration/registration.h>
51 template <
typename Po
intT>
64 template <
typename Po
intT>
67 const std::vector<int>& indices,
71 namespace registration {
77 template <
typename PointSource,
80 typename Scalar =
float>
85 shared_ptr<FPCSInitialAlignment<PointSource, PointTarget, NormalT, Scalar>>;
87 shared_ptr<const FPCSInitialAlignment<PointSource, PointTarget, NormalT, Scalar>>;
98 using NormalsConstPtr =
typename Normals::ConstPtr;
140 inline NormalsConstPtr
156 inline NormalsConstPtr
307 const Eigen::Matrix4f& guess)
override;
321 selectBase(std::vector<int>& base_indices,
float (&ratio)[2]);
342 setupBase(std::vector<int>& base_indices,
float (&ratio)[2]);
379 std::vector<std::vector<int>>& matches,
382 const float (&ratio)[2]);
394 checkBaseMatch(
const std::vector<int>& match_indices,
const float (&ds)[4]);
408 std::vector<std::vector<int>>& matches,
420 std::vector<int>& match_indices,
438 const std::vector<int>& match_indices,
440 Eigen::Matrix4f& transformation);
462 finalCompute(
const std::vector<MatchingCandidates>& candidates);
560 #include <pcl/registration/impl/ia_fpcs.hpp>
NormalsConstPtr getSourceNormals() const
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.
float coincidation_limit_
Maximal distance between coinciding intersection points to find valid matches.
void setNumberOfThreads(int nr_threads)
Set the number of used threads if OpenMP is activated.
void setNumberOfSamples(int nr_samples)
Set the number of source samples to use during alignment.
int selectBaseTriangle(std::vector< int > &base_indices)
Select randomly a triplet of points with large point-to-point distances.
A point structure representing normal coordinates and the surface curvature estimate.
float getApproxOverlap() const
shared_ptr< Indices > IndicesPtr
NormalsConstPtr source_normals_
Normals of source point cloud.
Registration represents the base registration class for general purpose, ICP-like methods.
float getMaxNormalDifference() const
FPCSInitialAlignment computes corresponding four point congruent sets as described in: "4-points cong...
void setMaxComputationTime(int max_runtime)
Set the maximum computation time in seconds.
FPCSInitialAlignment()
Constructor.
int nr_threads_
Number of threads for parallelization (standard = 1).
float diameter_
Estimated diamter of the target point cloud.
float fitness_score_
Resulting fitness score of the best match.
float score_threshold_
Score threshold to stop calculation with success.
NormalsConstPtr getTargetNormals() const
int selectBase(std::vector< int > &base_indices, float(&ratio)[2])
Select an approximately coplanar set of four points from the source cloud.
float max_inlier_dist_sqr_
Maximal squared point distance between source and target points to count as inlier.
int getNumberOfThreads() const
void computeTransformation(PointCloudSource &output, const Eigen::Matrix4f &guess) override
Rigid transformation computation method.
virtual int validateTransformation(Eigen::Matrix4f &transformation, float &fitness_score)
Validate the transformation by calculating the number of inliers after transforming the source cloud.
IndicesPtr getTargetIndices() const
float max_mse_
Maximal mean squared errors of a transformation calculated from a candidate match.
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...
float delta_
Delta value of 4pcs algorithm (standard = 1.0).
void setTargetNormals(const NormalsConstPtr &target_normals)
Provide a pointer to the normals of the target point cloud.
void setApproxOverlap(float approx_overlap)
Set the approximate overlap between source and target.
int nr_samples_
The number of points to uniformly sample the source point cloud.
void setSourceNormals(const NormalsConstPtr &source_normals)
Provide a pointer to the normals of the source point cloud.
void setScoreThreshold(float score_threshold)
Set the scoring threshold used for early finishing the method.
shared_ptr< Registration< PointSource, PointTarget, float > > Ptr
shared_ptr< KdTree< PointT, Tree > > Ptr
typename PointCloudSource::Ptr PointCloudSourcePtr
pcl::IndicesPtr source_indices_
A pointer to the vector of source point indices to use after sampling.
pcl::IndicesPtr target_indices_
A pointer to the vector of target point indices to use after sampling.
int getMaxComputationTime() const
std::vector< MatchingCandidate, Eigen::aligned_allocator< MatchingCandidate > > MatchingCandidates
float getScoreThreshold() const
float max_pair_diff_
Maximal difference between corresponding point pairs in source and target.
float max_edge_diff_
Maximal difference between the length of the base edges and valid match edges.
void setMaxNormalDifference(float max_norm_diff)
Set the maximum normal difference between valid point correspondences in degree.
bool normalize_delta_
Normalize delta flag.
const float small_error_
Definition of a small error.
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.
search::KdTree is a wrapper class which inherits the pcl::KdTree class for performing search function...
bool use_normals_
Use normals flag.
virtual void handleMatches(const std::vector< int > &base_indices, std::vector< std::vector< int >> &matches, MatchingCandidates &candidates)
Method to handle current candidate matches.
virtual void finalCompute(const std::vector< MatchingCandidates > &candidates)
Final computation of best match out of vector of best matches.
pcl::PointCloud< PointSource > PointCloudSource
float max_base_diameter_sqr_
Estimated squared metric overlap between source and target.
typename KdTreeReciprocal::Ptr KdTreeReciprocalPtr
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...
shared_ptr< PointCloud< PointSource > > Ptr
float max_norm_diff_
Maximum normal difference of corresponding point pairs in degrees (standard = 90).
float segmentToSegmentDist(const std::vector< int > &base_indices, float(&ratio)[2])
Calculate intersection ratios and segment to segment distances of base diagonals.
void setTargetIndices(const IndicesPtr &target_indices)
Provide a pointer to the vector of target indices.
shared_ptr< const PointCloud< PointT > > ConstPtr
void setDelta(float delta, bool normalize=false)
Set the constant factor delta which weights the internally calculated parameters.
~FPCSInitialAlignment()
Destructor.
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
float approx_overlap_
Estimated overlap between source and target (standard = 0.5).
int getNumberOfSamples() const
Container for matching candidate consisting of.
NormalsConstPtr target_normals_
Normals of target point cloud.
typename VectorType::iterator iterator
virtual int bruteForceCorrespondences(int idx1, int idx2, pcl::Correspondences &pairs)
Search for corresponding point pairs given the distance between two base points.
virtual bool initCompute()
Internal computation initialization.
float getFitnessScore() const
shared_ptr< const Registration< PointSource, PointTarget, float > > ConstPtr
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...
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...
int max_runtime_
Maximum allowed computation time in seconds (standard = 0 => ~unlimited).