MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / autoSelectFloatXf

Method autoSelectFloatXf

source/MRMesh/MRICP.cpp:62–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62AffineXf3f ICP::autoSelectFloatXf()
63{
64 MR_TIMER;
65
66 auto bestFltXf = flt_.xf;
67 float bestDist = getMeanSqDistToPoint();
68
69 PointAccumulator refAcc;
70 ref_.obj.accumulate( refAcc );
71 const auto refBasisXfs = refAcc.get4BasicXfs();
72
73 PointAccumulator floatAcc;
74 flt_.obj.accumulate( floatAcc );
75 const auto floatBasisXf = floatAcc.getBasicXf();
76
77 // TODO: perform computations in parallel by calling free functions to measure the distance
78 for ( const auto & refBasisXf : refBasisXfs )
79 {
80 AffineXf3f fltXf( AffineXf3d( ref_.xf ) * refBasisXf * floatBasisXf.inverse() );
81 setFloatXf( fltXf );
82 updatePointPairs();
83 const float dist = getMeanSqDistToPoint();
84 if ( dist < bestDist )
85 {
86 bestDist = dist;
87 bestFltXf = fltXf;
88 }
89 }
90 setFloatXf( bestFltXf );
91 return bestFltXf;
92}
93
94void ICP::setFltSamples( const VertBitSet& fltSamples )
95{

Callers

nothing calls this directly

Calls 6

getMeanSqDistToPointFunction · 0.85
updatePointPairsFunction · 0.85
accumulateMethod · 0.80
get4BasicXfsMethod · 0.80
getBasicXfMethod · 0.80
inverseMethod · 0.45

Tested by

no test coverage detected