23 std::vector<ICPGroupPair>
vec;
30 float cosThreshold,
float distThresholdSq,
bool mutualClosest );
141 PairsPerLayer pairsGridPerLayer_;
144 ICPExitType resultType_{ ICPExitType::NotStarted };
146 std::function<void(
int )> perIterationCb_;
148 std::unique_ptr<IICPTreeIndexer> cascadeIndexer_;
155 bool reservePairsLayer0_( Vector<VertBitSet, ObjId>&& samples, ProgressCallback cb );
157 using LayerSamples = Vector<Vector<MultiObjsSamples, ICPElementId>, ICPLayer>;
158 std::optional<LayerSamples> resampleUpperLayers_( ProgressCallback cb );
159 bool reserveUpperLayerPairs_( LayerSamples&& samples, ProgressCallback cb );
162 bool updateLayerPairs_( ICPLayer l, ProgressCallback cb = {} );
164 void deactivateFarDistPairs_( ICPLayer l );
166 float samplingSize_{ 0.0f };
176 int maxGroupSize_{ 64 };
178 bool doIteration_(
bool p2pl );
181 bool multiwayIter_(
bool p2pl =
true );
182 bool cascadeIter_(
bool p2pl =
true );
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
#define MRMESH_CLASS
Definition MRMesh/MRMeshFwd.h:50
structure to find leafs and groups of each in cascade mode
Definition MRMesh/MRMultiwayICP.h:37
virtual size_t getNumElements(ICPLayer l) const =0
virtual ICPElementBitSet getElementNodes(ICPLayer l, ICPElementId eId) const =0
virtual bool fromSameNode(ICPLayer l, ICPElementId eI, ICPElementId eJ) const =0
returns true if eI and eJ are from same node
virtual size_t getNumLayers() const =0
virtual ~IICPTreeIndexer()=default
virtual ObjBitSet getElementLeaves(ICPLayer l, ICPElementId eId) const =0
returns bitset of leaves of given node
Definition MRMesh/MRId.h:13
Definition MRMesh/MRMultiwayICP.h:82
MRMESH_API std::string getStatusInfo() const
returns status info string
const ICPProperties & getParams() const
Definition MRMesh/MRMultiwayICP.h:105
MRMESH_API size_t getNumActivePairs() const
computes the number of active point pairs
MRMESH_API Vector< AffineXf3f, ObjId > calculateTransformationsFixFirst(ProgressCallback cb={})
const PairsPerLayer & getPairsPerLayer() const
returns all pairs of all layers
Definition MRMesh/MRMultiwayICP.h:134
MRMESH_API Vector< AffineXf3f, ObjId > calculateTransformations(ProgressCallback cb={})
void devEnableIndependentEquationsMode(bool on)
Definition MRMesh/MRMultiwayICP.h:127
MRMESH_API MultiwayICP(const ICPObjects &objects, const MultiwayICPSamplingParameters &samplingParams)
MRMESH_API size_t getNumSamples() const
computes the number of samples able to form pairs
MRMESH_API float getMeanSqDistToPlane(double *value=nullptr) const
MRMESH_API bool updateAllPointPairs(ProgressCallback cb={})
MRMESH_API float getMeanSqDistToPoint(double *value=nullptr) const
const IICPTreeIndexer * getCascadeIndexer() const
Definition MRMesh/MRMultiwayICP.h:138
void setPerIterationCallback(std::function< void(int inter)> callback)
sets callback that will be called for each iteration
Definition MRMesh/MRMultiwayICP.h:122
bool devIndependentEquationsModeEnabled() const
Definition MRMesh/MRMultiwayICP.h:126
void setParams(const ICPProperties &prop)
tune algorithm params before run calculateTransformations()
Definition MRMesh/MRMultiwayICP.h:104
MRMESH_API bool resamplePoints(const MultiwayICPSamplingParameters &samplingParams)
select pairs with origin samples on all objects
container of bits representing specific indices (faces, verts or edges)
Definition MRMesh/MRBitSet.h:116
represents a 3-dimentional float-typed vector
Definition MRDotNet/MRVector3.h:8
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:571
Definition MRCameraOrientationPlugin.h:8
std::function< void(const Vector3f &p, MeshOrPoints::ProjectionResult &res, ObjId &resId)> ICPGroupProjector
Definition MRMesh/MRMultiwayICP.h:26
MRMESH_API void updateGroupPairs(ICPGroupPairs &pairs, const ICPObjects &objs, ICPGroupProjector srcProjector, ICPGroupProjector tgtProjector, float cosThreshold, float distThresholdSq, bool mutualClosest)
in each pair updates the target data and performs basic filtering (activation)
ICPExitType
Definition MRICPEnums.h:25
int ICPLayer
Definition MRMesh/MRMultiwayICP.h:10
Definition MRMesh/MRMultiwayICP.h:15
ObjVertId tgtClosestId
Definition MRMesh/MRMultiwayICP.h:17
ObjVertId srcId
Definition MRMesh/MRMultiwayICP.h:16
Definition MRMesh/MRMultiwayICP.h:20
virtual const ICPPairData & operator[](size_t idx) const override
Definition MRMesh/MRMultiwayICP.h:21
std::vector< ICPGroupPair > vec
Definition MRMesh/MRMultiwayICP.h:23
virtual ICPPairData & operator[](size_t idx) override
Definition MRMesh/MRMultiwayICP.h:22
Definition MRMesh/MRICP.h:16
Definition MRMesh/MRICP.h:119
Simple interface for pairs holder.
Definition MRMesh/MRICP.h:59
Definition MRMesh/MRMeshOrPoints.h:64
Parameters that are used for sampling of the MultiwayICP objects.
Definition MRMesh/MRMultiwayICP.h:60
CascadeMode
Definition MRMesh/MRMultiwayICP.h:69
@ AABBTreeBased
separates objects on groups based on their index in ICPObjects (good if all objects about the size of...
ProgressCallback cb
callback for progress reports
Definition MRMesh/MRMultiwayICP.h:75
int maxGroupSize
Definition MRMesh/MRMultiwayICP.h:66
float samplingVoxelSize
sampling size of each object
Definition MRMesh/MRMultiwayICP.h:62
enum MR::MultiwayICPSamplingParameters::CascadeMode AABBTreeBased
Definition MRMesh/MRGridSampling.h:36
CascadeMode
Definition MRDotNet/MRMultiwayICP.h:18