32 const double x1 = source[0].
x;
33 const double y1 = source[0].
y;
34 const double x2 = source[1].
x;
35 const double y2 = source[1].
y;
36 const double x3 = source[2].
x;
37 const double y3 = source[2].
y;
38 const double x4 = source[3].
x;
39 const double y4 = source[3].
y;
41 const double x_1 = target[0].
x;
42 const double y_1 = target[0].
y;
43 const double x_2 = target[1].
x;
44 const double y_2 = target[1].
y;
45 const double x_3 = target[2].
x;
46 const double y_3 = target[2].
y;
47 const double x_4 = target[3].
x;
48 const double y_4 = target[3].
y;
50 double P[9*9] = { -x1, -y1, -1.0, 0.0, 0.0, 0.0, x1 *
x_1, y1 *
x_1,
x_1,
51 0.0, 0.0, 0.0, -x1, -y1, -1.0, x1 *
y_1, y1 *
y_1,
y_1,
52 -x2, -y2, -1.0, 0.0, 0.0, 0.0, x2 *
x_2, y2 *
x_2,
x_2,
53 0.0, 0.0, 0.0, -x2, -y2, -1.0, x2 *
y_2, y2 *
y_2,
y_2,
58 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0};
61 for(
int i = 0;
i < 8;
i++)
h_tmp[
i] = 0.0;
84 const float x =
p.
x * h[0 * 3 + 0] +
p.y * h[0 * 3 + 1] + h[0 * 3 + 2];
85 const float y =
p.x * h[1 * 3 + 0] +
p.y * h[1 * 3 + 1] + h[1 * 3 + 2];
86 const float s =
p.x * h[2 * 3 + 0] +
p.y * h[2 * 3 + 1] + h[2 * 3 + 2];
90 const float J00 = h[0 * 3 + 0] * s - h[2 * 3 + 0] *
x;
91 const float J01 = h[0 * 3 + 1] * s - h[2 * 3 + 1] *
x;
92 const float J10 = h[1 * 3 + 0] * s - h[2 * 3 + 0] * y;
93 const float J11 = h[1 * 3 + 1] * s - h[2 * 3 + 1] * y;
94 const float s2 = s * s;