RansacFiltering.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 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 */
00020 
00021 #ifndef __lfeat_ransacfiltering_h
00022 #define __lfeat_ransacfiltering_h
00023 
00024 #include <vector>
00025 #include "Homography.h"
00026 
00027 namespace lfeat
00028 {
00029 
00030 class LFIMPEX Ransac
00031 {
00032 public:
00033     Ransac() : _nIter(1000), _distanceThres(25) {};
00034 
00035     void filter(std::vector<PointMatchPtr>& ioMatches, std::vector<PointMatchPtr>& ioRemovedMatches);
00036     inline void setIterations(int iIters)
00037     {
00038         _nIter = iIters;
00039     }
00040     inline void setDistanceThreshold(int iDT)
00041     {
00042         _distanceThres = iDT;
00043     }
00044 
00045     Homography  _bestModel;
00046 
00047 
00048     void transform(double iX, double iY, double& oX, double& oY);
00049 
00050 private:
00051 
00052     double calcError(Homography* aH, PointMatch& aM);
00053 
00054     int         _nIter;                         // number of iterations
00055     int         _distanceThres; // error distance threshold in pixels
00056 
00057 
00058 };
00059 
00060 }
00061 
00062 #endif

Generated on Fri Aug 29 01:25:43 2014 for Hugintrunk by  doxygen 1.3.9.1