example demonstrating H-Matrix
, HMatrixEstimation
- Author
- MIP
#include "Geometry/HMatrixEstimation.hh"
#include "Base/Math/Random.hh"
using namespace std;
using namespace BIAS;
int main(int , char** )
{
TheoH[0][0]=1.5; TheoH[0][1]= 0; TheoH[0][2]=10;
TheoH[1][0]= 0; TheoH[1][1]=2.1; TheoH[1][2]=100;
TheoH[2][0]= 0; TheoH[2][1]= 0; TheoH[2][2]=1;
std::vector<HomgPoint2D> points_src;
std::vector<HomgPoint2D> points_dest, points_dest_with_out;
const double noise = 0.3;
for (int i = 0; i <100; i++){
for (int k=0; k<2; k++)
point2d_im1[k]=1000.0*rand()/(RAND_MAX+1.0);
point2d_im1[2]=1;
points_src.push_back(point2d_im1);
points_dest.push_back(point2d_im2);
}
if (fabs(EstH[2][2])>1e-50) EstH /= EstH[2][2];
cout << "H ground truth is " << TheoH << endl;
cout << "H Est is " << EstH << endl;
return 0;
}