coeffs.cpp
Go to the documentation of this file.
1 
4 #include "coeffs.h"
5 #include "calibration.h"
6 #include "frame-data.h"
7 #include "optimizer.h"
8 
9 namespace librealsense {
10 namespace algo {
11 namespace depth_to_rgb_calibration {
12 
13 
15  rotation_in_angles const & rot_angles,
16  double3 const & v,
17  double rc,
18  double2 const & xy,
19  const calib & yuy_intrin_extrin
20  )
21  {
22  auto r = yuy_intrin_extrin.rot.rot;
23  double t[3] = { yuy_intrin_extrin.trans.t1, yuy_intrin_extrin.trans.t2, yuy_intrin_extrin.trans.t3 };
24  auto d = yuy_intrin_extrin.coeffs;
25  auto ppx = (double)yuy_intrin_extrin.k_mat.get_ppx();
26  auto ppy = (double)yuy_intrin_extrin.k_mat.get_ppy();
27  auto fx = (double)yuy_intrin_extrin.k_mat.get_fx();
28  auto fy = (double)yuy_intrin_extrin.k_mat.get_fy();
29 
30  auto sin_a = (double)sin( rot_angles.alpha );
31  auto sin_b = (double)sin( rot_angles.beta );
32  auto sin_g = (double)sin( rot_angles.gamma );
33 
34  auto cos_a = (double)cos( rot_angles.alpha );
35  auto cos_b = (double)cos( rot_angles.beta );
36  auto cos_g = (double)cos( rot_angles.gamma );
37  auto x1 = (double)xy.x;
38  auto y1 = (double)xy.y;
39 
40  auto x2 = x1 * x1;
41  auto y2 = y1 * y1;
42  auto xy2 = x2 + y2;
43  auto x2_y2 = xy2 * xy2;
44 
45  auto x = v.x;
46  auto y = v.y;
47  auto z = v.z;
48 
49 
50  auto exp1 = z * (0 * sin_b + 1 * cos_a*cos_b - 0 * cos_b*sin_a)
51  + x * (0 * (cos_a*sin_g + cos_g * sin_a*sin_b)
52  + 1 * (sin_a*sin_g - cos_a * cos_g*sin_b)
53  + 0 * cos_b*cos_g)
54  + y * (0 * (cos_a*cos_g - sin_a * sin_b*sin_g)
55  + 1 * (cos_g*sin_a + cos_a * sin_b*sin_g)
56  - 0 * cos_b*sin_g)
57  + 1 * (0 * t[0] + 0 * t[1] + 1 * t[2]);
58 
59  auto res = (((x*(0 * (sin_a*sin_g - cos_a * cos_g*sin_b)
60  - 1 * (cos_a*sin_g + cos_g * sin_a*sin_b)
61  ) + y * (0 * (cos_g*sin_a + cos_a * sin_b*sin_g)
62  - 1 * (cos_a*cos_g - sin_a * sin_b*sin_g)
63  ) + z * (0 * cos_a*cos_b + 1 * cos_b*sin_a)
64  )*(z*(fx*sin_b + ppx * cos_a*cos_b - 0 * cos_b*sin_a)
65  + x * (0 * (cos_a*sin_g + cos_g * sin_a*sin_b)
66  + ppx * (sin_a*sin_g - cos_a * cos_g*sin_b)
67  + fx * cos_b*cos_g)
68  + y * (0 * (cos_a*cos_g - sin_a * sin_b*sin_g)
69  + ppx * (cos_g*sin_a + cos_a * sin_b*sin_g)
70  - fx * cos_b*sin_g)
71  + 1 * (fx*t[0] + 0 * t[1] + ppx * t[2])
72  ) - (x*(0 * (sin_a*sin_g - cos_a * cos_g*sin_b)
73  - ppx * (cos_a*sin_g + cos_g * sin_a*sin_b)
74  ) + y * (0 * (cos_g*sin_a + cos_a * sin_b*sin_g)
75  - ppx * (cos_a*cos_g - sin_a * sin_b*sin_g)
76  ) + z * (0 * cos_a*cos_b + ppx * cos_b*sin_a)
77  )*(z*(0 * sin_b + 1 * cos_a*cos_b - 0 * cos_b*sin_a)
78  + x * (0 * (cos_a*sin_g + cos_g * sin_a*sin_b)
79  + 1 * (sin_a*sin_g - cos_a * cos_g*sin_b)
80  + 0 * cos_b*cos_g)
81  + y * (0 * (cos_a*cos_g - sin_a * sin_b*sin_g)
82  + 1 * (cos_g*sin_a + cos_a * sin_b*sin_g)
83  - 0 * cos_b*sin_g)
84  + 1 * (0 * t[0] + 0 * t[1] + 1 * t[2])
85  ))
86  *(rc + 6 * d[3] * x1 + 2 * d[2] * y1 + x1 * (2 * d[0] * x1 + 4 * d[1] * x1*(xy2)+6 * d[4] * x1*x2_y2))
87  ) / (exp1*exp1) + (fx*((x*(0 * (sin_a*sin_g - cos_a * cos_g*sin_b)
88  - 1 * (cos_a*sin_g + cos_g * sin_a*sin_b)
89  ) + y * (0 * (cos_g*sin_a + cos_a * sin_b*sin_g)
90  - 1 * (cos_a*cos_g - sin_a * sin_b*sin_g)
91  ) + z * (0 * cos_a*cos_b + 1 * cos_b*sin_a)
92  )*(z*(0 * sin_b + ppy * cos_a*cos_b - fy * cos_b*sin_a)
93  + x * (fy*(cos_a*sin_g + cos_g * sin_a*sin_b)
94  + ppy * (sin_a*sin_g - cos_a * cos_g*sin_b)
95  + 0 * cos_b*cos_g)
96  + y * (fy*(cos_a*cos_g - sin_a * sin_b*sin_g)
97  + ppy * (cos_g*sin_a + cos_a * sin_b*sin_g)
98  - 0 * cos_b*sin_g)
99  + 1 * (0 * t[0] + fy * t[1] + ppy * t[2])
100  ) - (x*(fy*(sin_a*sin_g - cos_a * cos_g*sin_b)
101  - ppy * (cos_a*sin_g + cos_g * sin_a*sin_b)
102  ) + y * (fy*(cos_g*sin_a + cos_a * sin_b*sin_g)
103  - ppy * (cos_a*cos_g - sin_a * sin_b*sin_g)
104  ) + z * (fy*cos_a*cos_b + ppy * cos_b*sin_a)
105  )*(z*(0 * sin_b + 1 * cos_a*cos_b - 0 * cos_b*sin_a)
106  + x * (0 * (cos_a*sin_g + cos_g * sin_a*sin_b)
107  + 1 * (sin_a*sin_g - cos_a * cos_g*sin_b)
108  + 0 * cos_b*cos_g)
109  + y * (0 * (cos_a*cos_g - sin_a * sin_b*sin_g)
110  + 1 * (cos_g*sin_a + cos_a * sin_b*sin_g)
111  - 0 * cos_b*sin_g)
112  + 1 * (0 * t[0] + 0 * t[1] + 1 * t[2])
113  ))
114  *(2 * d[2] * x1 + 2 * d[3] * y1 + x1 * (2 * d[0] * y1 + 4 * d[1] * y1*(xy2)+6 * d[4] * y1*x2_y2))
115  ) / (fy*(exp1*exp1));
116  return res;
117  }
118 
120  rotation_in_angles const & rot_angles,
121  double3 const & v,
122  double rc,
123  double2 const & xy,
124  const calib & yuy_intrin_extrin
125  )
126  {
127  auto r = yuy_intrin_extrin.rot.rot;
128  double t[3] = { yuy_intrin_extrin.trans.t1, yuy_intrin_extrin.trans.t2, yuy_intrin_extrin.trans.t3 };
129  auto d = yuy_intrin_extrin.coeffs;
130  auto ppx = (double)yuy_intrin_extrin.k_mat.get_ppx();
131  auto ppy = (double)yuy_intrin_extrin.k_mat.get_ppy();
132  auto fx = (double)yuy_intrin_extrin.k_mat.get_fx();
133  auto fy = (double)yuy_intrin_extrin.k_mat.get_fy();
134 
135  auto sin_a = sin( rot_angles.alpha );
136  auto sin_b = sin( rot_angles.beta );
137  auto sin_g = sin( rot_angles.gamma );
138 
139  auto cos_a = cos( rot_angles.alpha );
140  auto cos_b = cos( rot_angles.beta );
141  auto cos_g = cos( rot_angles.gamma );
142  auto x1 = (double)xy.x;
143  auto y1 = (double)xy.y;
144 
145  auto x2 = x1 * x1;
146  auto y2 = y1 * y1;
147  auto xy2 = x2 + y2;
148  auto x2_y2 = xy2 * xy2;
149 
150  auto x = (double)v.x;
151  auto y = (double)v.y;
152  auto z = (double)v.z;
153 
154  auto exp1 = z * (cos_a*cos_b) +
155  x * ((sin_a*sin_g - cos_a * cos_g*sin_b))
156  + y * ((cos_g*sin_a + cos_a * sin_b*sin_g))
157  + (t[2]);
158 
159  auto res = -(((z*(0 * cos_b - 1 * cos_a*sin_b + 0 * sin_a*sin_b)
160  - x * (0 * cos_g*sin_b + 1 * cos_a*cos_b*cos_g - 0 * cos_b*cos_g*sin_a)
161  + y * (0 * sin_b*sin_g + 1 * cos_a*cos_b*sin_g - 0 * cos_b*sin_a*sin_g)
162  )*(z*(fx*sin_b + ppx * cos_a*cos_b - 0 * cos_b*sin_a)
163  + x * (0 * (cos_a*sin_g + cos_g * sin_a*sin_b)
164  + ppx * (sin_a*sin_g - cos_a * cos_g*sin_b)
165  + fx * cos_b*cos_g)
166  + y * (0 * (cos_a*cos_g - sin_a * sin_b*sin_g)
167  + ppx * (cos_g*sin_a + cos_a * sin_b*sin_g)
168  - fx * cos_b*sin_g)
169  + 1 * (fx*t[0] + 0 * t[1] + ppx * t[2])
170  ) - (z*(fx*cos_b - ppx * cos_a*sin_b + 0 * sin_a*sin_b)
171  - x * (fx*cos_g*sin_b + ppx * cos_a*cos_b*cos_g - 0 * cos_b*cos_g*sin_a)
172  + y * (fx*sin_b*sin_g + ppx * cos_a*cos_b*sin_g - 0 * cos_b*sin_a*sin_g)
173  )*(z*(0 * sin_b + 1 * cos_a*cos_b - 0 * cos_b*sin_a)
174  + x * (0 * (cos_a*sin_g + cos_g * sin_a*sin_b)
175  + 1 * (sin_a*sin_g - cos_a * cos_g*sin_b)
176  + 0 * cos_b*cos_g)
177  + y * (0 * (cos_a*cos_g - sin_a * sin_b*sin_g)
178  + 1 * (cos_g*sin_a + cos_a * sin_b*sin_g)
179  - 0 * cos_b*sin_g)
180  + 1 * (0 * t[0] + 0 * t[1] + 1 * t[2])))
181  *(rc + 6 * d[3] * x1 + 2 * d[2] * y1 + x1 * (2 * d[0] * x1 + 4 * d[1] * x1*(xy2)+6 * d[4] * x1*x2_y2))
182  ) / (exp1* exp1) - (fx*((z*(0 * cos_b - 1 * cos_a*sin_b + 0 * sin_a*sin_b)
183  - x * (0 * cos_g*sin_b + 1 * cos_a*cos_b*cos_g - 0 * cos_b*cos_g*sin_a)
184  + y * (0 * sin_b*sin_g + 1 * cos_a*cos_b*sin_g - 0 * cos_b*sin_a*sin_g)
185  )*(z*(0 * sin_b + ppy * cos_a*cos_b - fy * cos_b*sin_a)
186  + x * (fy*(cos_a*sin_g + cos_g * sin_a*sin_b)
187  + ppy * (sin_a*sin_g - cos_a * cos_g*sin_b)
188  + 0 * cos_b*cos_g)
189  + y * (fy*(cos_a*cos_g - sin_a * sin_b*sin_g)
190  + ppy * (cos_g*sin_a + cos_a * sin_b*sin_g)
191  - 0 * cos_b*sin_g)
192  + 1 * (0 * t[0] + fy * t[1] + ppy * t[2])
193  ) - (z*(0 * cos_b - ppy * cos_a*sin_b + fy * sin_a*sin_b)
194  - x * (0 * cos_g*sin_b + ppy * cos_a*cos_b*cos_g - fy * cos_b*cos_g*sin_a)
195  + y * (0 * sin_b*sin_g + ppy * cos_a*cos_b*sin_g - fy * cos_b*sin_a*sin_g)
196  )*(z*(0 * sin_b + 1 * cos_a*cos_b - 0 * cos_b*sin_a)
197  + x * (0 * (cos_a*sin_g + cos_g * sin_a*sin_b)
198  + 1 * (sin_a*sin_g - cos_a * cos_g*sin_b)
199  + 0 * cos_b*cos_g)
200  + y * (0 * (cos_a*cos_g - sin_a * sin_b*sin_g)
201  + 1 * (cos_g*sin_a + cos_a * sin_b*sin_g)
202  - 0 * cos_b*sin_g)
203  + 1 * (0 * t[0] + 0 * t[1] + 1 * t[2])
204  ))*(2 * d[2] * x1 + 2 * d[3] * y1 + x1 * (2 * d[0] * y1 + 4 * d[1] * y1*(xy2)+6 * d[4] * y1*x2_y2))
205  ) / (fy*(exp1*exp1));
206 
207  return res;
208  }
209 
211  rotation_in_angles const & rot_angles,
212  double3 const & v,
213  double rc,
214  double2 const & xy,
215  const calib & yuy_intrin_extrin
216  )
217  {
218  auto r = yuy_intrin_extrin.rot.rot;
219  double t[3] = { yuy_intrin_extrin.trans.t1, yuy_intrin_extrin.trans.t2, yuy_intrin_extrin.trans.t3 };
220  auto d = yuy_intrin_extrin.coeffs;
221  auto ppx = (double)yuy_intrin_extrin.k_mat.get_ppx();
222  auto ppy = (double)yuy_intrin_extrin.k_mat.get_ppy();
223  auto fx = (double)yuy_intrin_extrin.k_mat.get_fx();
224  auto fy = (double)yuy_intrin_extrin.k_mat.get_fy();
225 
226  auto sin_a = (double)sin( rot_angles.alpha );
227  auto sin_b = (double)sin( rot_angles.beta );
228  auto sin_g = (double)sin( rot_angles.gamma );
229 
230  auto cos_a = (double)cos( rot_angles.alpha );
231  auto cos_b = (double)cos( rot_angles.beta );
232  auto cos_g = (double)cos( rot_angles.gamma );
233  auto x1 = (double)xy.x;
234  auto y1 = (double)xy.y;
235 
236  auto x2 = x1 * x1;
237  auto y2 = y1 * y1;
238  auto xy2 = x2 + y2;
239  auto x2_y2 = xy2 * xy2;
240 
241  auto x = (double)v.x;
242  auto y = (double)v.y;
243  auto z = (double)v.z;
244 
245  auto exp1 = z * cos_a*cos_b +
246  x * (sin_a*sin_g - cos_a * cos_g*sin_b) +
247  y * (cos_g*sin_a + cos_a * sin_b*sin_g) +
248  t[2];
249 
250  auto res = (
251  ((y*(sin_a*sin_g - cos_a * cos_g*sin_b) - x * (cos_g*sin_a + cos_a * sin_b*sin_g))*
252  (z*(fx*sin_b + ppx * cos_a*cos_b) +
253  x * (ppx*(sin_a*sin_g - cos_a * cos_g*sin_b) + fx * cos_b*cos_g) +
254  y * (ppx*(cos_g*sin_a + cos_a * sin_b*sin_g) - fx * cos_b*sin_g) +
255  (fx*t[0] + ppx * t[2])) -
256  (y*(ppx* (sin_a*sin_g - cos_a * cos_g*sin_b) + fx * cos_b*cos_g) -
257  x * (ppx*(cos_g*sin_a + cos_a * sin_b*sin_g) - fx * cos_b*sin_g))*
258  (z*(cos_a*cos_b) + x * (sin_a*sin_g - cos_a * cos_g*sin_b) +
259  y * (cos_g*sin_a + cos_a * sin_b*sin_g) + t[2]))*
260  (rc + 6 * d[3] * x1 + 2 * d[2] * y1 + x1 * (2 * d[0] * x1 + 4 * d[1] * x1*(xy2)+6 * d[4] * x1*x2_y2))
261  )
262  /
263  (exp1* exp1) + (fx*((y*(sin_a*sin_g - cos_a * cos_g*sin_b) -
264  x * (cos_g*sin_a + cos_a * sin_b*sin_g))*
265  (z*(ppy*cos_a*cos_b - fy * cos_b*sin_a) +
266  x * (fy*(cos_a*sin_g + cos_g * sin_a*sin_b) + ppy * (sin_a*sin_g - cos_a * cos_g*sin_b)) + y *
267  (fy*(cos_a*cos_g - sin_a * sin_b*sin_g) + ppy *
268  (cos_g*sin_a + cos_a * sin_b*sin_g)) +
269  (fy * t[1] + ppy * t[2])) -
270  (y*(fy*(cos_a*sin_g + cos_g * sin_a*sin_b) +
271  ppy * (sin_a*sin_g - cos_a * cos_g*sin_b)) - x *
272  (fy*(cos_a*cos_g - sin_a * sin_b*sin_g) + ppy * (cos_g*sin_a + cos_a * sin_b*sin_g)))*
273  (z*cos_a*cos_b + x * ((sin_a*sin_g - cos_a * cos_g*sin_b)) +
274  y * ((cos_g*sin_a + cos_a * sin_b*sin_g)) + t[2]))*(2 * d[2] * x1 + 2 * d[3] * y1 + x1 *
275  (2 * d[0] * y1 + 4 * d[1] * y1*xy2 + 6 * d[4] * y1*x2_y2)) / (fy*exp1*exp1));
276 
277  return res;
278  }
279 
281  rotation_in_angles const & rot_angles,
282  double3 const & v,
283  double rc,
284  double2 const & xy,
285  const calib & yuy_intrin_extrin
286  )
287  {
288  auto r = yuy_intrin_extrin.rot.rot;
289  double t[3] = { yuy_intrin_extrin.trans.t1, yuy_intrin_extrin.trans.t2, yuy_intrin_extrin.trans.t3 };
290  auto d = yuy_intrin_extrin.coeffs;
291  auto ppx = (double)yuy_intrin_extrin.k_mat.get_ppx();
292  auto ppy = (double)yuy_intrin_extrin.k_mat.get_ppy();
293  auto fx = (double)yuy_intrin_extrin.k_mat.get_fx();
294  auto fy = (double)yuy_intrin_extrin.k_mat.get_fy();
295 
296  auto sin_a = (double)sin( rot_angles.alpha );
297  auto sin_b = (double)sin( rot_angles.beta );
298  auto sin_g = (double)sin( rot_angles.gamma );
299 
300  auto cos_a = (double)cos( rot_angles.alpha );
301  auto cos_b = (double)cos( rot_angles.beta );
302  auto cos_g = (double)cos( rot_angles.gamma );
303  auto x1 = (double)xy.x;
304  auto y1 = (double)xy.y;
305 
306  /* x1 = 1;
307  y1 = 1;*/
308 
309  auto x2 = x1 * x1;
310  auto y2 = y1 * y1;
311  auto xy2 = x2 + y2;
312  auto x2_y2 = xy2 * xy2;
313 
314  auto x = (double)v.x;
315  auto y = (double)v.y;
316  auto z = (double)v.z;
317 
318 
319  auto exp1 = z * (cos_a*cos_b) + x * ((sin_a*sin_g - cos_a * cos_g*sin_b)) +
320  y * ((cos_g*sin_a + cos_a * sin_b*sin_g)) + t[2];
321 
322  auto res = (((x*(-(cos_a*sin_g + cos_g * sin_a*sin_b)) + y * (-1 * (cos_a*cos_g - sin_a * sin_b*sin_g)) + z *
323  (cos_b*sin_a))*(z*(ppy * cos_a*cos_b - fy * cos_b*sin_a) + x * (fy*(cos_a*sin_g + cos_g * sin_a*sin_b) +
324  ppy * (sin_a*sin_g - cos_a * cos_g*sin_b)) + y * (fy*(cos_a*cos_g - sin_a * sin_b*sin_g) +
325  ppy * (cos_g*sin_a + cos_a * sin_b*sin_g)) + (fy * t[1] + ppy * t[2])) - (x*(fy*(sin_a*sin_g - cos_a * cos_g*sin_b) -
326  ppy * (cos_a*sin_g + cos_g * sin_a*sin_b)) + y * (fy*(cos_g*sin_a + cos_a * sin_b*sin_g) -
327  ppy * (cos_a*cos_g - sin_a * sin_b*sin_g)) + z * (fy*cos_a*cos_b + ppy * cos_b*sin_a))*
328  (z*(cos_a*cos_b) + x * ((sin_a*sin_g - cos_a * cos_g*sin_b)) + y * ((cos_g*sin_a + cos_a * sin_b*sin_g) - 0 * cos_b*sin_g) + (t[2])))*
329  (rc + 2 * d[3] * x1 + 6 * d[2] * y1 + y1 * (2 * d[0] * y1 + 4 * d[1] * y1*(xy2)+6 * d[4] * y1*x2_y2))) /
330  (exp1*exp1) + (fy*((x*(-(cos_a*sin_g + cos_g * sin_a*sin_b)) + y * (-(cos_a*cos_g - sin_a * sin_b*sin_g)) +
331  z * (cos_b*sin_a))*(z*(fx*sin_b + ppx * cos_a*cos_b) + x * (ppx*(sin_a*sin_g - cos_a * cos_g*sin_b) + fx * cos_b*cos_g) + y *
332  (ppx*(cos_g*sin_a + cos_a * sin_b*sin_g) - fx * cos_b*sin_g) + (fx*t[0] + ppx * t[2])) - (x*(-ppx * (cos_a*sin_g + cos_g * sin_a*sin_b)) +
333  y * (-ppx * (cos_a*cos_g - sin_a * sin_b*sin_g)) + z * (ppx*cos_b*sin_a))*(z*(cos_a*cos_b - 0 * cos_b*sin_a) + x * ((sin_a*sin_g - cos_a * cos_g*sin_b)) +
334  y * ((cos_g*sin_a + cos_a * sin_b*sin_g)) + (t[2])))*(2 * d[2] * x1 + 2 * d[3] * y1 + y1 * (2 * d[0] * x1 + 4 * d[1] * x1*(xy2)+6 * d[4] * x1*x2_y2))) / (fx*(exp1*exp1));
335 
336  return res;
337  }
338 
340  rotation_in_angles const & rot_angles,
341  double3 const & v,
342  double rc,
343  double2 const & xy,
344  const calib & yuy_intrin_extrin
345  )
346  {
347  auto r = yuy_intrin_extrin.rot.rot;
348  double t[3] = { yuy_intrin_extrin.trans.t1, yuy_intrin_extrin.trans.t2, yuy_intrin_extrin.trans.t3 };
349  auto d = yuy_intrin_extrin.coeffs;
350  auto ppx = (double)yuy_intrin_extrin.k_mat.get_ppx();
351  auto ppy = (double)yuy_intrin_extrin.k_mat.get_ppy();
352  auto fx = (double)yuy_intrin_extrin.k_mat.get_fx();
353  auto fy = (double)yuy_intrin_extrin.k_mat.get_fy();
354 
355  auto sin_a = (double)sin( rot_angles.alpha );
356  auto sin_b = (double)sin( rot_angles.beta );
357  auto sin_g = (double)sin( rot_angles.gamma );
358 
359  auto cos_a = (double)cos( rot_angles.alpha );
360  auto cos_b = (double)cos( rot_angles.beta );
361  auto cos_g = (double)cos( rot_angles.gamma );
362  auto x1 = (double)xy.x;
363  auto y1 = (double)xy.y;
364 
365  auto x2 = x1 * x1;
366  auto y2 = y1 * y1;
367  auto xy2 = x2 + y2;
368  auto x2_y2 = xy2 * xy2;
369 
370  auto x = (double)v.x;
371  auto y = (double)v.y;
372  auto z = (double)v.z;
373 
374  auto exp1 = z * (cos_a*cos_b) + x * ((sin_a*sin_g - cos_a * cos_g*sin_b))
375  + y * ((cos_g*sin_a + cos_a * sin_b*sin_g)) + (t[2]);
376 
377  auto res = -(((z*(-cos_a * sin_b) - x * (cos_a*cos_b*cos_g)
378  + y * (cos_a*cos_b*sin_g))*(z*(ppy * cos_a*cos_b - fy * cos_b*sin_a)
379  + x * (fy*(cos_a*sin_g + cos_g * sin_a*sin_b) + ppy * (sin_a*sin_g - cos_a * cos_g*sin_b))
380  + y * (fy*(cos_a*cos_g - sin_a * sin_b*sin_g) + ppy * (cos_g*sin_a + cos_a * sin_b*sin_g))
381  + (fy * t[1] + ppy * t[2])) - (z*(0 * cos_b - ppy * cos_a*sin_b + fy * sin_a*sin_b)
382  - x * (ppy * cos_a*cos_b*cos_g - fy * cos_b*cos_g*sin_a) + y * (ppy * cos_a*cos_b*sin_g - fy * cos_b*sin_a*sin_g))*
383  (z*(cos_a*cos_b) + x * ((sin_a*sin_g - cos_a * cos_g*sin_b)) + y * ((cos_g*sin_a + cos_a * sin_b*sin_g)) + t[2]))
384  *(rc + 2 * d[3] * x1 + 6 * d[2] * y1 + y1 * (2 * d[0] * y1 + 4 * d[1] * y1*(xy2)+6 * d[4] * y1*x2_y2))) /
385  (exp1*exp1) - (fy*((z*(-cos_a * sin_b) - x * (cos_a*cos_b*cos_g) + y * (cos_a*cos_b*sin_g))*(z*(fx*sin_b + ppx * cos_a*cos_b)
386  + x * (ppx * (sin_a*sin_g - cos_a * cos_g*sin_b) + fx * cos_b*cos_g) + y * (+ppx * (cos_g*sin_a + cos_a * sin_b*sin_g) - fx * cos_b*sin_g)
387  + (fx*t[0] + ppx * t[2])) - (z*(fx*cos_b - ppx * cos_a*sin_b) - x * (fx*cos_g*sin_b + ppx * cos_a*cos_b*cos_g) + y
388  * (fx*sin_b*sin_g + ppx * cos_a*cos_b*sin_g))*(z*(cos_a*cos_b) + x * (sin_a*sin_g - cos_a * cos_g*sin_b) + y
389  * (cos_g*sin_a + cos_a * sin_b*sin_g) + t[2]))*(2 * d[2] * x1 + 2 * d[3] * y1 + y1 *
390  (2 * d[0] * x1 + 4 * d[1] * x1*(xy2)+6 * d[4] * x1*x2_y2))) / (fx*(exp1*exp1));
391 
392  return res;
393 
394  }
395 
397  rotation_in_angles const & rot_angles,
398  double3 const & v,
399  double rc,
400  double2 const & xy,
401  const calib & yuy_intrin_extrin
402  )
403  {
404  auto r = yuy_intrin_extrin.rot.rot;
405  double t[3] = { yuy_intrin_extrin.trans.t1, yuy_intrin_extrin.trans.t2, yuy_intrin_extrin.trans.t3 };
406  auto d = yuy_intrin_extrin.coeffs;
407  auto ppx = (double)yuy_intrin_extrin.k_mat.get_ppx();
408  auto ppy = (double)yuy_intrin_extrin.k_mat.get_ppy();
409  auto fx = (double)yuy_intrin_extrin.k_mat.get_fx();
410  auto fy = (double)yuy_intrin_extrin.k_mat.get_fy();
411 
412  auto sin_a = (double)sin( rot_angles.alpha );
413  auto sin_b = (double)sin( rot_angles.beta );
414  auto sin_g = (double)sin( rot_angles.gamma );
415 
416  auto cos_a = (double)cos( rot_angles.alpha );
417  auto cos_b = (double)cos( rot_angles.beta );
418  auto cos_g = (double)cos( rot_angles.gamma );
419  auto x1 = (double)xy.x;
420  auto y1 = (double)xy.y;
421 
422  auto x2 = x1 * x1;
423  auto y2 = y1 * y1;
424  auto xy2 = x2 + y2;
425  auto x2_y2 = xy2 * xy2;
426 
427  auto x = v.x;
428  auto y = v.y;
429  auto z = v.z;
430 
431  auto exp1 = z * (cos_a*cos_b) + x * (+(sin_a*sin_g - cos_a * cos_g*sin_b))
432  + y * ((cos_g*sin_a + cos_a * sin_b*sin_g)) + t[2];
433 
434  auto res = (((y*(+(sin_a*sin_g - cos_a * cos_g*sin_b)) - x * ((cos_g*sin_a + cos_a * sin_b*sin_g)))
435  *(z*(ppy * cos_a*cos_b - fy * cos_b*sin_a) + x * (fy*(cos_a*sin_g + cos_g * sin_a*sin_b)
436  + ppy * (sin_a*sin_g - cos_a * cos_g*sin_b)) + y * (fy*(cos_a*cos_g - sin_a * sin_b*sin_g)
437  + ppy * (cos_g*sin_a + cos_a * sin_b*sin_g))
438  + (fy * t[1] + ppy * t[2])) - (y*(fy*(cos_a*sin_g + cos_g * sin_a*sin_b) + ppy * (sin_a*sin_g - cos_a * cos_g*sin_b))
439  - x * (fy*(cos_a*cos_g - sin_a * sin_b*sin_g) + ppy * (cos_g*sin_a + cos_a * sin_b*sin_g)))*(z*(cos_a*cos_b)
440  + x * ((sin_a*sin_g - cos_a * cos_g*sin_b)) + y * (+(cos_g*sin_a + cos_a * sin_b*sin_g)) + (t[2])))
441  *(rc + 2 * d[3] * x1 + 6 * d[2] * y1 + y1 * (2 * d[0] * y1 + 4 * d[1] * y1*(xy2)+6 * d[4] * y1*x2_y2)))
442  / (exp1*exp1) + (fy*((y*(+(sin_a*sin_g - cos_a * cos_g*sin_b)) - x * (+(cos_g*sin_a + cos_a * sin_b*sin_g)))
443  *(z*(fx*sin_b + ppx * cos_a*cos_b) + x * (ppx * (sin_a*sin_g - cos_a * cos_g*sin_b) + fx * cos_b*cos_g)
444  + y * (+ppx * (cos_g*sin_a + cos_a * sin_b*sin_g) - fx * cos_b*sin_g) + (fx*t[0] + ppx * t[2]))
445  - (y*(ppx * (sin_a*sin_g - cos_a * cos_g*sin_b) + fx * cos_b*cos_g) - x
446  * (+ppx * (cos_g*sin_a + cos_a * sin_b*sin_g) - fx * cos_b*sin_g))*(z*(cos_a*cos_b)
447  + x * ((sin_a*sin_g - cos_a * cos_g*sin_b)) + y * ((cos_g*sin_a + cos_a * sin_b*sin_g)) + (t[2])))
448  *(2 * d[2] * x1 + 2 * d[3] * y1 + y1 * (2 * d[0] * x1 + 4 * d[1] * x1*(xy2)+6 * d[4] * x1*x2_y2))
449  ) / (fx*(exp1*exp1));
450 
451  return res;
452  }
453 
455  double3 const & v,
456  double rc,
457  double2 const & xy,
458  const calib & cal,
459  const p_matrix & p_mat
460  )
461  {
462  p_matrix res;
463  auto r = cal.rot.rot;
464  double t[3] = { cal.trans.t1, cal.trans.t2, cal.trans.t3 };
465  auto d = cal.coeffs;
466  auto ppx = (double)cal.k_mat.get_ppx();
467  auto ppy = (double)cal.k_mat.get_ppy();
468  auto fx = (double)cal.k_mat.get_fx();
469  auto fy = (double)cal.k_mat.get_fy();
470  auto p = p_mat.vals;
471 
472  auto x1 = (double)xy.x;
473  auto y1 = (double)xy.y;
474 
475  auto x2 = x1 * x1;
476  auto y2 = y1 * y1;
477  auto r2 = x2 + y2;
478  auto r4 = r2 * r2;
479 
480  auto x = v.x;
481  auto y = v.y;
482  auto z = v.z;
483 
484  res.vals[1] = res.vals[2] = res.vals[3] = res.vals[4] =
485  res.vals[5] = res.vals[6] = res.vals[7] = res.vals[8] =
486  res.vals[9] = res.vals[10] = res.vals[11] = { 0 };
487 
488  res.vals[0] = (x*(rc + 6*d[3]*x1 + 2*d[2]*y1 + x1*(2*d[0]*x1 + 4*d[1]*x1*(r2)+6*d[4]*x1*r4))
489  )/ (p[8]*x + p[9]*y + p[10]*z + p[11]*1);
490 
491  res.vals[1] = (y*(rc + 6*d[3]*x1 + 2*d[2]*y1 + x1*(2*d[0]*x1 + 4*d[1]*x1*(r2)+6*d[4]*x1*r4))
492  )/ (p[8]*x + p[9]*y + p[10]*z + p[11]*1);
493 
494  res.vals[2] = (z*(rc + 6*d[3]*x1 + 2*d[2]*y1 + x1*(2*d[0]*x1 + 4*d[1]*x1*(r2)+6*d[4]*x1*r4))
495  )/ (p[8]*x + p[9]*y + p[10]*z + p[11]*1);
496 
497  res.vals[3] = (1*(rc + 6*d[3]*x1 + 2*d[2]*y1 + x1*(2*d[0]*x1 + 4*d[1]*x1*(r2)+6*d[4]*x1*r4))
498  )/ (p[8]*x + p[9]*y + p[10]*z + p[11]*1);
499 
500  res.vals[4] = (fx*x*(2*d[2]*x1 + 2*d[3]*y1 + x1*(2*d[0]*y1 + 4*d[1]*y1*(r2)+6*d[4]*y1*r4))
501  )/ (fy*(p[8]*x + p[9]*y + p[10]*z + p[11]*1));
502 
503  res.vals[5] = (fx*y*(2*d[2]*x1 + 2*d[3]*y1 + x1*(2*d[0]*y1 + 4*d[1]*y1*(r2)+6*d[4]*y1*r4))
504  )/ (fy*(p[8]*x + p[9]*y + p[10]*z + p[11]*1));
505 
506  res.vals[6] = (fx*z*(2*d[2]*x1 + 2*d[3]*y1 + x1*(2*d[0]*y1 + 4*d[1]*y1*(r2)+6*d[4]*y1*r4))
507  )/ (fy*(p[8]*x + p[9]*y + p[10]*z + p[11]*1));
508 
509  res.vals[7] = (fx*1*(2*d[2]*x1 + 2*d[3]*y1 + x1*(2*d[0]*y1 + 4*d[1]*y1*(r2)+6*d[4]*y1*r4))
510  )/ (fy*(p[8]*x + p[9]*y + p[10]*z + p[11]*1));
511 
512  double exp = p[8] * x + p[9] * y + p[10] * z + p[11];
513  double exp2 = exp * exp;
514 
515  res.vals[8] = -(x*(p[0]*x + p[1]*y + p[2]*z + p[3]*1)
516  *(rc + 6*d[3]*x1 + 2*d[2]*y1 + x1*(2*d[0]*x1 + 4*d[1]*x1*(r2)+6*d[4]*x1*r4))
517  )/ exp2 - (fx*x*(2*d[2]*x1 + 2*d[3]*y1 + x1*(2*d[0]*y1 + 4*d[1]*y1*(r2)+6*d[4]*y1*r4))
518  *(p[4]*x + p[5]*y + p[6]*z + p[7]*1)
519  )/ (fy*(exp2));
520 
521 
522  res.vals[9] = - (y*(p[0]*x + p[1]*y + p[2]*z + p[3]*1)
523  *(rc + 6*d[3]*x1 + 2*d[2]*y1 + x1*(2*d[0]*x1 + 4*d[1]*x1*(r2)+6*d[4]*x1*r4))
524  ) / exp2 - (fx*y*(2*d[2]*x1 + 2*d[3]*y1 + x1*(2*d[0]*y1 + 4*d[1]*y1*(r2)+6*d[4]*y1*r4))
525  *(p[4]*x + p[5]*y + p[6]*z + p[7]*1)
526  )/ (fy*exp2);
527 
528  res.vals[10] = - (z*(p[0]*x + p[1]*y + p[2]*z + p[3]*1)
529  *(rc + 6*d[3]*x1 + 2*d[2]*y1 + x1*(2*d[0]*x1 + 4*d[1]*x1*(r2)+6*d[4]*x1*r4))
530  ) / exp2 - (fx*z*(2*d[2]*x1 + 2*d[3]*y1 + x1*(2*d[0]*y1 + 4*d[1]*y1*(r2)+6*d[4]*y1*r4))
531  *(p[4]*x + p[5]*y + p[6]*z + p[7]*1)
532  ) / (fy*exp2);
533 
534  res.vals[11] = -(1 * (p[0] * x + p[1] * y + p[2] * z + p[3] * 1)
535  *(rc + 6 * d[3] * x1 + 2 * d[2] * y1 + x1 * (2 * d[0] * x1 + 4 * d[1] * x1*(r2)+6 * d[4] * x1*r4))
536  ) / exp2 - (fx * 1 * (2 * d[2] * x1 + 2 * d[3] * y1 + x1 * (2 * d[0] * y1 + 4 * d[1] * y1*(r2)+6 * d[4] * y1*r4))
537  *(p[4] * x + p[5] * y + p[6] * z + p[7] * 1)
538  ) / (fy*exp2);
539 
540  return res;
541  }
542 
544  double3 const & v,
545  double rc,
546  double2 const & xy,
547  const calib & cal,
548  const p_matrix & p_mat
549  )
550  {
551  p_matrix res;
552  auto r = cal.rot.rot;
553  double t[3] = { cal.trans.t1, cal.trans.t2, cal.trans.t3 };
554  auto d = cal.coeffs;
555  auto ppx = (double)cal.k_mat.get_ppx();
556  auto ppy = (double)cal.k_mat.get_ppy();
557  auto fx = (double)cal.k_mat.get_fx();
558  auto fy = (double)cal.k_mat.get_fy();
559  auto p = p_mat.vals;
560 
561  auto x1 = (double)xy.x;
562  auto y1 = (double)xy.y;
563 
564  auto x2 = x1 * x1;
565  auto y2 = y1 * y1;
566  auto r2 = x2 + y2;
567  auto r4 = r2 * r2;
568 
569  auto x = v.x;
570  auto y = v.y;
571  auto z = v.z;
572 
573  double exp = p[8] * x + p[9] * y + p[10] * z + p[11] * 1;
574  double exp2 = exp * exp;
575  res.vals[0] = (fy*x*(2*d[2]*x1 + 2*d[3]*y1 + y1*(2*d[0]*x1 + 4*d[1]*x1*(r2)+6*d[4]*x1*r4))
576  )/ (fx*(p[8]*x + p[9]*y + p[10]*z + p[11]*1));
577  res.vals[1] = (fy*y*(2*d[2]*x1 + 2*d[3]*y1 + y1*(2*d[0]*x1 + 4*d[1]*x1*(r2)+6*d[4]*x1*r4))
578  )/ (fx*(p[8]*x + p[9]*y + p[10]*z + p[11]*1));
579  res.vals[2] = (fy*z*(2*d[2]*x1 + 2*d[3]*y1 + y1*(2*d[0]*x1 + 4*d[1]*x1*(r2)+6*d[4]*x1*r4))
580  )/ (fx*(p[8]*x + p[9]*y + p[10]*z + p[11]*1));
581  res.vals[3] = (fy*1*(2*d[2]*x1 + 2*d[3]*y1 + y1*(2*d[0]*x1 + 4*d[1]*x1*(r2)+6*d[4]*x1*r4))
582  )/ (fx*(p[8]*x + p[9]*y + p[10]*z + p[11]*1));
583  res.vals[4] = (x*(rc + 2*d[3]*x1 + 6*d[2]*y1 + y1*(2*d[0]*y1 + 4*d[1]*y1*(r2)+6*d[4]*y1*r4))
584  )/ (p[8]*x + p[9]*y + p[10]*z + p[11]*1);
585  res.vals[5] = (y*(rc + 2*d[3]*x1 + 6*d[2]*y1 + y1*(2*d[0]*y1 + 4*d[1]*y1*(r2)+6*d[4]*y1*r4))
586  )/ (p[8]*x + p[9]*y + p[10]*z + p[11]*1);
587  res.vals[6] = (z*(rc + 2*d[3]*x1 + 6*d[2]*y1 + y1*(2*d[0]*y1 + 4*d[1]*y1*(r2)+6*d[4]*y1*r4))
588  )/ (p[8]*x + p[9]*y + p[10]*z + p[11]*1);
589  res.vals[7] = (1*(rc + 2*d[3]*x1 + 6*d[2]*y1 + y1*(2*d[0]*y1 + 4*d[1]*y1*(r2)+6*d[4]*y1*r4))
590  )/ (p[8]*x + p[9]*y + p[10]*z + p[11]*1);
591  res.vals[8] = - (x*(p[4]*x + p[5]*y + p[6]*z + p[7]*1)
592  *(rc + 2*d[3]*x1 + 6*d[2]*y1 + y1*(2*d[0]*y1 + 4*d[1]*y1*(r2)+6*d[4]*y1*r4))
593  )/ exp2 - (fy*x*(2*d[2]*x1 + 2*d[3]*y1 + y1*(2*d[0]*x1 + 4*d[1]*x1*(r2)+6*d[4]*x1*r4))
594  *(p[0]*x + p[1]*y + p[2]*z + p[3]*1)
595  )/ (fx*exp2);
596  res.vals[9] = - (y*(p[4]*x + p[5]*y + p[6]*z + p[7]*1)
597  *(rc + 2*d[3]*x1 + 6*d[2]*y1 + y1*(2*d[0]*y1 + 4*d[1]*y1*(r2)+6*d[4]*y1*r4))
598  )/ exp2 - (fy*y*(2*d[2]*x1 + 2*d[3]*y1 + y1*(2*d[0]*x1 + 4*d[1]*x1*(r2)+6*d[4]*x1*r4))
599  *(p[0]*x + p[1]*y + p[2]*z + p[3]*1)
600  )/ (fx*exp2);
601  res.vals[10] = - (z*(p[4]*x + p[5]*y + p[6]*z + p[7]*1)
602  *(rc + 2*d[3]*x1 + 6*d[2]*y1 + y1*(2*d[0]*y1 + 4*d[1]*y1*(r2)+6*d[4]*y1*r4))
603  )/ exp2 - (fy*z*(2*d[2]*x1 + 2*d[3]*y1 + y1*(2*d[0]*x1 + 4*d[1]*x1*(r2)+6*d[4]*x1*r4))
604  *(p[0]*x + p[1]*y + p[2]*z + p[3]*1)
605  )/ (fx*exp2);
606  res.vals[11] = - (1*(p[4]*x + p[5]*y + p[6]*z + p[7]*1)
607  *(rc + 2*d[3]*x1 + 6*d[2]*y1 + y1*(2*d[0]*y1 + 4*d[1]*y1*(r2)+6*d[4]*y1*r4))
608  )/ exp2 - (fy*1*(2*d[2]*x1 + 2*d[3]*y1 + y1*(2*d[0]*x1 + 4*d[1]*x1*(r2)+6*d[4]*x1*r4))
609  *(p[0]*x + p[1]*y + p[2]*z + p[3]*1)
610  )/ (fx*exp2);
611  return res;
612  }
613 
615  const z_frame_data & z_data,
616  const yuy2_frame_data & yuy_data,
617  const calib & yuy_intrin_extrin,
618  const std::vector<double>& rc,
619  const std::vector<double2>& xy
620  )
621  {
623  auto engles = extract_angles_from_rotation( yuy_intrin_extrin.rot.rot );
624  auto v = z_data.vertices;
625  res.x_coeffs.resize( v.size() );
626  res.y_coeffs.resize( v.size() );
627 
628  for( auto i = 0; i < v.size(); i++ )
629  {
630  res.x_coeffs[i].alpha = calculate_rotation_x_alpha_coeff( engles, v[i], rc[i], xy[i], yuy_intrin_extrin );
631  res.x_coeffs[i].beta = calculate_rotation_x_beta_coeff( engles, v[i], rc[i], xy[i], yuy_intrin_extrin );
632  res.x_coeffs[i].gamma = calculate_rotation_x_gamma_coeff( engles, v[i], rc[i], xy[i], yuy_intrin_extrin );
633 
634  res.y_coeffs[i].alpha = calculate_rotation_y_alpha_coeff( engles, v[i], rc[i], xy[i], yuy_intrin_extrin );
635  res.y_coeffs[i].beta = calculate_rotation_y_beta_coeff( engles, v[i], rc[i], xy[i], yuy_intrin_extrin );
636  res.y_coeffs[i].gamma = calculate_rotation_y_gamma_coeff( engles, v[i], rc[i], xy[i], yuy_intrin_extrin );
637  }
638 
639  return res;
640  }
641 
642  translation calculate_translation_x_coeff( double3 v, double rc, double2 xy, const calib & yuy_intrin_extrin )
643  {
645 
646  auto x1 = (double)xy.x;
647  auto y1 = (double)xy.y;
648 
649  auto x2 = x1 * x1;
650  auto y2 = y1 * y1;
651  auto xy2 = x2 + y2;
652  auto x2_y2 = xy2 * xy2;
653 
654  auto r = yuy_intrin_extrin.rot.rot;
655  double t[3] = { yuy_intrin_extrin.trans.t1, yuy_intrin_extrin.trans.t2, yuy_intrin_extrin.trans.t3 };
656  auto d = yuy_intrin_extrin.coeffs;
657  auto ppx = (double)yuy_intrin_extrin.k_mat.get_ppx();
658  auto ppy = (double)yuy_intrin_extrin.k_mat.get_ppy();
659  auto fx = (double)yuy_intrin_extrin.k_mat.get_fx();
660  auto fy = (double)yuy_intrin_extrin.k_mat.get_fy();
661 
662  auto x = (double)v.x;
663  auto y = (double)v.y;
664  auto z = (double)v.z;
665 
666  auto exp1 = rc + 6 * (double)d[3] * x1 + 2 * (double)d[2] * y1 + x1 *
667  (2 * (double)d[0] * x1 + 4 * (double)d[1] * x1*(xy2)+6 * (double)d[4] * x1*(x2_y2));
668  auto exp2 = fx * (double)r[2] * x + fx * (double)r[5] * y + fx * (double)r[8] * z + fx * (double)t[2];
669  auto exp3 = (double)r[2] * x + (double)r[5] * y + (double)r[8] * z + (double)t[2];
670 
671  res.t1 = (exp1 * exp2) / (exp3 * exp3);
672 
673  auto exp4 = 2 * (double)d[2] * x1 + 2 * (double)d[3] * y1 + x1 *
674  (2 * (double)d[0] * y1 + 4 * (double)d[1] * y1*xy2 + 6 * (double)d[4] * y1*x2_y2);
675  auto exp5 = -fy * (double)r[2] * x - fy * (double)r[5] * y - fy * (double)r[8] * z - fy * (double)t[2];
676  auto exp6 = (double)r[2] * x + (double)r[5] * y + (double)r[8] * z + (double)t[2];
677 
678  res.t2 = -(fx*exp4 * exp5) / (fy*exp6 * exp6);
679 
680  exp1 = rc + 6 * (double)d[3] * x1 + 2 * (double)d[2] * y1 + x1
681  * (2 * (double)d[0] * x1 + 4 * (double)d[1] * x1*(xy2)+6 * (double)d[4] * x1*x2_y2);
682  exp2 = fx * (double)r[0] * x + fx * (double)r[3] * y + fx * (double)r[6] * z + fx * (double)t[0];
683  exp3 = (double)r[2] * x + (double)r[5] * y + (double)r[8] * z + (double)t[2];
684  exp4 = fx * (2 * (double)d[2] * x1 + 2 * (double)d[3] * y1 +
685  x1 * (2 * (double)d[0] * y1 + 4 * (double)d[1] * y1*(xy2)+6 * (double)d[4] * y1*x2_y2));
686  exp5 = +fy * (double)r[1] * x + fy * (double)r[4] * y + fy * (double)r[7] * z + fy * (double)t[1];
687  exp6 = (double)r[2] * x + (double)r[5] * y + (double)r[8] * z + (double)t[2];
688 
689  res.t3 = -(exp1 * exp2) / (exp3 * exp3) - (exp4 * exp5) / (fy*exp6 * exp6);
690 
691  return res;
692 
693  }
694 
696  const std::vector<double3>& new_vertices,
697  const yuy2_frame_data& yuy_data,
698  const calib & cal,
699  const p_matrix & p_mat,
700  const std::vector<double>& rc,
701  const std::vector<double2>& xy)
702  {
704 
705  auto v = new_vertices;
706  res.y_coeffs.resize(v.size());
707  res.x_coeffs.resize(v.size());
708 
709  for (auto i = 0; i < rc.size(); i++)
710  {
711  res.x_coeffs[i] = calculate_p_x_coeff(v[i], rc[i], xy[i], cal, p_mat);
712  res.y_coeffs[i] = calculate_p_y_coeff(v[i], rc[i], xy[i], cal, p_mat);
713  }
714 
715  return res;
716  }
717 
718 }
719 }
720 }
rotation_in_angles extract_angles_from_rotation(const double r[9])
GLint y
GLfloat GLfloat p
Definition: glext.h:12687
GLdouble GLdouble GLdouble y2
double calculate_rotation_x_gamma_coeff(rotation_in_angles const &rot_angles, double3 const &v, double rc, double2 const &xy, const calib &yuy_intrin_extrin)
Definition: coeffs.cpp:210
double calculate_rotation_x_alpha_coeff(rotation_in_angles const &rot_angles, double3 const &v, double rc, double2 const &xy, const calib &yuy_intrin_extrin)
Definition: coeffs.cpp:14
d
Definition: rmse.py:171
GLdouble GLdouble z
GLdouble t
static double calculate_rotation_x_beta_coeff(rotation_in_angles const &rot_angles, double3 const &v, double rc, double2 const &xy, const calib &yuy_intrin_extrin)
Definition: coeffs.cpp:119
translation calculate_translation_x_coeff(double3 v, double rc, double2 xy, const calib &yuy_intrin_extrin)
Definition: coeffs.cpp:642
GLdouble GLdouble r
GLdouble x
GLdouble GLdouble x2
coeffs< rotation_in_angles > calc_rotation_coefs(const z_frame_data &z_data, const yuy2_frame_data &yuy_data, const calib &yuy_intrin_extrin, const std::vector< double > &rc, const std::vector< double2 > &xy)
Definition: coeffs.cpp:614
p_matrix calculate_p_x_coeff(double3 const &v, double rc, double2 const &xy, const calib &cal, const p_matrix &p_mat)
Definition: coeffs.cpp:454
double calculate_rotation_y_alpha_coeff(rotation_in_angles const &rot_angles, double3 const &v, double rc, double2 const &xy, const calib &yuy_intrin_extrin)
Definition: coeffs.cpp:280
double calculate_rotation_y_gamma_coeff(rotation_in_angles const &rot_angles, double3 const &v, double rc, double2 const &xy, const calib &yuy_intrin_extrin)
Definition: coeffs.cpp:396
GLuint GLfloat GLfloat GLfloat x1
Definition: glext.h:9721
coeffs< p_matrix > calc_p_coefs(const z_frame_data &z_data, const std::vector< double3 > &new_vertices, const yuy2_frame_data &yuy_data, const calib &cal, const p_matrix &p_mat, const std::vector< double > &rc, const std::vector< double2 > &xy)
Definition: coeffs.cpp:695
double calculate_rotation_y_beta_coeff(rotation_in_angles const &rot_angles, double3 const &v, double rc, double2 const &xy, const calib &yuy_intrin_extrin)
Definition: coeffs.cpp:339
int i
GLuint res
Definition: glext.h:8856
GLdouble v
GLdouble y1
p_matrix calculate_p_y_coeff(double3 const &v, double rc, double2 const &xy, const calib &cal, const p_matrix &p_mat)
Definition: coeffs.cpp:543


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:11