DescriptorExtractor: added defaultNorm() to return default norm type.
Added the defaultNorm() method to the DescriptorExtractor class. This method returns the default norm type for each descriptor type. The tests and C/C++ samples were updated to get the norm type directly from the DescriptorExtractor inherited classes. This was reported in feature report #2182 (http://code.opencv.org/issues/2182). It will make it possible to get the norm type usually applied matching method for each descriptor, instead of passing it manually.
This commit is contained in:
@@ -881,9 +881,10 @@ public:
|
||||
virtual void readAlgorithm( )
|
||||
{
|
||||
string classifierFile = data_path + "/features2d/calonder_classifier.rtc";
|
||||
Ptr<DescriptorExtractor> extractor = makePtr<CalonderDescriptorExtractor<float> >( classifierFile );
|
||||
defaultDescMatcher = makePtr<VectorDescriptorMatch>(
|
||||
makePtr<CalonderDescriptorExtractor<float> >( classifierFile ),
|
||||
makePtr<BFMatcher>(int(NORM_L2)));
|
||||
extractor,
|
||||
makePtr<BFMatcher>(extractor->defaultNorm()));
|
||||
specificDescMatcher = defaultDescMatcher;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user