Merge remote-tracking branch 'upstream/3.4' into merge-3.4

This commit is contained in:
Alexander Alekhin
2018-11-17 13:50:04 +00:00
237 changed files with 2990 additions and 1660 deletions
@@ -595,4 +595,23 @@ TEST( Features2d_FlannBasedMatcher, read_write )
EXPECT_EQ(ymlfile, out);
}
TEST(Features2d_DMatch, issue_11855)
{
Mat sources = (Mat_<uchar>(2, 3) << 1, 1, 0,
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);
ASSERT_EQ((size_t)1, match.size());
ASSERT_EQ((size_t)1, match[0].size());
EXPECT_EQ(1, match[0][0].queryIdx);
EXPECT_EQ(0, match[0][0].trainIdx);
EXPECT_EQ(0.0f, match[0][0].distance);
}
}} // namespace