39 #include <visp3/core/vpLine.h>
41 #include <visp3/core/vpDebug.h>
42 #include <visp3/core/vpMath.h>
44 #include <visp3/core/vpFeatureDisplay.h>
95 const double &C1,
const double &D1,
96 const double &A2,
const double &B2,
97 const double &C2,
const double &D2)
170 for (
unsigned int i=0 ; i < 4 ; i++)
243 double A1, A2, B1, B2, C1, C2, D1, D2;
262 printf(
"Degenerate case: the image of the straight line is a point!\n");
268 double theta = atan2( b, a);
365 double a1, a2, b1, b2, c1, c2, d1, d2;
366 double A1, A2, B1, B2, C1, C2, D1, D2;
384 A1 = cMo[0][0]*a1 + cMo[0][1]*b1 + cMo[0][2]*c1;
385 B1 = cMo[1][0]*a1 + cMo[1][1]*b1 + cMo[1][2]*c1;
386 C1 = cMo[2][0]*a1 + cMo[2][1]*b1 + cMo[2][2]*c1;
387 D1 = d1 - (cMo[0][3]*A1 + cMo[1][3]*B1 + cMo[2][3]*C1);
389 A2 = cMo[0][0]*a2 + cMo[0][1]*b2 + cMo[0][2]*c2;
390 B2 = cMo[1][0]*a2 + cMo[1][1]*b2 + cMo[1][2]*c2;
391 C2 = cMo[2][0]*a2 + cMo[2][1]*b2 + cMo[2][2]*c2;
392 D2 = d2 - (cMo[0][3]*A2 + cMo[1][3]*B2 + cMo[2][3]*C2);
413 if (fabs(D2) < fabs(D1))
422 d1 = 1.0/sqrt(a1*a1 + b1*b1 + c1*c1);
423 cP_[0] = A1 = a1*d1 ;
424 cP_[1] = B1 = b1*d1 ;
425 cP_[2] = C1 = c1*d1 ;
435 d1 = 1.0/sqrt(a1*a1 + b1*b1 + c1*c1);
441 D2 /= (A2*a1 + B2*b1 + C2*c1);
506 const unsigned int thickness)
537 const unsigned int thickness)
543 cam, I, color, thickness) ;
Implementation of an homogeneous matrix and operations on such kind of matrices.
void setWorldCoordinates(const double &A1, const double &B1, const double &C1, const double &D1, const double &A2, const double &B2, const double &C2, const double &D2)
Class to define colors available for display functionnalities.
error that can be emited by ViSP classes.
Class that defines a line in the object frame, the camera frame and the image plane. All the parameters must be set in meter.
Generic class defining intrinsic camera parameters.
unsigned int getRows() const
Return the number of rows of the 2D array.
vpLine * duplicate() const
void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP)
Implementation of column vector and the associated operations.
static void displayLine(double rho, double theta, const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1)
void display(const vpImage< unsigned char > &I, const vpCameraParameters &cam, const vpColor &color=vpColor::green, const unsigned int thickness=1)
void resize(const unsigned int i, const bool flagNullify=true)