Go to the documentation of this file.00001
00002
00003 #ifndef HOMOGRAPHY33_H
00004 #define HOMOGRAPHY33_H
00005
00006 #include <utility>
00007 #include <vector>
00008
00009 #include <Eigen/Dense>
00010
00011
00012 #define INTERPOLATE
00013
00014 #define STABLE_H
00015
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 class Homography33 {
00042 public:
00044 Homography33(const std::pair<float,float> &opticalCenter);
00045
00046 #ifdef STABLE_H
00047 void setCorrespondences(const std::vector< std::pair<float,float> > &srcPts,
00048 const std::vector< std::pair<float,float> > &dstPts);
00049 #else
00050 void addCorrespondence(float worldx, float worldy, float imagex, float imagey);
00051 #endif
00052
00054 Eigen::Matrix3d& getH();
00055
00056 const std::pair<float,float> getCXY() const { return cxy; }
00057
00058 void compute();
00059
00060 std::pair<float,float> project(float worldx, float worldy);
00061
00062 private:
00063 std::pair<float,float> cxy;
00064 Eigen::Matrix<double,9,9> fA;
00065 Eigen::Matrix3d H;
00066 bool valid;
00067 #ifdef STABLE_H
00068 std::vector< std::pair<float,float> > srcPts, dstPts;
00069 #endif
00070 };
00071
00072 #endif