diff --git a/vcg/math/point_matching.h b/vcg/math/point_matching.h index 54b4571a..5ee4e4ec 100644 --- a/vcg/math/point_matching.h +++ b/vcg/math/point_matching.h @@ -42,6 +42,43 @@ public: typedef Quaternion Quaternionx; +/* +Compute a similarity matching (rigid + uniform scaling) +simply create a temporary point set with the correct scaling factor + + +*/ +static bool ComputeSimilarityMatchMatrix( Matrix44x &res, + std::vector &Pfix, // vertici corrispondenti su fix (rossi) + std::vector &Pmov) // normali scelti su mov (verdi) +{ + Quaternionx qtmp; + Point3x tr; + + std::vector Pnew(Pmov.size()); + + ScalarType scalingFactor=0; + + for(size_t i=0;i<( Pmov.size()-1);++i) + { + scalingFactor += Distance(Pmov[i],Pmov[i+1])/ Distance(Pfix[i],Pfix[i+1]); + qDebug("Scaling Factor is %f",scalingFactor/(i+1)); + } + scalingFactor/=(Pmov.size()-1); + + for(size_t i=0;i &Pfix, // vertici corrispondenti su fix (rossi)