3#include "../_cexports/c_match_3d.h"
5#include "../affine_matrix_3d.hpp"
6#include "../global.hpp"
7#include "../point_cloud.hpp"
43 class MatchingParameters;
47 const MatchingParameters ¶meters);
101 double minImprovement,
double correspondenceThreshold,
double convergenceRadius,
bool prealign,
107 params_.major =
static_cast<Cvb::CExports::cvbint32_t
>(0);
108 params_.minor =
static_cast<Cvb::CExports::cvbint32_t
>(1);
135 maxModelPoints_ =
static_cast<std::int64_t>(maxModelPoints);
155 maxScenePoints_ =
static_cast<std::int64_t>(maxScenePoints);
165 return static_cast<int>(params_.MaxIterations);
175 params_.MaxIterations =
static_cast<Cvb::CExports::cvbval_t
>(value);
186 return params_.Tolerance;
196 params_.Tolerance = value;
208 return params_.MinImprovement;
218 params_.MinImprovement = value;
230 return params_.CorrespondenceThreshold;
242 params_.CorrespondenceThreshold = value;
252 return params_.ConvergenceRadius;
263 params_.ConvergenceRadius = value;
273 return static_cast<bool>(params_.Prealign);
283 params_.Prealign =
static_cast<Cvb::CExports::cvbbool_t
>(value);
303 params_.CorrespondenceMethod =
static_cast<Cvb::CExports::CVM3DCorrespondenceType
>(value);
310 CExports::CVM3DMatchParameters params_ = CExports::CVM3DDefaultParameters;
317 class MatchingResult final
341 return transformation_;
351 return numIterations_;
357 double rmsDistance_ = std::numeric_limits<
double>::quiet_NaN();
358 CExports::cvbval_t numIterations_ = 0;
317 class MatchingResult final {
…};
379 Internal::DoResCall([&]() {
380 return CVB_CALL_CAPI(CVM3DMatchPointCloudsAdvanced(
381 scene.Handle(), parameters.maxScenePoints_, model.Handle(), parameters.maxModelPoints_, parameters.params_,
382 result.rmsDistance_, result.numIterations_,
383 *
reinterpret_cast<CExports::CVC3DTransformation *
>(&result.transformation_)));
398 return Internal::DoResCallValueOut<double>([&](
double &value) {
399 return CVB_CALL_CAPI(CVM3DRmsDistanceOfPointClouds(scene.
Handle(), model.
Handle(), value));
Affine transformation for 3D containing a transformation matrix and a translation vector.
Definition affine_matrix_3d.hpp:140
A parameter set for matching and down sampling point clouds.
Definition match_3d.hpp:54
void SetPrealign(bool value) noexcept
Set true, if pre-alignment of point clouds should be done using the center of gravity.
Definition match_3d.hpp:281
std::size_t MaxScenePoints() const noexcept
Gets maximum number of scene points to use.
Definition match_3d.hpp:143
void SetCorrespondenceThreshold(double value) noexcept
Sets special metric used for consensus ICP.
Definition match_3d.hpp:240
double Tolerance() const noexcept
Gets tolerance for stopping criteria.
Definition match_3d.hpp:184
CorrespondenceType CorrespondenceMethod() const noexcept
Gets correspondence type used.
Definition match_3d.hpp:291
void SetMaxIterations(int value) noexcept
Sets maximum number of iterations to execute.
Definition match_3d.hpp:173
double ConvergenceRadius() const noexcept
Gets convergence radius to define when two points are considered as a converged match.
Definition match_3d.hpp:250
MatchingParameters(std::size_t maxScenePoints, std::size_t maxModelPoints) noexcept
Create a parameter set to control the matching algorithm with default values.
Definition match_3d.hpp:75
friend MatchingResult IcpMatch(const PointCloud &model, const PointCloud &scene, const MatchingParameters ¶meters)
This function matches two point clouds.
Definition match_3d.hpp:374
void SetTolerance(double value) noexcept
Sets tolerance for stopping criteria.
Definition match_3d.hpp:194
void SetCorrespondenceMethod(CorrespondenceType value) noexcept
Sets correspondence type used.
Definition match_3d.hpp:301
MatchingParameters() noexcept
Create a parameter set to control the matching algorithm with default values.
Definition match_3d.hpp:65
void SetMaxScenePoints(std::size_t maxScenePoints) noexcept
Sets maximum number of scene points to use.
Definition match_3d.hpp:153
std::size_t MaxModelPoints() const noexcept
Gets maximum number of model points to use.
Definition match_3d.hpp:123
void SetConvergenceRadius(double value) noexcept
Sets convergence radius to define when two points are considered as a converged match.
Definition match_3d.hpp:261
double MinImprovement() const noexcept
Gets threshold for minimum improvement for early stopping criteria.
Definition match_3d.hpp:206
bool Prealign() const noexcept
Gets true, if pre-alignment of point clouds should be done using the center of gravity.
Definition match_3d.hpp:271
MatchingParameters(std::size_t maxScenePoints, std::size_t maxModelPoints, int maxIterations, double tolerance, double minImprovement, double correspondenceThreshold, double convergenceRadius, bool prealign, CorrespondenceType correspondenceMethod) noexcept
Create a parameter set to control the Match3d ICP algorithm.
Definition match_3d.hpp:100
void SetMinImprovement(double value) noexcept
Sets threshold for minimum improvement for early stopping criteria.
Definition match_3d.hpp:216
int MaxIterations() const noexcept
Gets maximum number of iterations to execute.
Definition match_3d.hpp:163
void SetMaxModelPoints(std::size_t maxModelPoints) noexcept
Sets maximum number of model points to use.
Definition match_3d.hpp:133
double CorrespondenceThreshold() const noexcept
Gets special metric used for consensus ICP.
Definition match_3d.hpp:228
Results of a matching and down sampling operation.
Definition match_3d.hpp:318
AffineMatrix3D Transformation() const noexcept
Get the affine transformation (rotation matrix and translation vector), which maps the scene to the m...
Definition match_3d.hpp:339
int NumIterations() const noexcept
Get number of iterations needed.
Definition match_3d.hpp:349
friend MatchingResult IcpMatch(const PointCloud &scene, const PointCloud &model, const MatchingParameters ¶meters)
This function matches two point clouds.
Definition match_3d.hpp:374
double DistanceRMS() const noexcept
Get the final root mean square of distances between model and scene.
Definition match_3d.hpp:328
A point cloud object.
Definition decl_point_cloud.hpp:48
void * Handle() const noexcept
Returns C-API style handle to Node Object.
Definition decl_point_cloud.hpp:773
Namespace for Match3D ICP.
Definition match_3d.hpp:27
MatchingResult IcpMatch(const PointCloud &scene, const PointCloud &model, const MatchingParameters ¶meters)
This function matches two point clouds.
Definition match_3d.hpp:374
CorrespondenceType
Correspondence type used for algorithm in Cvb::Match3D::IcpMatch.
Definition match_3d.hpp:31
@ ClassicICP
Definition match_3d.hpp:35
@ ConsensusICP
Definition match_3d.hpp:40
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17