MeshLib C++ Docs
Loading...
Searching...
No Matches
MRRigidXfRansac.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRExpected.h"
5#include "MRAffineXf3.h"
6#include "MRId.h"
7#include <cstdint>
8#include <vector>
9
10namespace MR
11{
14
15
17{
19 float inlierDistance = 0;
20
22 int maxIterations = 100000;
23
25 float confidence = 0.999f;
26
29 float edgeLengthRatio = 0.9f;
30
32 std::uint32_t seed = 0;
33
37 const VertCoords * overlapSrcPoints = nullptr;
38 const PointCloud * overlapTgtCloud = nullptr;
39
42 const VertCoords * overlapTgtPoints = nullptr;
43 const PointCloud * overlapSrcCloud = nullptr;
44};
45
48[[nodiscard]] MRMESH_API size_t countInliers( const VertCoords & srcPoints, const VertCoords & tgtPoints,
49 const std::vector<VertPair> & matches, const AffineXf3f & xf, float inlierDistance );
50
58[[nodiscard]] MRMESH_API Expected<AffineXf3f> findRigidXfRansac( const VertCoords & srcPoints, const VertCoords & tgtPoints,
59 const std::vector<VertPair> & matches, const RigidXfRansacParams & params, const ProgressCallback & progress = {} );
60
61}
#define MRMESH_API
Definition MRMeshFwd.h:85
size_t countInliers(const VertCoords &srcPoints, const VertCoords &tgtPoints, const std::vector< VertPair > &matches, const AffineXf3f &xf, float inlierDistance)
Expected< AffineXf3f > findRigidXfRansac(const VertCoords &srcPoints, const VertCoords &tgtPoints, const std::vector< VertPair > &matches, const RigidXfRansacParams &params, const ProgressCallback &progress={})
Finds the rigid transformation of source points to target points from given matches,...
std::function< bool(float)> ProgressCallback
Definition MRMeshFwd.h:789
float edgeLengthRatio
Definition MRRigidXfRansac.h:29
tl::expected< T, E > Expected
Definition MRExpected.h:31
std::uint32_t seed
seed of pseudo-random sampling; the result depends on it but not on the number of threads
Definition MRRigidXfRansac.h:32
const PointCloud * overlapSrcCloud
Definition MRRigidXfRansac.h:43
const VertCoords * overlapTgtPoints
Definition MRRigidXfRansac.h:42
float inlierDistance
a match is an inlier of a transformation if it maps the source point within this distance from the ta...
Definition MRRigidXfRansac.h:19
const PointCloud * overlapTgtCloud
Definition MRRigidXfRansac.h:38
int maxIterations
the maximal number of random samples of three matches to test
Definition MRRigidXfRansac.h:22
const VertCoords * overlapSrcPoints
Definition MRRigidXfRansac.h:37
float confidence
the search stops earlier when the probability to have tested at least one sample of three inliers rea...
Definition MRRigidXfRansac.h:25
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8
Definition MRPointCloud.h:17
Definition MRRigidXfRansac.h:17