23 virtual size_t size()
const override {
return vec.size(); }
24 std::vector<ICPGroupPair>
vec;
31 float cosThreshold,
float distThresholdSq,
bool mutualClosest );
142 PairsPerLayer pairsGridPerLayer_;
145 ICPExitType resultType_{ ICPExitType::NotStarted };
147 std::function<void(
int )> perIterationCb_;
149 std::unique_ptr<IICPTreeIndexer> cascadeIndexer_;
152 void setupLayers_( MultiwayICPSamplingParameters::CascadeMode mode );
156 bool reservePairsLayer0_( Vector<VertBitSet, ObjId>&& samples, ProgressCallback cb );
158 using LayerSamples = Vector<Vector<MultiObjsSamples, ICPElementId>, ICPLayer>;
159 std::optional<LayerSamples> resampleUpperLayers_( ProgressCallback cb );
160 bool reserveUpperLayerPairs_( LayerSamples&& samples, ProgressCallback cb );
163 bool updateLayerPairs_( ICPLayer l, ProgressCallback cb = {} );
165 void deactivateFarDistPairs_( ICPLayer l );
167 float samplingSize_{ 0.0f };
177 int maxGroupSize_{ 64 };
179 bool doIteration_(
bool p2pl );
182 bool multiwayIter_(
bool p2pl =
true );
183 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:38
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:83
MRMESH_API std::string getStatusInfo() const
returns status info string
const ICPProperties & getParams() const
Definition MRMesh/MRMultiwayICP.h:106
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:135
MRMESH_API Vector< AffineXf3f, ObjId > calculateTransformations(ProgressCallback cb={})
void devEnableIndependentEquationsMode(bool on)
Definition MRMesh/MRMultiwayICP.h:128
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:139
void setPerIterationCallback(std::function< void(int inter)> callback)
sets callback that will be called for each iteration
Definition MRMesh/MRMultiwayICP.h:123
bool devIndependentEquationsModeEnabled() const
Definition MRMesh/MRMultiwayICP.h:127
void setParams(const ICPProperties &prop)
tune algorithm params before run calculateTransformations()
Definition MRMesh/MRMultiwayICP.h:105
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:127
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:576
Definition MRCameraOrientationPlugin.h:8
std::function< void(const Vector3f &p, MeshOrPoints::ProjectionResult &res, ObjId &resId)> ICPGroupProjector
Definition MRMesh/MRMultiwayICP.h:27
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
virtual size_t size() const override
Definition MRMesh/MRMultiwayICP.h:23
std::vector< ICPGroupPair > vec
Definition MRMesh/MRMultiwayICP.h:24
virtual ICPPairData & operator[](size_t idx) override
Definition MRMesh/MRMultiwayICP.h:22
Definition MRMesh/MRICP.h:16
Definition MRMesh/MRICP.h:121
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:61
CascadeMode
Definition MRMesh/MRMultiwayICP.h:70
@ 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:76
int maxGroupSize
Definition MRMesh/MRMultiwayICP.h:67
float samplingVoxelSize
sampling size of each object
Definition MRMesh/MRMultiwayICP.h:63
enum MR::MultiwayICPSamplingParameters::CascadeMode AABBTreeBased
Definition MRMesh/MRGridSampling.h:37