mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 11:10:21 +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,
|
void DescriptorMatcher::knnMatch( const Mat& queryDescriptors, vector<vector<DMatch> >& matches, int knn,
|
||||||
const vector<Mat>& masks, bool compactResult )
|
const vector<Mat>& masks, bool compactResult )
|
||||||
{
|
{
|
||||||
matches.clear();
|
matches.clear();
|
||||||
if( empty() || queryDescriptors.empty() )
|
if( empty() || queryDescriptors.empty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CV_Assert( knn > 0 );
|
CV_Assert( knn > 0 );
|
||||||
|
|
||||||
checkMasks( masks, queryDescriptors.rows );
|
checkMasks( masks, queryDescriptors.rows );
|
||||||
|
|
||||||
train();
|
train();
|
||||||
knnMatchImpl( queryDescriptors, matches, knn, masks, compactResult );
|
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,
|
void DescriptorMatcher::radiusMatch( const Mat& queryDescriptors, vector<vector<DMatch> >& matches, float maxDistance,
|
||||||
const vector<Mat>& masks, bool compactResult )
|
const vector<Mat>& masks, bool compactResult )
|
||||||
{
|
{
|
||||||
matches.empty();
|
matches.clear();
|
||||||
if( empty() || queryDescriptors.empty() )
|
if( empty() || queryDescriptors.empty() )
|
||||||
return;
|
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();
|
train();
|
||||||
radiusMatchImpl( queryDescriptors, matches, maxDistance, masks, compactResult );
|
radiusMatchImpl( queryDescriptors, matches, maxDistance, masks, compactResult );
|
||||||
|
Loading…
Reference in New Issue
Block a user