12 #ifndef AIMS_REGISTRATION_MINIMISATION_D_H 13 #define AIMS_REGISTRATION_MINIMISATION_D_H 32 std::vector<Point3df> ptstest = displacementField.
getpointstest();
33 std::vector<Point3df> ptsref = displacementField.
getpointsref();
34 int size = ptstest.size();
35 unsigned sizekept = unsigned (
double(ptstest.size())*_Pkept );
39 if ((sizekept > 0) && (ptsref.size() > 0))
48 m = *(leastSquareEstimation.
motion());
56 m = *(leastSquareEstimation.
motion());
64 m = *(leastSquareEstimation.
motion());
71 throw std::runtime_error(
"The transformation chosen is not valid !") ;
79 std::multimap<float, Point3df> mt;
80 std::multimap<float, Point3df> mr;
82 std::multimap<float, Point3df>::iterator itt;
83 std::multimap<float, Point3df>::iterator itr;
93 std::vector<Point3df> ptstestkept;
94 std::vector<Point3df> ptsrefkept;
97 for(
int boucle=0; boucle < 3; boucle++)
102 mt.clear(); mr.clear();
103 ptstestkept.clear(); ptsrefkept.clear();
105 for(
int l = 0; l < size; l++)
112 mt.insert(std::pair<float, Point3df>(r2, x) );
113 mr.insert(std::pair<float, Point3df>(r2, y) );
117 for (itt = mt.begin(),itr = mr.begin(), indice = 0 ;indice<sizekept;++itt,++itr,++indice)
119 ptstestkept.push_back( (*itt).second );
120 ptsrefkept.push_back( (*itr).second );
130 m = *(leastSquareEstimation_kept.
motion());
138 m = *(leastSquareEstimation_kept.
motion());
146 m = *(leastSquareEstimation_kept.
motion());
153 throw std::runtime_error(
"The transformation chosen is not valid !") ;
161 cartoDbgMsg( 1,
"Not enough information in reference or test image to estimate transformation" );
std::vector< Point3df > getpointstest()
std::vector< Point3df > getpointsref()
Motion quaternion(DisplacementField< T > &displacementField)
#define cartoDbgMsg(level, message)