mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Fix: BFMatcher isMaskSupported false on crossCheck
isMaskSupported now returns false when the matcher is created with crossCheck enabled, because the mask path is unsupported in that mode. knnMatchImpl also drops the mask so it cannot reach batchDistance and trigger its mask.empty() assertion. https://github.com/opencv/opencv/issues/22093
This commit is contained in:
@@ -996,8 +996,9 @@ void BFMatcher::knnMatchImpl( InputArray _queryDescriptors, std::vector<std::vec
|
||||
for( iIdx = 0; iIdx < imgCount; iIdx++ )
|
||||
{
|
||||
CV_Assert( trainDescCollection[iIdx].rows < IMGIDX_ONE );
|
||||
Mat mask = (crossCheck || masks.empty()) ? Mat() : masks[iIdx];
|
||||
batchDistance(queryDescriptors, trainDescCollection[iIdx], dist, dtype, nidx,
|
||||
normType, knn, masks.empty() ? Mat() : masks[iIdx], update, crossCheck);
|
||||
normType, knn, mask, update, crossCheck);
|
||||
update += IMGIDX_ONE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user