Skip to content

Commit 4dd9a36

Browse files
committed
Added test for checkMasks with UMat train descs
1 parent 41678fe commit 4dd9a36

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

modules/features2d/test/test_matchers_algorithmic.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,6 @@ TEST(Features2d_DMatch, issue_11855)
565565
1, 1, 1);
566566
Mat targets = (Mat_<uchar>(2, 3) << 1, 1, 1,
567567
0, 0, 0);
568-
569568
Ptr<BFMatcher> bf = BFMatcher::create(NORM_HAMMING, true);
570569
vector<vector<DMatch> > match;
571570
bf->knnMatch(sources, targets, match, 1, noArray(), true);
@@ -577,4 +576,18 @@ TEST(Features2d_DMatch, issue_11855)
577576
EXPECT_EQ(0.0f, match[0][0].distance);
578577
}
579578

579+
TEST(Features2d_DMatch, issue_17771)
580+
{
581+
Mat sources = (Mat_<uchar>(2, 3) << 1, 1, 0,
582+
1, 1, 1);
583+
Mat targets = (Mat_<uchar>(2, 3) << 1, 1, 1,
584+
0, 0, 0);
585+
UMat usources = sources.getUMat(ACCESS_READ);
586+
UMat utargets = targets.getUMat(ACCESS_READ);
587+
vector<vector<DMatch> > match;
588+
Ptr<BFMatcher> ubf = BFMatcher::create(NORM_HAMMING);
589+
Mat mask = (Mat_<uchar>(2, 2) << 1, 0, 0, 1);
590+
EXPECT_NO_THROW(ubf->knnMatch(usources, utargets, match, 1, mask, true));
591+
}
592+
580593
}} // namespace

0 commit comments

Comments
 (0)