Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RMatrix.hh
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003-2009 (see file CONTACT for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 
26 #ifndef _BIAS_RMatrix_hh_
27 #define _BIAS_RMatrix_hh_
28 
29 #include "bias_config.h"
30 
31 #include <Base/Math/Vector3.hh>
32 #include <Base/Math/Vector4.hh>
33 #include <Base/Math/Matrix3x3.hh>
34 #include <Base/Debug/Debug.hh>
35 #include <Base/Geometry/RMatrixBase.hh>
36 #include <Base/Geometry/Quaternion.hh>
37 
38 namespace BIAS {
39 
40 /** @class RMatrix
41  * @test tested with TestRMatrix.cpp
42  @ingroup g_geometry
43  @brief 3D rotation matrix
44 
45  @author JMF
46  @status finished (07/05/2002)
47 **/
48 
49  class BIASGeometry_EXPORT RMatrix : public RMatrixBase {
50 
51  public:
52 
55 
56  explicit RMatrix(const MatrixInitType& i)
57  : RMatrixBase(i) {};
58 
59  /// initialization from rotation axis w and angle phi (Rodriguez)
60  RMatrix(Vector3<ROTATION_MATRIX_TYPE> w, ROTATION_MATRIX_TYPE phi)
61  : RMatrixBase(w,phi) {};
62 
63  virtual ~RMatrix();
64 
66  : RMatrixBase(mat) {};
67 
69 
70  /** Enforce orthonormality constraints and right-handed rotation with SVD
71  @author koeser */
72  virtual void EnforceConstraints();
73 
74  /** Compute average rotation by pairwise weighted averaging of matrices
75  @param vecR vector containt rotation matrices
76  @return average rotation matrix with minimal distance to all in vecR
77  @attention unfinished code
78  @author koeser */
79  RMatrix GetAverageRMatrix(std::vector<RMatrix>& vecR,
80  bool RefineRotation = true) ;
81 
82  std::vector<RMatrix> *pvecR_;
83 
85 
87 
88  };
89 
90 } // namespace BIAS
91 
92 #endif
RMatrix(const Matrix3x3< ROTATION_MATRIX_TYPE > &mat)
Definition: RMatrix.hh:65
MatrixInitType
can be passed to matrix constructors to init the matrix with the most often used values ...
Definition: Matrix.hh:59
std::vector< RMatrix > * pvecR_
Definition: RMatrix.hh:82
double bestErrorSoFar_
Definition: RMatrix.hh:84
3D rotation matrix
Definition: RMatrix.hh:49
RMatrix(Vector3< ROTATION_MATRIX_TYPE > w, ROTATION_MATRIX_TYPE phi)
initialization from rotation axis w and angle phi (Rodriguez)
Definition: RMatrix.hh:60
Quaternion< double > bestQuaternionSoFar_
Definition: RMatrix.hh:86
class Vector3 contains a Vector of fixed dim.
Definition: Matrix.hh:53
RMatrix(const MatrixInitType &i)
Definition: RMatrix.hh:56
Implements a 3D rotation matrix.
Definition: RMatrixBase.hh:44