mirror of
https://github.com/opencv/opencv.git
synced 2025-06-11 11:45:30 +08:00
Added test for checkMasks with UMat train descs
This commit is contained in:
parent
41678fe3d3
commit
4dd9a36a3c
@ -565,7 +565,6 @@ TEST(Features2d_DMatch, issue_11855)
|
||||
1, 1, 1);
|
||||
Mat targets = (Mat_<uchar>(2, 3) << 1, 1, 1,
|
||||
0, 0, 0);
|
||||
|
||||
Ptr<BFMatcher> bf = BFMatcher::create(NORM_HAMMING, true);
|
||||
vector<vector<DMatch> > match;
|
||||
bf->knnMatch(sources, targets, match, 1, noArray(), true);
|
||||
@ -577,4 +576,18 @@ TEST(Features2d_DMatch, issue_11855)
|
||||
EXPECT_EQ(0.0f, match[0][0].distance);
|
||||
}
|
||||
|
||||
TEST(Features2d_DMatch, issue_17771)
|
||||
{
|
||||
Mat sources = (Mat_<uchar>(2, 3) << 1, 1, 0,
|
||||
1, 1, 1);
|
||||
Mat targets = (Mat_<uchar>(2, 3) << 1, 1, 1,
|
||||
0, 0, 0);
|
||||
UMat usources = sources.getUMat(ACCESS_READ);
|
||||
UMat utargets = targets.getUMat(ACCESS_READ);
|
||||
vector<vector<DMatch> > match;
|
||||
Ptr<BFMatcher> ubf = BFMatcher::create(NORM_HAMMING);
|
||||
Mat mask = (Mat_<uchar>(2, 2) << 1, 0, 0, 1);
|
||||
EXPECT_NO_THROW(ubf->knnMatch(usources, utargets, match, 1, mask, true));
|
||||
}
|
||||
|
||||
}} // namespace
|
||||
|
Loading…
Reference in New Issue
Block a user