00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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;
00055 int _distanceThres;
00056
00057
00058 };
00059
00060 }
00061
00062 #endif