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 );
57 if ((sizekept > 0) && (ptsref.size() > 0))
66 m = *(leastSquareEstimation.
motion());
74 m = *(leastSquareEstimation.
motion());
82 m = *(leastSquareEstimation.
motion());
89 throw std::runtime_error(
"The transformation chosen is not valid !") ;
97 std::multimap<float, Point3df> mt;
98 std::multimap<float, Point3df> mr;
100 std::multimap<float, Point3df>::iterator itt;
101 std::multimap<float, Point3df>::iterator itr;
111 std::vector<Point3df> ptstestkept;
112 std::vector<Point3df> ptsrefkept;
115 for(
int boucle=0; boucle < 3; boucle++)
120 mt.clear(); mr.clear();
121 ptstestkept.clear(); ptsrefkept.clear();
123 for(
int l = 0; l < size; l++)
130 mt.insert(std::pair<float, Point3df>(r2, x) );
131 mr.insert(std::pair<float, Point3df>(r2, y) );
135 for (itt = mt.begin(),itr = mr.begin(), indice = 0 ;indice<sizekept;++itt,++itr,++indice)
137 ptstestkept.push_back( (*itt).second );
138 ptsrefkept.push_back( (*itr).second );
148 m = *(leastSquareEstimation_kept.
motion());
156 m = *(leastSquareEstimation_kept.
motion());
164 m = *(leastSquareEstimation_kept.
motion());
171 throw std::runtime_error(
"The transformation chosen is not valid !") ;
179 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)