4 #include <visp3/vision/vpHomography.h>
6 #include <visp3/core/vpMeterPixelConversion.h>
12 std::vector<vpPoint> oP;
13 oP.push_back(
vpPoint( -L,-L, 0) );
14 oP.push_back(
vpPoint(2*L,-L, 0) );
15 oP.push_back(
vpPoint( L, 3*L, 0) );
16 oP.push_back(
vpPoint( -L, 4*L, 0) );
26 std::vector<vpPoint> aP(4), bP(4);
27 std::vector<double> xa(4), ya(4), xb(4), yb(4);
28 for(
unsigned int i=0 ; i < 4; i++)
31 xa[i] = oP[i].get_x();
32 ya[i] = oP[i].get_y();
34 xb[i] = oP[i].get_x();
35 yb[i] = oP[i].get_y();
42 std::cout <<
"Estimated homography using DLT:\n" << aHb/aHb[2][2] << std::endl;
45 std::cout <<
"Estimated homography using HLM:\n" << aHb/aHb[2][2] << std::endl;
56 std::cout <<
"\nEstimated displacement:" << std::endl;
57 std::cout <<
" atb: " << atb.
t() << std::endl;
60 std::cout <<
" athetaub: ";
61 for(
unsigned int i=0; i<3; i++)
63 std::cout << std::endl;
64 std::cout <<
" n: " << n.
t() << std::endl;
73 std::cout <<
"Ground truth: Point 3 in pixels in frame b: " << iPb << std::endl;
74 std::cout <<
"Ground truth: Point 3 in pixels in frame a: " << iPa << std::endl;
79 std::cout <<
"Estimation from homography: Point 3 in pixels in frame a: "
static vpImagePoint project(const vpCameraParameters &cam, const vpHomography &bHa, const vpImagePoint &iPa)
Implementation of an homogeneous matrix and operations on such kind of matrices.
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
Point coordinates conversion from normalized coordinates in meter to pixel coordinates ...
vpThetaUVector buildFrom(const vpHomogeneousMatrix &M)
void computeDisplacement(vpRotationMatrix &aRb, vpTranslationVector &atb, vpColVector &n)
Class that defines what is a point.
static void HLM(const std::vector< double > &xb, const std::vector< double > &yb, const std::vector< double > &xa, const std::vector< double > &ya, bool isplanar, vpHomography &aHb)
Implementation of a rotation matrix and operations on such kind of matrices.
Implementation of an homography and operations on homographies.
Generic class defining intrinsic camera parameters.
static double rad(double deg)
static void DLT(const std::vector< double > &xb, const std::vector< double > &yb, const std::vector< double > &xa, const std::vector< double > &ya, vpHomography &aHb, bool normalization=true)
static double deg(double rad)
Implementation of column vector and the associated operations.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Class that consider the case of a translation vector.
Implementation of a rotation vector as axis-angle minimal representation.