36 #include <visp3/core/vpLine.h>
38 #include <visp3/core/vpDebug.h>
39 #include <visp3/core/vpMath.h>
41 #include <visp3/core/vpFeatureDisplay.h>
83 const double &oA2,
const double &oB2,
const double &oC2,
const double &oD2)
151 for (
unsigned int i = 0; i < 4; ++i) {
218 double A1, A2, B1, B2, C1, C2, D1, D2;
231 a = (A2 * D1) - (A1 * D2);
232 b = (B2 * D1) - (B1 * D2);
233 c = (C2 * D1) - (C1 * D2);
234 s = (a * a) + (b * b);
237 printf(
"Degenerate case: the image of the straight line is a point!\n");
243 double theta = atan2(b, a);
331 double a1, a2, b1, b2, c1, c2, d1, d2;
332 double A1, A2, B1, B2, C1, C2, D1, D2;
347 A1 = (cMo[0][0] * a1) + (cMo[0][1] * b1) + (cMo[0][2] * c1);
348 B1 = (cMo[1][0] * a1) + (cMo[1][1] * b1) + (cMo[1][2] * c1);
349 C1 = (cMo[2][0] * a1) + (cMo[2][1] * b1) + (cMo[2][2] * c1);
350 D1 = d1 - ((cMo[0][3] * A1) + (cMo[1][3] * B1) + (cMo[2][3] * C1));
352 A2 = (cMo[0][0] * a2) + (cMo[0][1] * b2) + (cMo[0][2] * c2);
353 B2 = (cMo[1][0] * a2) + (cMo[1][1] * b2) + (cMo[1][2] * c2);
354 C2 = (cMo[2][0] * a2) + (cMo[2][1] * b2) + (cMo[2][2] * c2);
355 D2 = d2 - ((cMo[0][3] * A2) + (cMo[1][3] * B2) + (cMo[2][3] * C2));
360 a2 = (B1 * C2) - (C1 * B2);
361 b2 = (C1 * A2) - (A1 * C2);
362 c2 = (A1 * B2) - (B1 * A2);
365 a1 = (A2 * D1) - (A1 * D2);
366 b1 = (B2 * D1) - (B1 * D2);
367 c1 = (C2 * D1) - (C1 * D2);
369 if (fabs(D2) < fabs(D1))
378 d1 = 1.0 / sqrt((a1 * a1) + (b1 * b1) + (c1 * c1));
390 a1 = (b2 * C1) - (c2 * B1);
391 b1 = (c2 * A1) - (a2 * C1);
392 c1 = (a2 * B1) - (b2 * A1);
395 d1 = 1.0 / sqrt((a1 * a1) + (b1 * b1) + (c1 * c1));
401 D2 /= ((A2 * a1) + (B2 * b1) + (C2 * c1));
439 unsigned int thickness)
460 unsigned int thickness)
488 const vpColor &color,
unsigned int thickness)
524 const vpColor &color,
unsigned int thickness)
unsigned int getRows() const
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
void resize(unsigned int i, bool flagNullify=true)
Class to define RGB colors available for display functionalities.
error that can be emitted by ViSP classes.
@ dimensionError
Bad dimension.
static void displayLine(double rho, double theta, const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1)
Implementation of an homogeneous matrix and operations on such kind of matrices.
Class that defines a 3D line in the object frame and allows forward projection of the line in the cam...
void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP) const vp_override
vpLine * duplicate() const vp_override
void projection() vp_override
void setWorldCoordinates(const double &oA1, const double &oB1, const double &oC1, const double &oD1, const double &oA2, const double &oB2, const double &oC2, const double &oD2)
void display(const vpImage< unsigned char > &I, const vpCameraParameters &cam, const vpColor &color=vpColor::green, unsigned int thickness=1) vp_override