/* * feature_mathcer implementation * * Copyright (C) HamidReza Houshiar * * Released under the GPL version 3. * */ #include "slam6d/fbr/feature_matcher.h" using namespace std; namespace fbr{ void feature_matcher::init(matcher_method method, int k, double r){ mMethod = method; knn = k; radius = r; nOfMatches = 0; nOfFilteredMatches = 0; } feature_matcher::feature_matcher(){ init(RATIO, 0, 0); } feature_matcher::feature_matcher(matcher_method method){ if(method == KNN) init(method, 3, 0); else if(method == RADIUS) init(method, 0, 1); else init(method, 0, 0); } feature_matcher::feature_matcher(matcher_method method, double p){ if(method == KNN) init(method, p, 0); else if(method == RADIUS) init(method, 0, p); else init(method, 0, 0); } void feature_matcher::match(feature qFeature, feature tFeature){ vector< cv::DMatch > qtInitialMatches, tqInitialMatches, gMatches; vector > qtInitialMatchesVector, tqInitialMatchesVector; //Matching descriptors using one of the mMethods for SURF and SIFT feature descriptors if(qFeature.getDescriptorMethod() != tFeature.getDescriptorMethod()){ cout<<"inputs features don't have the same descriptors!"<