contrib/oxl/mvl/HMatrix2DCompute4Line.cxx
Go to the documentation of this file.
00001 // This is oxl/mvl/HMatrix2DCompute4Line.cxx
00002 #include "HMatrix2DCompute4Line.h"
00003 //
00004 #include <mvl/HMatrix2D.h>
00005 #include <mvl/HomgLine2D.h>
00006 #include <mvl/ProjectiveBasis2D.h>
00007 
00008 bool
00009 HMatrix2DCompute4Line::compute_l(const LineArray & lines1,
00010                                  const LineArray & lines2,
00011                                  HMatrix2D* H)
00012 {
00013   PointArray points1(4,HomgPoint2D()),points2(4,HomgPoint2D());
00014   for (int i=0;i<4;i++) {
00015     points1[i].set(lines1[i].x(),lines1[i].y(),lines1[i].w());
00016     points2[i].set(lines2[i].x(),lines2[i].y(),lines2[i].w());
00017   }
00018   ProjectiveBasis2D basis1(points1);
00019   ProjectiveBasis2D basis2(points2);
00020 
00021   H->set((basis1.get_T().get_inverse().get_matrix() * basis2.get_T_matrix()).transpose());
00022   return true;
00023 }