mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 03:00:14 +08:00
fixed bug in knnMatch method
This commit is contained in:
parent
de93fdb1af
commit
e202b13069
@ -264,13 +264,13 @@ void DescriptorMatcher::checkMasks( const vector<Mat>& masks, int queryDescripto
|
||||
void DescriptorMatcher::knnMatch( const Mat& queryDescriptors, vector<vector<DMatch> >& matches, int knn,
|
||||
const vector<Mat>& masks, bool compactResult )
|
||||
{
|
||||
matches.clear();
|
||||
if( empty() || queryDescriptors.empty() )
|
||||
return;
|
||||
matches.clear();
|
||||
if( empty() || queryDescriptors.empty() )
|
||||
return;
|
||||
|
||||
CV_Assert( knn > 0 );
|
||||
CV_Assert( knn > 0 );
|
||||
|
||||
checkMasks( masks, queryDescriptors.rows );
|
||||
checkMasks( masks, queryDescriptors.rows );
|
||||
|
||||
train();
|
||||
knnMatchImpl( queryDescriptors, matches, knn, masks, compactResult );
|
||||
@ -279,13 +279,13 @@ void DescriptorMatcher::knnMatch( const Mat& queryDescriptors, vector<vector<DMa
|
||||
void DescriptorMatcher::radiusMatch( const Mat& queryDescriptors, vector<vector<DMatch> >& matches, float maxDistance,
|
||||
const vector<Mat>& masks, bool compactResult )
|
||||
{
|
||||
matches.empty();
|
||||
if( empty() || queryDescriptors.empty() )
|
||||
return;
|
||||
matches.clear();
|
||||
if( empty() || queryDescriptors.empty() )
|
||||
return;
|
||||
|
||||
CV_Assert( maxDistance > std::numeric_limits<float>::epsilon() );
|
||||
CV_Assert( maxDistance > std::numeric_limits<float>::epsilon() );
|
||||
|
||||
checkMasks( masks, queryDescriptors.rows );
|
||||
checkMasks( masks, queryDescriptors.rows );
|
||||
|
||||
train();
|
||||
radiusMatchImpl( queryDescriptors, matches, maxDistance, masks, compactResult );
|
||||
|
Loading…
Reference in New Issue
Block a user