00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __lsurf_homography_h
00022 #define __lsurf_homography_h
00023
00024 #include <iostream>
00025 using namespace std;
00026
00027 #include "PointMatch.h"
00028 #include <vector>
00029
00030 namespace lfeat
00031 {
00032
00033 class LFIMPEX Homography
00034 {
00035 public:
00036 Homography();
00037 ~Homography();
00038
00039 void initMatchesNormalization(PointMatchVector_t& iMatches);
00040
00041 bool estimate(PointMatchVector_t& iMatches);
00042
00043 friend ostream& operator<< (ostream& o, const Homography& H);
00044
00045 void transformPoint(double iX, double iY, double& oX, double& oY);
00046
00047
00048 private:
00049 void initialize(void);
00050
00051 void addMatch(int iIndex, PointMatch& iMatch);
00052
00053 double** AA;
00054 double* B, * X, *r;
00055
00056 static const int kNCols;
00057
00058
00059 void allocMemory(int iNPoints);
00060 void freeMemory();
00061
00062
00063 double** _Amat;
00064 double* _Bvec;
00065 double* _Rvec;
00066 double* _Xvec;
00067
00068 public:
00069 double _H[3][3];
00070 int _nMatches;
00071 int _currentPair;
00072
00073
00074 double _v1x, _v2x, _v1y, _v2y;
00075
00076
00077 };
00078
00079 ostream& operator<< (ostream& o, const Homography& H);
00080
00081 }
00082
00083 #endif // __lsurf_homography_h
00084