Hugin trunk 0.1
Loading...
Searching...
No Matches
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
29namespace lfeat
30{
31
33{
34public:
35 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
47private:
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
64public:
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
74std::ostream& operator<< (std::ostream& o, const Homography& H);
75
76}
77
78#endif // __lsurf_homography_h
79
void initialize(void)
static const int kNCols
Definition Homography.h:52
double ** _Amat
Definition Homography.h:59
std::ostream & operator<<(std::ostream &o, const hugin_utils::TDiff2D< T > &d)
Definition hugin_math.h:250
#define LFIMPEX
std::ostream & operator<<(std::ostream &o, const Homography &H)
std::vector< PointMatchPtr > PointMatchVector_t
Definition PointMatch.h:53
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41