From 11f9dafdca27cb982e6c0336ed96646b52ebd1c5 Mon Sep 17 00:00:00 2001 From: Ilya Lysenkov Date: Wed, 9 Jun 2010 10:03:56 +0000 Subject: [PATCH] Fixed FernDescriptorMatch --- modules/features2d/src/descriptors.cpp | 7 +++++-- tests/cv/src/adetectordescriptor_evaluation.cpp | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/features2d/src/descriptors.cpp b/modules/features2d/src/descriptors.cpp index 7b3cd4647c..4825f4a8b4 100644 --- a/modules/features2d/src/descriptors.cpp +++ b/modules/features2d/src/descriptors.cpp @@ -588,12 +588,15 @@ void FernDescriptorMatch::match( const Mat& image, vector& keypoints, { trainFernClassifier(); - float bestProb = 0; indices.resize( keypoints.size() ); vector signature( (size_t)classifier->getClassCount() ); for( size_t pi = 0; pi < keypoints.size(); pi++ ) - calcBestProbAndMatchIdx( image, keypoints[pi].pt, bestProb, indices[pi], signature ); + { + //calcBestProbAndMatchIdx( image, keypoints[pi].pt, bestProb, indices[pi], signature ); + //TODO: use octave and image pyramid + indices[pi] = (*classifier)(image, keypoints[pi].pt, signature); + } } void FernDescriptorMatch::classify( const Mat& image, vector& keypoints ) diff --git a/tests/cv/src/adetectordescriptor_evaluation.cpp b/tests/cv/src/adetectordescriptor_evaluation.cpp index 16d1223597..12f130d408 100644 --- a/tests/cv/src/adetectordescriptor_evaluation.cpp +++ b/tests/cv/src/adetectordescriptor_evaluation.cpp @@ -1434,9 +1434,9 @@ void DescriptorQualityTest::readAlgorithm( ) else if (! algName.compare ("fern")) { FernDescriptorMatch::Params params; - params.nviews = 50; - params.signatureSize = 80; - params.nstructs = 20; + params.nviews = 100; + params.signatureSize = INT_MAX; + params.nstructs = 50; defaultDescMatch = new FernDescriptorMatch (params); specificDescMatch = new FernDescriptorMatch (); }