#include <Geometry/HMatrixEstimation.hh>
#include <vector>
using namespace BIAS;
using namespace std;
int main(int argc, char *argv[])
{
const int num_points=4;
vector<HomgPoint2D> frompoints(4), topoints(4);
const int num_fields = 22;
frompoints[0].Set(0.0, 0.0, 1.0);
frompoints[1].Set((double)(num_fields), 0.0, 1.0);
frompoints[2].Set((double)(num_fields), (double)(num_fields), 1.0);
frompoints[3].Set(0.0, (double)(num_fields), 1.0);
topoints[0].Set(521.8942308, 64.35576923, 1.);
topoints[1].Set(527., 280., 1.);
topoints[2].Set(310.96, 282.0, 1.);
topoints[3].Set(309., 62., 1.);
int res = Hest.
Compute(frompoints, topoints, H);
if (res!=0) {
BIASERR("error computing H: "<<res);
return res;
} else {
for (int i=0; i<num_points; i++){
hfrom = H * frompoints[i];
cout << " from = "<<frompoints[i]
<< "\nH * from = "<<hfrom
<< "\n to = "<<topoints[i]<<"\n--------\n";
}
}
return 0;
}