From 045402e4818fb0ebeab3974258e1bf7dc12b2ba4 Mon Sep 17 00:00:00 2001 From: Maria Dimashova Date: Wed, 26 May 2010 15:00:03 +0000 Subject: [PATCH] override clear method to VectorDescriptorMatch --- .../include/opencv2/features2d/features2d.hpp | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/modules/features2d/include/opencv2/features2d/features2d.hpp b/modules/features2d/include/opencv2/features2d/features2d.hpp index a55269269e..2157aa248b 100644 --- a/modules/features2d/include/opencv2/features2d/features2d.hpp +++ b/modules/features2d/include/opencv2/features2d/features2d.hpp @@ -1397,7 +1397,7 @@ public: * matches Indices of the closest matches from the training set */ void match( const Mat& query, const Mat& mask, - vector& matches, vector* distances = 0 ) const; + vector& matches ) const; /* * Find the best keypoint matches for small view changes. @@ -1416,6 +1416,7 @@ public: /*void matchWindowed( const vector& keypoints_1, const Mat& descriptors_1, const vector& keypoints_2, const Mat& descriptors_2, float maxDeltaX, float maxDeltaY, vector& matches) const;*/ + virtual void clear(); protected: Mat train; @@ -1458,15 +1459,15 @@ inline void DescriptorMatcher::match( const Mat& query, vector& matches ) c } inline void DescriptorMatcher::match( const Mat& query, const Mat& mask, - vector& matches, vector* distances ) const + vector& matches ) const { - if( distances ) - matchImpl( query, train, mask, matches, *distances ); - else - { - vector innDistances; - matchImpl( query, train, mask, matches, innDistances ); - } + vector innDistances; + matchImpl( query, train, mask, matches, innDistances ); +} + +inline void DescriptorMatcher::clear() +{ + train.release(); } /* @@ -1828,10 +1829,16 @@ public: matcher.match( descriptors, keypointIndices ); }; + virtual void clear() + { + GenericDescriptorMatch::clear(); + matcher.clear(); + } + protected: Extractor extractor; Matcher matcher; - vector classIds; + //vector classIds; }; }