00001 #ifndef LIE_ALGEBRA_HPP_ 00002 #define LIE_ALGEBRA_HPP_ 00003 00004 class LieAlgebra 00005 { 00006 public: 00007 //computes dot-product of each column in src with each basis vector 00008 void dot(const cv::Mat &src, cv::Mat &dst) const; 00009 00010 //transform coordinates in the Lie algebra basis to a matrix in the Lie group 00011 cv::Mat algebra2group(const cv::Mat &lieAlgebraCoords) const; 00012 00013 virtual ~LieAlgebra() 00014 { 00015 } 00016 protected: 00017 LieAlgebra() 00018 { 00019 } 00020 00021 class LieAlgebraBasisVector 00022 { 00023 public: 00024 void addPositive(int idx) 00025 { 00026 positives.push_back(idx); 00027 } 00028 void addNegative(int idx) 00029 { 00030 negatives.push_back(idx); 00031 } 00032 00033 //computes dot-product of each column in src with basis vector 00034 void dot(const cv::Mat &src, cv::Mat dst) const; 00035 cv::Mat vector2mat(double coordinate) const; 00036 private: 00037 std::vector<int> positives; 00038 std::vector<int> negatives; 00039 }; 00040 00041 static cv::Mat matrixExp(const cv::Mat &mat); 00042 00043 std::vector<LieAlgebraBasisVector> basis; 00044 }; 00045 00046 class LieAlgebraHomography : public LieAlgebra 00047 { 00048 public: 00049 LieAlgebraHomography(); 00050 }; 00051 00052 class LieAlgebraRotation3d : public LieAlgebra 00053 { 00054 public: 00055 LieAlgebraRotation3d(); 00056 }; 00057 00058 class LieAlgebraTranslation : public LieAlgebra 00059 { 00060 public: 00061 LieAlgebraTranslation(); 00062 }; 00063 00064 class LieAlgebraEuclidean : public LieAlgebraTranslation 00065 { 00066 public: 00067 LieAlgebraEuclidean(); 00068 }; 00069 00070 class LieAlgebraSimilarity : public LieAlgebraEuclidean 00071 { 00072 public: 00073 LieAlgebraSimilarity(); 00074 }; 00075 00076 class LieAlgebraAffine : public LieAlgebra 00077 { 00078 public: 00079 LieAlgebraAffine(); 00080 }; 00081 00082 #endif /* LIE_ALGEBRA_HPP_ */