this is a class using RANSAC to compute a regression plane with SVD , SVD
- Author
- MIP
#include <iostream>
#include <iomanip>
#include <Base/Math/Math.hh>
#include <MathAlgo/SVD.hh>
using namespace std;
using namespace BIAS;
const int nr_of_points = 7;
A[0][0] = -1; A[0][1] = 0; A[0][2] = 0; A[0][3] = 1;
A[1][0] = -1; A[1][1] = 1; A[1][2] = 0; A[1][3] = 1;
A[2][0] = -1; A[2][1] = 0; A[2][2] = 1; A[2][3] = 1;
A[3][0] = -1; A[3][1] = 1; A[3][2] = 1; A[3][3] = 1;
A[4][0] = -1; A[4][1] = 0.5; A[4][2] = 0.5; A[4][3] = 1;
A[5][0] = -1; A[5][1] = 0.51; A[5][2] = 0.59; A[5][3] = 0.9;
A[6][0] = -1; A[6][1] = 3.49; A[6][2] = 0.55; A[6][3] = 1.1;
}
cout << "calc_Regressionsebene " << endl;
cout << "Designmatrix (Matrix<double>) A: " << A << endl;
solution = svd.GetNullvector();
cout <<"solution: " << solution << endl;
double d;
d = solution[0];
n_vec[0] = solution[1];
n_vec[1] = solution[2];
n_vec[2] = solution[3];
cout << " plane in HNF: d = "<<d<<endl;
cout << " n_vce'0 : " << n_vec << endl;
}
int main() {
set_example_designmatrix( M );
calc_Regressionsebene( M );
return 0;
}