gr::Match3pcs< _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions > Class Template Reference
Class for the computation of the 3PCS algorithm. More...
#include <match3pcs.h>
Inheritance diagram for gr::Match3pcs< _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions >:
Collaboration diagram for gr::Match3pcs< _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions >:
Public Member Functions | |
bool | generateCongruents (CongruentBaseType &base, Set &congruent_quads) override |
Find all the congruent set similar to the base in the second 3D model (Q). It could be with a 3 point base or a 4 point base. More... | |
bool | initBase (CongruentBaseType &base) override |
Tries to compute an inital base from P. More... | |
Match3pcs (const OptionsType &options, const Utils::Logger &logger) | |
virtual | ~Match3pcs () |
Public Member Functions inherited from gr::CongruentSetExplorationBase< Traits3pcs< MatchBase< _PointType, _TransformVisitor, PairFilteringOptions, CongruentSetExplorationOptions >::PosMutablePoint >, _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions > | |
Scalar | ComputeTransformation (const InputRange1 &P, const InputRange2 &Q, Eigen::Ref< MatrixType > transformation, const Sampler< _PointType > &sampler, TransformVisitor &v) |
Computes an approximation of the best LCP (directional) from Q to P and the rigid transformation that realizes it. The input sets may or may not contain normal information for any point. More... | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | CongruentSetExplorationBase (const OptionsType &options, const Utils::Logger &logger) |
virtual | ~CongruentSetExplorationBase () |
Public Member Functions inherited from gr::MatchBase< _PointType, _TransformVisitor, PairFilteringOptions..., CongruentSetExplorationOptions > | |
Scalar | ComputeTransformation (const InputRange1 &P, const InputRange2 &Q, Eigen::Ref< MatrixType > transformation, const Sampler< _PointType > &sampler, TransformVisitor &v) |
Computes an approximation of the best LCP (directional) from Q to P and the rigid transformation that realizes it. The input sets may or may not contain normal information for any point. More... | |
const std::vector< PosMutablePoint > & | getFirstSampled () const |
Read access to the sampled clouds used for the registration. More... | |
const std::vector< PosMutablePoint > & | getSecondSampled () const |
Read access to the sampled clouds used for the registration. More... | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | MatchBase (const OptionsType &options, const Utils::Logger &logger) |
virtual | ~MatchBase () |
Additional Inherited Members | |
Static Public Attributes inherited from gr::CongruentSetExplorationBase< Traits3pcs< MatchBase< _PointType, _TransformVisitor, PairFilteringOptions, CongruentSetExplorationOptions >::PosMutablePoint >, _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions > | |
static constexpr Scalar | distance_factor |
static constexpr Scalar | kLargeNumber |
Protected Member Functions inherited from gr::CongruentSetExplorationBase< Traits3pcs< MatchBase< _PointType, _TransformVisitor, PairFilteringOptions, CongruentSetExplorationOptions >::PosMutablePoint >, _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions > | |
const CongruentBaseType & | base3D () const |
bool | Perform_N_steps (int n, Eigen::Ref< MatrixType > transformation, TransformVisitor &v) |
Performs n RANSAC iterations, each one of them containing base selection, finding congruent sets and verification. Returns true if the process can be terminated (the target LCP was obtained or the maximum number of trials has been reached), false otherwise. More... | |
bool | TryCongruentSet (CongruentBaseType &base, Set &set, TransformVisitor &v, size_t &nbCongruent) |
Loop over the set of congruent 4-points and test the compatibility with the input base. More... | |
bool | TryOneBase (TransformVisitor &v) |
Tries one base and finds the best transformation for this base. Returns true if the achieved LCP is greater than terminate_threshold_, else otherwise. More... | |
Scalar | Verify (const Eigen::Ref< const MatrixType > &mat) const |
For each randomly picked base, verifies the computed transformation by computing the number of points that this transformation brings near points in Q. Returns the current LCP. R is the rotation matrix, (tx,ty,tz) is the translation vector and (cx,cy,cz) is the center of transformation.template <class matrixderived>=""> More... | |
Protected Member Functions inherited from gr::MatchBase< _PointType, _TransformVisitor, PairFilteringOptions..., CongruentSetExplorationOptions > | |
bool | ComputeRigidTransformation (const Coordinates &ref, const Coordinates &candidate, const Eigen::Matrix< Scalar, 3, 1 > ¢roid1, Eigen::Matrix< Scalar, 3, 1 > centroid2, Eigen::Ref< MatrixType > transform, Scalar &rms_, bool computeScale) const |
Computes the best rigid transformation between three corresponding pairs. The transformation is characterized by rotation matrix, translation vector and a center about which we rotate. The set of pairs is potentially being updated by the best permutation of the second set. Returns the RMS of the fit. The method is being called with n points but it applies the fit for only 3 after the best permutation is selected in the second set (see bellow). This is done because the solution for planar points is much simpler. The method is the closed-form solution by Horn: people.csail.mit.edu/bkph/papers/Absolute_Orientation.pdf. More... | |
void | init (const InputRange1 &P, const InputRange2 &Q, const Sampler< _PointType > &sampler) |
Initializes the internal state of the Base class. More... | |
virtual void | Initialize () |
Initializes the data structures and needed values before the match computation. This method is called once the internal state of the Base class as been set. More... | |
void | Log (Args...args) const |
Scalar | MeanDistance () const |
Computes the mean distance between points in Q and their nearest neighbor. We need this for normalization of the user delta (See the paper) to the "scale" of the set. More... | |
bool | SelectRandomTriangle (Scalar max_base_diameter, int &base1, int &base2, int &base3) |
Selects a random triangle in the set P (then we add another point to keep the base as planar as possible). We apply a simple heuristic that works in most practical cases. The idea is to accept maximum distance, computed by the estimated overlap, multiplied by the diameter of P, and try to have a triangle with all three edges close to this distance. Wide triangles helps to make the transformation robust while too large triangles makes the probability of having all points in the inliers small so we try to trade-off. More... | |
Protected Attributes inherited from gr::CongruentSetExplorationBase< Traits3pcs< MatchBase< _PointType, _TransformVisitor, PairFilteringOptions, CongruentSetExplorationOptions >::PosMutablePoint >, _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions > | |
CongruentBaseType | base_ |
The points in the base (indices to P). It is being updated in every RANSAC iteration. More... | |
Coordinates | base_3D_ |
The 3D points of the base. More... | |
Scalar | best_LCP_ |
The best LCP (Largest Common Point) fraction so far. More... | |
CongruentBaseType | current_congruent_ |
The current congruent 4 points from Q. Every RANSAC iteration the algorithm examines a set of such congruent 4-points from Q and retains the best from them (the one that realizes the best LCP). More... | |
int | current_trial_ |
Current trial. More... | |
Scalar | max_base_diameter_ |
Maximum base diameter. It is computed automatically from the diameter of P and the estimated overlap and used to limit the distance between the points in the base in P so that the probability to have all points in the base as inliers is increased. More... | |
int | number_of_trials_ |
Number of trials. Every trial picks random base from P. More... | |
Protected Attributes inherited from gr::MatchBase< _PointType, _TransformVisitor, PairFilteringOptions..., CongruentSetExplorationOptions > | |
VectorType | centroid_P_ |
The centroid of P. More... | |
VectorType | centroid_Q_ |
The centroid of Q. More... | |
KdTree< Scalar > | kd_tree_ |
KdTree used to compute the LCP. More... | |
const Utils::Logger & | logger_ |
OptionsType | options_ |
Scalar | P_diameter_ |
The diameter of P. More... | |
Scalar | P_mean_distance_ |
Mean distance between points and their nearest neighbor in the set P. Used to normalize the "delta" which is given in terms of this distance. More... | |
VectorType | qcentroid1_ |
VectorType | qcentroid2_ |
std::mt19937 | randomGenerator_ |
std::vector< PosMutablePoint > | sampled_P_3D_ |
Sampled P (3D coordinates). More... | |
std::vector< PosMutablePoint > | sampled_Q_3D_ |
Sampled Q (3D coordinates). More... | |
Eigen::Matrix< Scalar, 4, 4 > | transform_ |
The transformation matrix by wich we transform Q to P. More... | |
Static Protected Attributes inherited from gr::MatchBase< _PointType, _TransformVisitor, PairFilteringOptions..., CongruentSetExplorationOptions > | |
static constexpr int | kNumberOfDiameterTrials |
Detailed Description
template<typename _PointType, typename _TransformVisitor, typename _PairFilteringFunctor, template< class, class > class PairFilteringOptions>
class gr::Match3pcs< _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions >
Class for the computation of the 3PCS algorithm.
Member Typedef Documentation
template<typename _PointType , typename _TransformVisitor , typename _PairFilteringFunctor , template< class, class > class PairFilteringOptions>
using gr::Match3pcs< _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions >::CongruentBaseType = typename Traits::Base |
template<typename _PointType , typename _TransformVisitor , typename _PairFilteringFunctor , template< class, class > class PairFilteringOptions>
using gr::Match3pcs< _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions >::Coordinates = typename Traits::Coordinates |
template<typename _PointType , typename _TransformVisitor , typename _PairFilteringFunctor , template< class, class > class PairFilteringOptions>
using gr::Match3pcs< _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions >::MatchBaseType = CongruentSetExplorationBase<Traits3pcs<PosMutablePoint>, _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions> |
template<typename _PointType , typename _TransformVisitor , typename _PairFilteringFunctor , template< class, class > class PairFilteringOptions>
using gr::Match3pcs< _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions >::OptionsType = typename MatchBaseType::OptionsType |
template<typename _PointType , typename _TransformVisitor , typename _PairFilteringFunctor , template< class, class > class PairFilteringOptions>
using gr::Match3pcs< _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions >::PairFilteringFunctor = _PairFilteringFunctor |
template<typename _PointType , typename _TransformVisitor , typename _PairFilteringFunctor , template< class, class > class PairFilteringOptions>
using gr::Match3pcs< _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions >::PosMutablePoint = typename MatchBase<_PointType, _TransformVisitor, PairFilteringOptions, CongruentSetExplorationOptions>::PosMutablePoint |
template<typename _PointType , typename _TransformVisitor , typename _PairFilteringFunctor , template< class, class > class PairFilteringOptions>
using gr::Match3pcs< _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions >::Scalar = typename MatchBaseType::Scalar |
template<typename _PointType , typename _TransformVisitor , typename _PairFilteringFunctor , template< class, class > class PairFilteringOptions>
using gr::Match3pcs< _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions >::Set = typename Traits::Set |
template<typename _PointType , typename _TransformVisitor , typename _PairFilteringFunctor , template< class, class > class PairFilteringOptions>
using gr::Match3pcs< _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions >::Traits = Traits3pcs<PosMutablePoint> |
template<typename _PointType , typename _TransformVisitor , typename _PairFilteringFunctor , template< class, class > class PairFilteringOptions>
using gr::Match3pcs< _PointType, _TransformVisitor, _PairFilteringFunctor, PairFilteringOptions >::TransformVisitor = _TransformVisitor |
Constructor & Destructor Documentation
template<typename _PointType , typename _TransformVisitor , typename _PairFilteringFunctor , template< class, class > class PairFilteringOptions>
gr::Match3pcs< PointType, TransformVisitor, PairFilteringFunctor, PFO >::Match3pcs | ( | const OptionsType & | options, |
const Utils::Logger & | logger | ||
) |
Here is the call graph for this function:
template<typename PointType , typename TransformVisitor , typename PairFilteringFunctor , template< class, class > class PFO>
|
virtual |
Member Function Documentation
template<typename PointType , typename TransformVisitor , typename PairFilteringFunctor , template< class, class > class PFO>
|
overridevirtual |
Find all the congruent set similar to the base in the second 3D model (Q). It could be with a 3 point base or a 4 point base.
- Parameters
-
base use to find the similar points congruent in Q. congruent_set a set of all point congruent found in Q.
Here is the call graph for this function:
template<typename PointType , typename TransformVisitor , typename PairFilteringFunctor , template< class, class > class PFO>
|
overridevirtual |
Tries to compute an inital base from P.
- Parameters
-
[out] base The base, if found. Initial value is not used. Modified as the computed base if the return value is true.
- Returns
- true if a base is found an initialized, false otherwise
Here is the call graph for this function:
The documentation for this class was generated from the following files:
- /home/travis/build/STORM-IRIT/OpenGR/src/gr/algorithms/match3pcs.h
- /home/travis/build/STORM-IRIT/OpenGR/src/gr/algorithms/match3pcs.hpp