SLAMflex SE  0.1.0
SLAMflex provides detection and tracking of dominant planes for smartphone devices. This plane can then be used to show AR content relative to the plane orientation. The detection of plane is performed in the field of view of the smartphone camera. In subsequent frames it is tracked. The interface returns the plane position and orientation.
se3.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 
3 // Copyright (C) 2005,2009 Tom Drummond (twd20@cam.ac.uk)
4 //
5 // This file is part of the TooN Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 2, or (at your option)
9 // any later version.
10 
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING. If not, write to the Free
18 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19 // USA.
20 
21 // As a special exception, you may use this file as part of a free software
22 // library without restriction. Specifically, if other files instantiate
23 // templates or use macros or inline functions from this file, or you compile
24 // this file and link it with other files to produce an executable, this
25 // file does not by itself cause the resulting executable to be covered by
26 // the GNU General Public License. This exception does not however
27 // invalidate any other reasons why the executable file might be covered by
28 // the GNU General Public License.
29 
30 #ifndef TOON_INCLUDE_SE3_H
31 #define TOON_INCLUDE_SE3_H
32 
33 #include "so3.h"
34 
35 namespace TooN {
36 
37 
49 template <typename Precision = double>
50 class SE3 {
51 public:
53  inline SE3() : my_translation(Zeros) {}
54 
55  template <int S, typename P, typename A>
56  SE3(const SO3<Precision> & R, const Vector<S, P, A>& T) : my_rotation(R), my_translation(T) {}
57  template <int S, typename P, typename A>
58  SE3(const Vector<S, P, A> & v) { *this = exp(v); }
59 
60  template <class IP, int S, typename P, typename A>
62 
66  inline const SO3<Precision>& get_rotation() const {return my_rotation;}
67 
71  inline const Vector<3, Precision>& get_translation() const {return my_translation;}
72 
76  template <int S, typename P, typename A>
77  static inline SE3 exp(const Vector<S, P, A>& vect);
78 
79 
82  static inline Vector<6, Precision> ln(const SE3& se3);
84  inline Vector<6, Precision> ln() const { return SE3::ln(*this); }
85 
86  inline SE3 inverse() const {
87  const SO3<Precision> rinv = get_rotation().inverse();
88  return SE3(rinv, -(rinv*my_translation));
89  }
90 
93  inline SE3& operator *=(const SE3& rhs) {
95  get_rotation() *= rhs.get_rotation();
96  return *this;
97  }
98 
101  template<typename P>
104  }
105 
106  inline SE3& left_multiply_by(const SE3& left) {
108  get_rotation() = left.get_rotation() * get_rotation();
109  return *this;
110  }
111 
112  static inline Matrix<4,4,Precision> generator(int i){
114  if(i < 3){
115  result[i][3]=1;
116  return result;
117  }
118  result[(i+1)%3][(i+2)%3] = -1;
119  result[(i+2)%3][(i+1)%3] = 1;
120  return result;
121  }
122 
124  template<typename Base>
126  {
127  Vector<4, Precision> result(Zeros);
128  if(i < 3){
129  result[i]=pos[3];
130  return result;
131  }
132  result[(i+1)%3] = - pos[(i+2)%3];
133  result[(i+2)%3] = pos[(i+1)%3];
134  return result;
135  }
136 
142  template<int S, typename P2, typename Accessor>
143  inline Vector<6, Precision> adjoint(const Vector<S,P2, Accessor>& vect)const;
144 
147  template<int S, typename P2, typename Accessor>
149 
151  template <int R, int C, typename P2, typename Accessor>
153 
155  template <int R, int C, typename P2, typename Accessor>
157 
158 private:
161 };
162 
163 // transfers a vector in the Lie algebra
164 // from one coord frame to another
165 // so that exp(adjoint(vect)) = (*this) * exp(vect) * (this->inverse())
166 template<typename Precision>
167 template<int S, typename P2, typename Accessor>
169  SizeMismatch<6,S>::test(6, vect.size());
170  Vector<6, Precision> result;
171  result.template slice<3,3>() = get_rotation() * vect.template slice<3,3>();
172  result.template slice<0,3>() = get_rotation() * vect.template slice<0,3>();
173  result.template slice<0,3>() += get_translation() ^ result.template slice<3,3>();
174  return result;
175 }
176 
177 // tansfers covectors between frames
178 // (using the transpose of the inverse of the adjoint)
179 // so that trinvadjoint(vect1) * adjoint(vect2) = vect1 * vect2
180 template<typename Precision>
181 template<int S, typename P2, typename Accessor>
183  SizeMismatch<6,S>::test(6, vect.size());
184  Vector<6, Precision> result;
185  result.template slice<3,3>() = get_rotation() * vect.template slice<3,3>();
186  result.template slice<0,3>() = get_rotation() * vect.template slice<0,3>();
187  result.template slice<3,3>() += get_translation() ^ result.template slice<0,3>();
188  return result;
189 }
190 
191 template<typename Precision>
192 template<int R, int C, typename P2, typename Accessor>
194  SizeMismatch<6,R>::test(6, M.num_cols());
195  SizeMismatch<6,C>::test(6, M.num_rows());
196 
197  Matrix<6,6,Precision> result;
198  for(int i=0; i<6; i++){
199  result.T()[i] = adjoint(M.T()[i]);
200  }
201  for(int i=0; i<6; i++){
202  result[i] = adjoint(result[i]);
203  }
204  return result;
205 }
206 
207 template<typename Precision>
208 template<int R, int C, typename P2, typename Accessor>
210  SizeMismatch<6,R>::test(6, M.num_cols());
211  SizeMismatch<6,C>::test(6, M.num_rows());
212 
213  Matrix<6,6,Precision> result;
214  for(int i=0; i<6; i++){
215  result.T()[i] = trinvadjoint(M.T()[i]);
216  }
217  for(int i=0; i<6; i++){
218  result[i] = trinvadjoint(result[i]);
219  }
220  return result;
221 }
222 
225 template <typename Precision>
226 inline std::ostream& operator <<(std::ostream& os, const SE3<Precision>& rhs){
227  std::streamsize fw = os.width();
228  for(int i=0; i<3; i++){
229  os.width(fw);
230  os << rhs.get_rotation().get_matrix()[i];
231  os.width(fw);
232  os << rhs.get_translation()[i] << '\n';
233  }
234  return os;
235 }
236 
237 
240 template <typename Precision>
241 inline std::istream& operator>>(std::istream& is, SE3<Precision>& rhs){
242  for(int i=0; i<3; i++){
243  is >> rhs.get_rotation().my_matrix[i].ref() >> rhs.get_translation()[i];
244  }
245  rhs.get_rotation().coerce();
246  return is;
247 }
248 
250 // operator * //
251 // SE3 * Vector //
253 
254 namespace Internal {
255 template<int S, typename PV, typename A, typename P>
256 struct SE3VMult;
257 }
258 
259 template<int S, typename PV, typename A, typename P>
260 struct Operator<Internal::SE3VMult<S,PV,A,P> > {
261  const SE3<P> & lhs;
263 
264  Operator(const SE3<P> & l, const Vector<S,PV,A> & r ) : lhs(l), rhs(r) {}
265 
266  template <int S0, typename P0, typename A0>
267  void eval(Vector<S0, P0, A0> & res ) const {
268  SizeMismatch<4,S>::test(4, rhs.size());
269  res.template slice<0,3>()=lhs.get_rotation() * rhs.template slice<0,3>();
270  res.template slice<0,3>()+=lhs.get_translation() * rhs[3];
271  res[3] = rhs[3];
272  }
273  int size() const { return 4; }
274 };
275 
278 template<int S, typename PV, typename A, typename P> inline
281 }
282 
285 template <typename PV, typename A, typename P> inline
287  return lhs.get_translation() + lhs.get_rotation() * rhs;
288 }
289 
291 // operator * //
292 // Vector * SE3 //
294 
295 namespace Internal {
296 template<int S, typename PV, typename A, typename P>
297 struct VSE3Mult;
298 }
299 
300 template<int S, typename PV, typename A, typename P>
301 struct Operator<Internal::VSE3Mult<S,PV,A,P> > {
303  const SE3<P> & rhs;
304 
305  Operator( const Vector<S,PV,A> & l, const SE3<P> & r ) : lhs(l), rhs(r) {}
306 
307  template <int S0, typename P0, typename A0>
308  void eval(Vector<S0, P0, A0> & res ) const {
309  SizeMismatch<4,S>::test(4, lhs.size());
310  res.template slice<0,3>()=lhs.template slice<0,3>() * rhs.get_rotation();
311  res[3] = lhs[3];
312  res[3] += lhs.template slice<0,3>() * rhs.get_translation();
313  }
314  int size() const { return 4; }
315 };
316 
319 template<int S, typename PV, typename A, typename P> inline
322 }
323 
325 // operator * //
326 // SE3 * Matrix //
328 
329 namespace Internal {
330 template <int R, int C, typename PM, typename A, typename P>
331 struct SE3MMult;
332 }
333 
334 template<int R, int Cols, typename PM, typename A, typename P>
335 struct Operator<Internal::SE3MMult<R, Cols, PM, A, P> > {
336  const SE3<P> & lhs;
338 
339  Operator(const SE3<P> & l, const Matrix<R,Cols,PM,A> & r ) : lhs(l), rhs(r) {}
340 
341  template <int R0, int C0, typename P0, typename A0>
342  void eval(Matrix<R0, C0, P0, A0> & res ) const {
343  SizeMismatch<4,R>::test(4, rhs.num_rows());
344  for(int i=0; i<rhs.num_cols(); ++i)
345  res.T()[i] = lhs * rhs.T()[i];
346  }
347  int num_cols() const { return rhs.num_cols(); }
348  int num_rows() const { return 4; }
349 };
350 
353 template <int R, int Cols, typename PM, typename A, typename P> inline
356 }
357 
359 // operator * //
360 // Matrix * SE3 //
362 
363 namespace Internal {
364 template <int Rows, int C, typename PM, typename A, typename P>
365 struct MSE3Mult;
366 }
367 
368 template<int Rows, int C, typename PM, typename A, typename P>
369 struct Operator<Internal::MSE3Mult<Rows, C, PM, A, P> > {
371  const SE3<P> & rhs;
372 
373  Operator( const Matrix<Rows,C,PM,A> & l, const SE3<P> & r ) : lhs(l), rhs(r) {}
374 
375  template <int R0, int C0, typename P0, typename A0>
376  void eval(Matrix<R0, C0, P0, A0> & res ) const {
377  SizeMismatch<4, C>::test(4, lhs.num_cols());
378  for(int i=0; i<lhs.num_rows(); ++i)
379  res[i] = lhs[i] * rhs;
380  }
381  int num_cols() const { return 4; }
382  int num_rows() const { return lhs.num_rows(); }
383 };
384 
387 template <int Rows, int C, typename PM, typename A, typename P> inline
390 }
391 
392 template <typename Precision>
393 template <int S, typename P, typename VA>
395  SizeMismatch<6,S>::test(6, mu.size());
396  static const Precision one_6th = 1.0/6.0;
397  static const Precision one_20th = 1.0/20.0;
398 
399  SE3<Precision> result;
400 
401  const Vector<3,Precision> w = mu.template slice<3,3>();
402  const Precision theta_sq = w*w;
403  const Precision theta = sqrt(theta_sq);
404  Precision A, B;
405 
406  const Vector<3,Precision> cross = w ^ mu.template slice<0,3>();
407  if (theta_sq < 1e-8) {
408  A = 1.0 - one_6th * theta_sq;
409  B = 0.5;
410  result.get_translation() = mu.template slice<0,3>() + 0.5 * cross;
411  } else {
412  Precision C;
413  if (theta_sq < 1e-6) {
414  C = one_6th*(1.0 - one_20th * theta_sq);
415  A = 1.0 - theta_sq * C;
416  B = 0.5 - 0.25 * one_6th * theta_sq;
417  } else {
418  const Precision inv_theta = 1.0/theta;
419  A = sin(theta) * inv_theta;
420  B = (1 - cos(theta)) * (inv_theta * inv_theta);
421  C = (1 - A) * (inv_theta * inv_theta);
422  }
423  result.get_translation() = mu.template slice<0,3>() + TooN::operator*(B, cross) + TooN::operator*(C, (w ^ cross));
424  }
425  rodrigues_so3_exp(w, A, B, result.get_rotation().my_matrix);
426  return result;
427 }
428 
429 template <typename Precision>
431  Vector<3,Precision> rot = se3.get_rotation().ln();
432  const Precision theta = sqrt(rot*rot);
433 
434  Precision shtot = 0.5;
435  if(theta > 0.00001) {
436  shtot = sin(theta/2)/theta;
437  }
438 
439  // now do the rotation
440  const SO3<Precision> halfrotator = SO3<Precision>::exp(rot * -0.5);
441  Vector<3, Precision> rottrans = halfrotator * se3.get_translation();
442 
443  if(theta > 0.001){
444  rottrans -= TooN::operator*(rot, ((se3.get_translation() * rot) * (1-2*shtot) / (rot*rot)));
445  } else {
446  rottrans -= TooN::operator*(rot, ((se3.get_translation() * rot)/24));
447  }
448 
449  rottrans /= (2 * shtot);
450 
451  Vector<6, Precision> result;
452  result.template slice<0,3>()=rottrans;
453  result.template slice<3,3>()=rot;
454  return result;
455 }
456 
457 template <typename Precision>
458 inline SE3<Precision> operator*(const SO3<Precision>& lhs, const SE3<Precision>& rhs){
459  return SE3<Precision>(lhs*rhs.get_rotation(),lhs*rhs.get_translation());
460 }
461 
462 #if 0 // should be moved to another header file
463 
464  template <class A> inline
465  Vector<3> transform(const SE3& pose, const FixedVector<3,A>& x) { return pose.get_rotation()*x + pose.get_translation(); }
466 
467  template <class A> inline
468  Vector<3> transform_inverse_depth(const SE3& pose, const FixedVector<3,A>& uvq)
469  {
470  const Matrix<3>& R = pose.get_rotation().get_matrix();
471  const Vector<3> DqT = R.template slice<0,0,3,2>() * uvq.template slice<0,2>() + R.T()[2] + uvq[2] * pose.get_translation();
472  const double inv_z = 1.0/ DqT[2];
473  return makeVector(DqT[0]*inv_z, DqT[1]*inv_z, uvq[2]*inv_z);
474  }
475 
476  template <class A1, class A2> inline
477  Vector<3> transform(const SE3& pose, const FixedVector<3,A1>& x, FixedMatrix<3,3,A2>& J_x)
478  {
479  J_x = pose.get_rotation().get_matrix();
480  return pose * x;
481  }
482 
483 
484  template <class A1, class A2> inline
485  Vector<3> inverse_depth_point_jacobian(const SE3& pose, const double q, const FixedVector<3,A1>& DqT, const double inv_z, FixedMatrix<3,3,A2>& J_uvq)
486  {
487  const Matrix<3>& R = pose.get_rotation().get_matrix();
488  const Vector<3>& T = pose.get_translation();
489  const double u1 = DqT[0] * inv_z;
490  J_uvq[0][0] = inv_z * (R[0][0] - u1*R[2][0]);
491  J_uvq[0][1] = inv_z * (R[0][1] - u1*R[2][1]);
492  J_uvq[0][2] = inv_z * (T[0] - u1 * T[2]);
493 
494  const double v1 = DqT[1] * inv_z;
495  J_uvq[1][0] = inv_z * (R[1][0] - v1*R[2][0]);
496  J_uvq[1][1] = inv_z * (R[1][1] - v1*R[2][1]);
497  J_uvq[1][2] = inv_z * (T[1] - v1 * T[2]);
498 
499  const double q1 = q * inv_z;
500  J_uvq[2][0] = inv_z * (-q1 * R[2][0]);
501  J_uvq[2][1] = inv_z * (-q1 * R[2][1]);
502  J_uvq[2][2] = inv_z * (1.0 - q1 * T[2]);
503 
504  return makeVector(u1, v1, q1);
505  }
506 
507 
508  template <class A1, class A2> inline
509  Vector<3> transform_inverse_depth(const SE3& pose, const FixedVector<3,A1>& uvq, FixedMatrix<3,3,A2>& J_uvq)
510  {
511  const Matrix<3>& R = pose.get_rotation().get_matrix();
512  const Vector<3>& T = pose.get_translation();
513  const double q = uvq[2];
514  const Vector<3> DqT = R.template slice<0,0,3,2>() * uvq.template slice<0,2>() + R.T()[2] + q * T;
515  const double inv_z = 1.0 / DqT[2];
516 
517  return inverse_depth_point_jacobian(pose, q, DqT, inv_z, J_uvq);
518  }
519 
520  template <class A1, class A2, class A3> inline
521  Vector<3> transform(const SE3& pose, const FixedVector<3,A1>& x, FixedMatrix<3,3,A2>& J_x, FixedMatrix<3,6,A3>& J_pose)
522  {
523  J_x = pose.get_rotation().get_matrix();
524  Identity(J_pose.template slice<0,0,3,3>());
525  const Vector<3> cx = pose * x;
526  J_pose[0][3] = J_pose[1][4] = J_pose[2][5] = 0;
527  J_pose[1][3] = -(J_pose[0][4] = cx[2]);
528  J_pose[0][5] = -(J_pose[2][3] = cx[1]);
529  J_pose[2][4] = -(J_pose[1][5] = cx[0]);
530  return cx;
531  }
532 
533  template <class A1, class A2, class A3> inline
534  Vector<3> transform_inverse_depth(const SE3& pose, const FixedVector<3,A1>& uvq, FixedMatrix<3,3,A2>& J_uvq, FixedMatrix<3,6,A3>& J_pose)
535  {
536  const Matrix<3>& R = pose.get_rotation().get_matrix();
537  const Vector<3>& T = pose.get_translation();
538  const double q = uvq[2];
539  const Vector<3> DqT = R.template slice<0,0,3,2>() * uvq.template slice<0,2>() + R.T()[2] + q * T;
540  const double inv_z = 1.0 / DqT[2];
541 
542  const Vector<3> uvq1 = inverse_depth_point_jacobian(pose, q, DqT, inv_z, J_uvq);
543  const double q1 = uvq1[2];
544 
545  J_pose[0][1] = J_pose[1][0] = J_pose[2][0] = J_pose[2][1] = 0;
546  J_pose[0][0] = J_pose[1][1] = q1;
547  J_pose[0][2] = -uvq1[0] * q1;
548  J_pose[1][2] = -uvq1[1] * q1;
549  J_pose[2][2] = -q1 * q1;
550 
551  J_pose[0][3] = -uvq1[1]*uvq1[0];
552  J_pose[0][4] = 1 + uvq1[0]*uvq1[0];
553  J_pose[0][5] = -uvq1[1];
554 
555  J_pose[1][3] = -1 - uvq1[1]*uvq1[1];
556  J_pose[1][4] = uvq1[0] * uvq1[1];
557  J_pose[1][5] = uvq1[0];
558 
559  J_pose[2][3] = -uvq1[1]*q1;
560  J_pose[2][4] = uvq1[0]*q1;
561  J_pose[2][5] = 0;
562 
563  return uvq1;
564  }
565 
566  template <class A1, class A2, class A3> inline
567  Vector<2> project_transformed_point(const SE3& pose, const FixedVector<3,A1>& in_frame, FixedMatrix<2,3,A2>& J_x, FixedMatrix<2,6,A3>& J_pose)
568  {
569  const double z_inv = 1.0/in_frame[2];
570  const double x_z_inv = in_frame[0]*z_inv;
571  const double y_z_inv = in_frame[1]*z_inv;
572  const double cross = x_z_inv * y_z_inv;
573  J_pose[0][0] = J_pose[1][1] = z_inv;
574  J_pose[0][1] = J_pose[1][0] = 0;
575  J_pose[0][2] = -x_z_inv * z_inv;
576  J_pose[1][2] = -y_z_inv * z_inv;
577  J_pose[0][3] = -cross;
578  J_pose[0][4] = 1 + x_z_inv*x_z_inv;
579  J_pose[0][5] = -y_z_inv;
580  J_pose[1][3] = -1 - y_z_inv*y_z_inv;
581  J_pose[1][4] = cross;
582  J_pose[1][5] = x_z_inv;
583 
584  const TooN::Matrix<3>& R = pose.get_rotation().get_matrix();
585  J_x[0][0] = z_inv*(R[0][0] - x_z_inv * R[2][0]);
586  J_x[0][1] = z_inv*(R[0][1] - x_z_inv * R[2][1]);
587  J_x[0][2] = z_inv*(R[0][2] - x_z_inv * R[2][2]);
588  J_x[1][0] = z_inv*(R[1][0] - y_z_inv * R[2][0]);
589  J_x[1][1] = z_inv*(R[1][1] - y_z_inv * R[2][1]);
590  J_x[1][2] = z_inv*(R[1][2] - y_z_inv * R[2][2]);
591 
592  return makeVector(x_z_inv, y_z_inv);
593  }
594 
595 
596  template <class A1> inline
597  Vector<2> transform_and_project(const SE3& pose, const FixedVector<3,A1>& x)
598  {
599  return project(transform(pose,x));
600  }
601 
602  template <class A1> inline
603  Vector<2> transform_and_project_inverse_depth(const SE3& pose, const FixedVector<3,A1>& uvq)
604  {
605  const Matrix<3>& R = pose.get_rotation().get_matrix();
606  const Vector<3>& T = pose.get_translation();
607  const Vector<3> DqT = R.template slice<0,0,3,2>() * uvq.template slice<0,2>() + R.T()[2] + uvq[2] * T;
608  return project(DqT);
609  }
610 
611  template <class A1, class A2, class A3> inline
612  Vector<2> transform_and_project(const SE3& pose, const FixedVector<3,A1>& x, FixedMatrix<2,3,A2>& J_x, FixedMatrix<2,6,A3>& J_pose)
613  {
614  return project_transformed_point(pose, transform(pose,x), J_x, J_pose);
615  }
616 
617  template <class A1, class A2, class A3> inline
618  Vector<2> transform_and_project_inverse_depth(const SE3& pose, const FixedVector<3,A1>& uvq, FixedMatrix<2,3,A2>& J_uvq, FixedMatrix<2,6,A3>& J_pose)
619  {
620  const Matrix<3>& R = pose.get_rotation().get_matrix();
621  const Vector<3>& T = pose.get_translation();
622  const double q = uvq[2];
623  const Vector<3> DqT = R.template slice<0,0,3,2>() * uvq.template slice<0,2>() + R.T()[2] + q * T;
624  const Vector<2> uv = project_transformed_point(pose, DqT, J_uvq, J_pose);
625  J_uvq.T()[2] = J_pose.template slice<0,0,2,3>() * pose.get_translation();
626  J_pose.template slice<0,0,2,3>() *= q;
627  return uv;
628  }
629 
630 #endif
631 
632 }
633 
634 #endif
SE3(const Vector< S, P, A > &v)
Definition: se3.h:58
static SO3 exp(const Vector< S, VP, A > &vect)
Definition: so3.h:39
static SE3 exp(const Vector< S, P, A > &vect)
SO3< Precision > & get_rotation()
Returns the rotation part of the transformation as a SO3.
Definition: se3.h:64
static Operator< Internal::Identity< Internal::One > > Identity
Definition: objects.h:748
Vector< 3, typename Internal::MultiplyType< P, PV >::type > operator*(const SE3< P > &lhs, const Vector< 3, PV, A > &rhs)
Definition: se3.h:286
SE3< typename Internal::MultiplyType< Precision, P >::type > operator*(const SE3< P > &rhs) const
Definition: se3.h:102
const Vector< 3, Precision > & get_translation() const
Definition: se3.h:71
Everything lives inside this namespace.
Definition: allocator.hh:48
void eval(Matrix< R0, C0, P0, A0 > &res) const
Definition: se3.h:342
static void test(int s1, int s2)
SE3(const SO3< Precision > &R, const Vector< S, P, A > &T)
Definition: se3.h:56
Vector< 6, Precision > adjoint(const Vector< S, P2, Accessor > &vect) const
Definition: se3.h:168
Matrix< 4, Cols, typename Internal::MultiplyType< P, PM >::type > operator*(const SE3< P > &lhs, const Matrix< R, Cols, PM, A > &rhs)
Definition: se3.h:354
SE3 inverse() const
Definition: se3.h:86
Vector< 6, Precision > ln() const
Definition: se3.h:84
const Matrix< R, Cols, PM, A > & rhs
Definition: se3.h:337
Operator(const SE3< P > &l, const Vector< S, PV, A > &r)
Definition: se3.h:264
std::istream & operator>>(std::istream &is, SE3< Precision > &rhs)
Definition: se3.h:241
Definition: se3.h:50
int transform(const BasicImage< S > &in, BasicImage< T > &out, const TooN::Matrix< 2 > &M, const TooN::Vector< 2 > &inOrig, const TooN::Vector< 2 > &outOrig, const T defaultValue=T())
Definition: vision.h:304
static Vector< 4, Precision > generator_field(int i, const Vector< 4, Precision, Base > &pos)
Returns the i-th generator times pos.
Definition: se3.h:125
void eval(Matrix< R0, C0, P0, A0 > &res) const
Definition: se3.h:376
SE3 & left_multiply_by(const SE3 &left)
Definition: se3.h:106
Operator(const Vector< S, PV, A > &l, const SE3< P > &r)
Definition: se3.h:305
Vector< 3, Precision > & get_translation()
Returns the translation part of the transformation as a Vector.
Definition: se3.h:69
const Matrix< Rows, C, PM, A > & lhs
Definition: se3.h:370
Vector< 1 > makeVector(double x1)
Definition: make_vector.hh:4
Vector< 4, typename Internal::MultiplyType< P, PV >::type > operator*(const Vector< S, PV, A > &lhs, const SE3< P > &rhs)
Definition: se3.h:320
SE3()
Default constructor. Initialises the the rotation to zero (the identity) and the translation to zero...
Definition: se3.h:53
Vector< 3, Precision > my_translation
Definition: se3.h:160
Matrix< Rows, 4, typename Internal::MultiplyType< PM, P >::type > operator*(const Matrix< Rows, C, PM, A > &lhs, const SE3< P > &rhs)
Definition: se3.h:388
const SO3< Precision > & get_rotation() const
Definition: se3.h:66
Operator(const Matrix< Rows, C, PM, A > &l, const SE3< P > &r)
Definition: se3.h:373
void eval(Vector< S0, P0, A0 > &res) const
Definition: se3.h:267
Operator(const SE3< P > &l, const Matrix< R, Cols, PM, A > &r)
Definition: se3.h:339
SO3< Precision > my_rotation
Definition: se3.h:159
SE3(const Operator< Internal::Identity< IP > > &, const Vector< S, P, A > &T)
Definition: se3.h:61
static Matrix< 4, 4, Precision > generator(int i)
Definition: se3.h:112
Vector< 6, Precision > trinvadjoint(const Vector< S, P2, Accessor > &vect) const
Definition: se3.h:182
Vector< Internal::Sizer< S1, S2 >::size, typename Internal::MultiplyType< P1, P2 >::type > operator*(const DiagonalMatrix< S1, P1, B1 > &d, const Vector< S2, P2, B2 > &v)
Definition: diagmatrix.h:111
static Operator< Internal::Zero > Zeros
Definition: objects.h:727
void eval(Vector< S0, P0, A0 > &res) const
Definition: se3.h:308
Vector<(Size==Dynamic?Dynamic:Size-1), Precision > project(const Vector< Size, Precision, Base > &v)
Definition: helpers.h:157
SE3 & operator*=(const SE3 &rhs)
Definition: se3.h:93
Vector< 4, typename Internal::MultiplyType< P, PV >::type > operator*(const SE3< P > &lhs, const Vector< S, PV, A > &rhs)
Definition: se3.h:279