227 const unsigned int val_2 = 2;
228 const unsigned int val_8 = 8;
232 if (
cP.getRows() != val_8) {
235 double A1, A2, B1, B2, C1, C2, D1, D2;
236 const unsigned int index_0 = 0;
237 const unsigned int index_1 = 1;
238 const unsigned int index_2 = 2;
239 const unsigned int index_3 = 3;
240 const unsigned int index_4 = 4;
241 const unsigned int index_5 = 5;
242 const unsigned int index_6 = 6;
243 const unsigned int index_7 = 7;
256 a = (A2 * D1) - (A1 * D2);
257 b = (B2 * D1) - (B1 * D2);
258 c = (C2 * D1) - (C1 * D2);
259 s = (a * a) + (b * b);
262 printf(
"Degenerate case: the image of the straight line is a point!\n");
268 double theta = atan2(b, a);
354 const unsigned int val_8 = 8;
357 double a1, a2, b1, b2, c1, c2, d1, d2;
358 double A1, A2, B1, B2, C1, C2, D1, D2;
359 const unsigned int index_0 = 0;
360 const unsigned int index_1 = 1;
361 const unsigned int index_2 = 2;
362 const unsigned int index_3 = 3;
363 const unsigned int index_4 = 4;
364 const unsigned int index_5 = 5;
365 const unsigned int index_6 = 6;
366 const unsigned int index_7 = 7;
381 A1 = (cMo[index_0][0] * a1) + (cMo[index_0][1] * b1) + (cMo[index_0][index_2] * c1);
382 B1 = (cMo[index_1][0] * a1) + (cMo[index_1][1] * b1) + (cMo[index_1][index_2] * c1);
383 C1 = (cMo[index_2][0] * a1) + (cMo[index_2][1] * b1) + (cMo[index_2][index_2] * c1);
384 D1 = d1 - ((cMo[index_0][index_3] * A1) + (cMo[index_1][index_3] * B1) + (cMo[index_2][index_3] * C1));
386 A2 = (cMo[index_0][0] * a2) + (cMo[index_0][1] * b2) + (cMo[index_0][index_2] * c2);
387 B2 = (cMo[index_1][0] * a2) + (cMo[index_1][1] * b2) + (cMo[index_1][index_2] * c2);
388 C2 = (cMo[index_2][0] * a2) + (cMo[index_2][1] * b2) + (cMo[index_2][index_2] * c2);
389 D2 = d2 - ((cMo[index_0][index_3] * A2) + (cMo[index_1][index_3] * B2) + (cMo[index_2][index_3] * C2));
394 a2 = (B1 * C2) - (C1 * B2);
395 b2 = (C1 * A2) - (A1 * C2);
396 c2 = (A1 * B2) - (B1 * A2);
399 a1 = (A2 * D1) - (A1 * D2);
400 b1 = (B2 * D1) - (B1 * D2);
401 c1 = (C2 * D1) - (C1 * D2);
403 if (fabs(D2) < fabs(D1))
412 d1 = 1.0 / sqrt((a1 * a1) + (b1 * b1) + (c1 * c1));
424 a1 = (b2 * C1) - (c2 * B1);
425 b1 = (c2 * A1) - (a2 * C1);
426 c1 = (a2 * B1) - (b2 * A1);
429 d1 = 1.0 / sqrt((a1 * a1) + (b1 * b1) + (c1 * c1));
435 D2 /= ((A2 * a1) + (B2 * b1) + (C2 * c1));
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 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)