Homography.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (C) 2007-2008 Anael Orlinski
00003 *
00004 * This file is part of Panomatic.
00005 *
00006 * Panomatic is free software; you can redistribute it and/or modify
00007 * it under the terms of the GNU General Public License as published by
00008 * the Free Software Foundation; either version 2 of the License, or
00009 * (at your option) any later version.
00010 *
00011 * Panomatic is distributed in the hope that it will be useful,
00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 * GNU General Public License for more details.
00015 *
00016 * You should have received a copy of the GNU General Public License
00017 * along with Panomatic; if not, write to the Free Software
00018 * <http://www.gnu.org/licenses/>.
00019 */
00020 
00021 #ifndef __lsurf_homography_h
00022 #define __lsurf_homography_h
00023 
00024 #include <iostream>
00025 
00026 #include "PointMatch.h"
00027 #include <vector>
00028 
00029 namespace lfeat
00030 {
00031 
00032 class LFIMPEX Homography
00033 {
00034 public:
00035     Homography();
00036     ~Homography();
00037 
00038     void initMatchesNormalization(PointMatchVector_t& iMatches);
00039 
00040     bool estimate(PointMatchVector_t& iMatches);
00041 
00042     friend std::ostream& operator<< (std::ostream& o, const Homography& H);
00043 
00044     void transformPoint(double iX, double iY, double& oX, double& oY);
00045 
00046 
00047 private:
00048     void initialize(void);
00049 
00050     void addMatch(size_t iIndex, PointMatch& iMatch);
00051 
00052     static const int kNCols;
00053 
00054 
00055     void allocMemory(int iNPoints);
00056     void freeMemory();
00057 
00058     // the matrices for solving least squares
00059     double** _Amat;
00060     double* _Bvec;
00061     double* _Rvec;
00062     double* _Xvec;
00063 
00064 public:
00065     double      _H[3][3];       // the homography matrix.
00066     int         _nMatches;      // number of matches to calc homography
00067 
00068     // values for vector normalization
00069     double _v1x, _v2x, _v1y, _v2y;
00070 
00071 
00072 };
00073 
00074 std::ostream& operator<< (std::ostream& o, const Homography& H);
00075 
00076 }
00077 
00078 #endif // __lsurf_homography_h
00079 

Generated on 31 May 2016 for Hugintrunk by  doxygen 1.4.7