MeshLib C++ Docs
Loading...
Searching...
No Matches
Aligning Transform

Classes

class  MR::MultiwayAligningTransform
class  MR::PointToPlaneAligningTransform
class  MR::PointToPointAligningTransform

Functions

Expected< GlobalRegistrationResult > MR::globalRegistration (const Vector< MeshOrPointsXf, ObjId > &objects, const GlobalRegistrationParams &params={}, const ProgressCallback &progress={})
 Finds the transformations registering given objects (meshes or point clouds with normals) as one or several groups without any initial alignment: each pair of objects is aligned by matching FPFH descriptors of their samples (see computeFPFH), finding the rigid transformation by findRigidXfRansac with overlap scoring and refining it by ICP; then the objects are linked by a spanning tree of the pairs with the largest overlap (at least params.minOverlap)
size_t MR::countInliers (const VertCoords &srcPoints, const VertCoords &tgtPoints, const std::vector< VertPair > &matches, const AffineXf3f &xf, float inlierDistance)
Expected< AffineXf3f > MR::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, many of which can be wrong: tests the transformations through random samples of three matches and keeps the one with most inliers (or the largest overlap, see RigidXfRansacParams::overlapSrcPoints), then refines it by least squares fitting on all its inlier matches.

Detailed Description

Function Documentation

◆ countInliers()

size_t MR::countInliers ( const VertCoords & srcPoints,
const VertCoords & tgtPoints,
const std::vector< VertPair > & matches,
const AffineXf3f & xf,
float inlierDistance )
nodiscard

#include <MRMesh/MRRigidXfRansac.h>

counts the matches (source point, target point) that given transformation maps within given distance from their target points

◆ findRigidXfRansac()

Expected< AffineXf3f > MR::findRigidXfRansac ( const VertCoords & srcPoints,
const VertCoords & tgtPoints,
const std::vector< VertPair > & matches,
const RigidXfRansacParams & params,
const ProgressCallback & progress = {} )
nodiscard

#include <MRMesh/MRRigidXfRansac.h>

Finds the rigid transformation of source points to target points from given matches, many of which can be wrong: tests the transformations through random samples of three matches and keeps the one with most inliers (or the largest overlap, see RigidXfRansacParams::overlapSrcPoints), then refines it by least squares fitting on all its inlier matches.

Parameters
matches(source point, target point) pairs, e.g. from findFPFHMatches(...)
Returns
rigid transformation of source points to target points, or error if there are less than three matches, no consistent sample was found or progress returned false

◆ globalRegistration()

Expected< GlobalRegistrationResult > MR::globalRegistration ( const Vector< MeshOrPointsXf, ObjId > & objects,
const GlobalRegistrationParams & params = {},
const ProgressCallback & progress = {} )
nodiscard

#include <MRMesh/MRGlobalRegistration.h>

Finds the transformations registering given objects (meshes or point clouds with normals) as one or several groups without any initial alignment: each pair of objects is aligned by matching FPFH descriptors of their samples (see computeFPFH), finding the rigid transformation by findRigidXfRansac with overlap scoring and refining it by ICP; then the objects are linked by a spanning tree of the pairs with the largest overlap (at least params.minOverlap)