Commit 11f9dafd authored by Ilya Lysenkov's avatar Ilya Lysenkov

Fixed FernDescriptorMatch

parent 3cdfad60
...@@ -588,12 +588,15 @@ void FernDescriptorMatch::match( const Mat& image, vector<KeyPoint>& keypoints, ...@@ -588,12 +588,15 @@ void FernDescriptorMatch::match( const Mat& image, vector<KeyPoint>& keypoints,
{ {
trainFernClassifier(); trainFernClassifier();
float bestProb = 0;
indices.resize( keypoints.size() ); indices.resize( keypoints.size() );
vector<float> signature( (size_t)classifier->getClassCount() ); vector<float> signature( (size_t)classifier->getClassCount() );
for( size_t pi = 0; pi < keypoints.size(); pi++ ) 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<KeyPoint>& keypoints ) void FernDescriptorMatch::classify( const Mat& image, vector<KeyPoint>& keypoints )
......
...@@ -1434,9 +1434,9 @@ void DescriptorQualityTest::readAlgorithm( ) ...@@ -1434,9 +1434,9 @@ void DescriptorQualityTest::readAlgorithm( )
else if (! algName.compare ("fern")) else if (! algName.compare ("fern"))
{ {
FernDescriptorMatch::Params params; FernDescriptorMatch::Params params;
params.nviews = 50; params.nviews = 100;
params.signatureSize = 80; params.signatureSize = INT_MAX;
params.nstructs = 20; params.nstructs = 50;
defaultDescMatch = new FernDescriptorMatch (params); defaultDescMatch = new FernDescriptorMatch (params);
specificDescMatch = new FernDescriptorMatch (); specificDescMatch = new FernDescriptorMatch ();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment