Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Homography.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2007-2008 Anael Orlinski
3 *
4 * This file is part of Panomatic.
5 *
6 * Panomatic is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * Panomatic 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
17 * along with Panomatic; if not, write to the Free Software
18 * <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef __lsurf_homography_h
22 #define __lsurf_homography_h
23 
24 #include <iostream>
25 
26 #include "PointMatch.h"
27 #include <vector>
28 
29 namespace lfeat
30 {
31 
33 {
34 public:
35  Homography();
36  ~Homography();
37 
38  void initMatchesNormalization(PointMatchVector_t& iMatches);
39 
40  bool estimate(PointMatchVector_t& iMatches);
41 
42  friend std::ostream& operator<< (std::ostream& o, const Homography& H);
43 
44  void transformPoint(double iX, double iY, double& oX, double& oY);
45 
46 
47 private:
48  void initialize(void);
49 
50  void addMatch(size_t iIndex, PointMatch& iMatch);
51 
52  static const int kNCols;
53 
54 
55  void allocMemory(int iNPoints);
56  void freeMemory();
57 
58  // the matrices for solving least squares
59  double** _Amat;
60  double* _Bvec;
61  double* _Rvec;
62  double* _Xvec;
63 
64 public:
65  double _H[3][3]; // the homography matrix.
66  int _nMatches; // number of matches to calc homography
67 
68  // values for vector normalization
69  double _v1x, _v2x, _v1y, _v2y;
70 
71 
72 };
73 
74 std::ostream& operator<< (std::ostream& o, const Homography& H);
75 
76 }
77 
78 #endif // __lsurf_homography_h
79 
double * _Rvec
Definition: Homography.h:61
std::vector< PointMatchPtr > PointMatchVector_t
Definition: PointMatch.h:53
double * _Bvec
Definition: Homography.h:60
double * _Xvec
Definition: Homography.h:62
double ** _Amat
Definition: Homography.h:59
std::ostream & operator<<(std::ostream &o, const Homography &H)
Definition: Homography.cpp:130
static const int kNCols
Definition: Homography.h:52
#define LFIMPEX
Definition: hugin_shared.h:41