fixed FernDescriptorMatch; optimized keypoint regions matching in detector/descriptor evaluation; added CalonderDescriptorExtractor to evaluation tests

This commit is contained in:
Maria Dimashova
2010-10-04 14:12:36 +00:00
parent 51822f2072
commit 89935fc59b
5 changed files with 190 additions and 122 deletions

View File

@@ -569,7 +569,7 @@ void FernDescriptorMatch::trainFernClassifier()
{
assert( params.filename.empty() );
vector<vector<Point2f> > points;
vector<vector<Point2f> > points(collection.images.size());
for( size_t imgIdx = 0; imgIdx < collection.images.size(); imgIdx++ )
KeyPoint::convert( collection.points[imgIdx], points[imgIdx] );
@@ -757,34 +757,34 @@ void VectorDescriptorMatch::write (FileStorage& fs) const
/****************************************************************************************\
* Factory function for GenericDescriptorMatch creating *
\****************************************************************************************/
Ptr<GenericDescriptorMatch> createGenericDescriptorMatch( const string& genericDescritptorMatchType,
const string &paramsFilename )
Ptr<GenericDescriptorMatch> createGenericDescriptorMatcher( const string& genericDescritptorMatcherType,
const string &paramsFilename )
{
GenericDescriptorMatch *descriptorMatch = 0;
if( ! genericDescritptorMatchType.compare("ONEWAY") )
GenericDescriptorMatch *descriptorMatcher = 0;
if( ! genericDescritptorMatcherType.compare("ONEWAY") )
{
descriptorMatch = new OneWayDescriptorMatch();
descriptorMatcher = new OneWayDescriptorMatch();
}
else if( ! genericDescritptorMatchType.compare("FERN") )
else if( ! genericDescritptorMatcherType.compare("FERN") )
{
descriptorMatch = new FernDescriptorMatch();
descriptorMatcher = new FernDescriptorMatch();
}
else if( ! genericDescritptorMatchType.compare ("CALONDER") )
else if( ! genericDescritptorMatcherType.compare ("CALONDER") )
{
//descriptorMatch = new CalonderDescriptorMatch ();
}
if( !paramsFilename.empty() && descriptorMatch != 0 )
if( !paramsFilename.empty() && descriptorMatcher != 0 )
{
FileStorage fs = FileStorage( paramsFilename, FileStorage::READ );
if( fs.isOpened() )
{
descriptorMatch->read( fs.root() );
descriptorMatcher->read( fs.root() );
fs.release();
}
}
return descriptorMatch;
return descriptorMatcher;
}
}