3#include "../_cexports/c_match_3d.h"
5#include "../affine_matrix_3d.hpp"
6#include "../global.hpp"
7#include "../point_cloud.hpp"
42class MatchingParameters;
103 int maxIterations,
double tolerance,
104 double minImprovement,
double correspondenceThreshold,
105 double convergenceRadius,
bool prealign,
CorrespondenceType correspondenceMethod)
noexcept
110 params_.major =
static_cast<Cvb::CExports::cvbint32_t
>(0);
111 params_.minor =
static_cast<Cvb::CExports::cvbint32_t
>(1);
138 maxModelPoints_ =
static_cast<std::int64_t>(maxModelPoints);
158 maxScenePoints_ =
static_cast<std::int64_t>(maxScenePoints);
168 return static_cast<int>(params_.MaxIterations);
178 params_.MaxIterations =
static_cast<Cvb::CExports::cvbval_t
>(value);
189 return params_.Tolerance;
199 params_.Tolerance = value;
211 return params_.MinImprovement;
221 params_.MinImprovement = value;
233 return params_.CorrespondenceThreshold;
245 params_.CorrespondenceThreshold = value;
255 return params_.ConvergenceRadius;
266 params_.ConvergenceRadius = value;
276 return static_cast<bool>(params_.Prealign);
286 params_.Prealign =
static_cast<Cvb::CExports::cvbbool_t
>(value);
306 params_.CorrespondenceMethod =
static_cast<Cvb::CExports::CVM3DCorrespondenceType
>(value);
313 CExports::CVM3DMatchParameters params_ = CExports::CVM3DDefaultParameters;
343 return transformation_;
353 return numIterations_;
359 double rmsDistance_ = std::numeric_limits<
double>::quiet_NaN();
360 CExports::cvbval_t numIterations_ = 0;
380 Internal::DoResCall([&]() {
381 return CVB_CALL_CAPI(
382 CVM3DMatchPointCloudsAdvanced(
384 parameters.maxScenePoints_,
386 parameters.maxModelPoints_,
389 result.numIterations_,
390 *
reinterpret_cast<CExports::CVC3DTransformation*
>(&result.transformation_)));
405 return Internal::DoResCallValueOut<double>([&](
double &value) {
406 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:97
A parameter set for matching and down sampling point clouds.
Definition: match_3d.hpp:53
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:284
std::size_t MaxScenePoints() const noexcept
Gets maximum number of scene points to use.
Definition: match_3d.hpp:146
void SetCorrespondenceThreshold(double value) noexcept
Sets special metric used for consensus ICP.
Definition: match_3d.hpp:243
double Tolerance() const noexcept
Gets tolerance for stopping criteria.
Definition: match_3d.hpp:187
CorrespondenceType CorrespondenceMethod() const noexcept
Gets correspondence type used.
Definition: match_3d.hpp:294
void SetMaxIterations(int value) noexcept
Sets maximum number of iterations to execute.
Definition: match_3d.hpp:176
double ConvergenceRadius() const noexcept
Gets convergence radius to define when two points are considered as a converged match.
Definition: match_3d.hpp:253
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:76
friend MatchingResult IcpMatch(const PointCloud &model, const PointCloud &scene, const MatchingParameters ¶meters)
This function matches two point clouds.
Definition: match_3d.hpp:376
void SetTolerance(double value) noexcept
Sets tolerance for stopping criteria.
Definition: match_3d.hpp:197
void SetCorrespondenceMethod(CorrespondenceType value) noexcept
Sets correspondence type used.
Definition: match_3d.hpp:304
MatchingParameters() noexcept
Create a parameter set to control the matching algorithm with default values.
Definition: match_3d.hpp:64
void SetMaxScenePoints(std::size_t maxScenePoints) noexcept
Sets maximum number of scene points to use.
Definition: match_3d.hpp:156
std::size_t MaxModelPoints() const noexcept
Gets maximum number of model points to use.
Definition: match_3d.hpp:126
void SetConvergenceRadius(double value) noexcept
Sets convergence radius to define when two points are considered as a converged match.
Definition: match_3d.hpp:264
double MinImprovement() const noexcept
Gets threshold for minimum improvement for early stopping criteria.
Definition: match_3d.hpp:209
bool Prealign() const noexcept
Gets true, if pre-alignment of point clouds should be done using the center of gravity.
Definition: match_3d.hpp:274
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:101
void SetMinImprovement(double value) noexcept
Sets threshold for minimum improvement for early stopping criteria.
Definition: match_3d.hpp:219
int MaxIterations() const noexcept
Gets maximum number of iterations to execute.
Definition: match_3d.hpp:166
void SetMaxModelPoints(std::size_t maxModelPoints) noexcept
Sets maximum number of model points to use.
Definition: match_3d.hpp:136
double CorrespondenceThreshold() const noexcept
Gets special metric used for consensus ICP.
Definition: match_3d.hpp:231
Results of a matching and down sampling operation.
Definition: match_3d.hpp:321
AffineMatrix3D Transformation() const noexcept
Get the affine transformation (rotation matrix and translation vector), which maps the scene to the m...
Definition: match_3d.hpp:341
int NumIterations() const noexcept
Get number of iterations needed.
Definition: match_3d.hpp:351
friend MatchingResult IcpMatch(const PointCloud &scene, const PointCloud &model, const MatchingParameters ¶meters)
This function matches two point clouds.
Definition: match_3d.hpp:376
double DistanceRMS() const noexcept
Get the final root mean square of distances between model and scene.
Definition: match_3d.hpp:331
A point cloud object.
Definition: decl_point_cloud.hpp:49
void * Handle() const noexcept
Returns C-API style handle to Node Object.
Definition: decl_point_cloud.hpp:768
MatchingResult IcpMatch(const PointCloud &scene, const PointCloud &model, const MatchingParameters ¶meters)
This function matches two point clouds.
Definition: match_3d.hpp:376
CorrespondenceType
Correspondence type used for algorithm in Cvb::Match3D::IcpMatch.
Definition: match_3d.hpp:30
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24