Merge pull request #25722 from AleksandrPanov:update_testSeveralBoardsWithCustomIds

updated testSeveralBoardsWithCustomIds to enable in 5.x
pull/25723/head
Alexander Smorkalov 6 months ago committed by GitHub
commit bef5a87680
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      modules/objdetect/test/test_charucodetection.cpp

@ -932,12 +932,14 @@ TEST(Charuco, testSeveralBoardsWithCustomIds)
detector2.detectBoard(gray, c_corners2, c_ids2, corners, ids);
ASSERT_EQ(ids.size(), size_t(16));
ASSERT_EQ(c_corners1.rows, expected_corners.rows);
EXPECT_NEAR(0, cvtest::norm(expected_corners, c_corners1.reshape(1), NORM_INF), 3e-1);
// In 4.x detectBoard() returns the charuco corners in a 2D Mat with shape (N_corners, 1)
// In 5.x, after PR #23473, detectBoard() returns the charuco corners in a 1D Mat with shape (1, N_corners)
ASSERT_EQ(expected_corners.total(), c_corners1.total()*c_corners1.channels());
EXPECT_NEAR(0., cvtest::norm(expected_corners.reshape(1, 1), c_corners1.reshape(1, 1), NORM_INF), 3e-1);
ASSERT_EQ(c_corners2.rows, expected_corners.rows);
ASSERT_EQ(expected_corners.total(), c_corners2.total()*c_corners2.channels());
expected_corners.col(0) += 500;
EXPECT_NEAR(0, cvtest::norm(expected_corners, c_corners2.reshape(1), NORM_INF), 3e-1);
EXPECT_NEAR(0., cvtest::norm(expected_corners.reshape(1, 1), c_corners2.reshape(1, 1), NORM_INF), 3e-1);
}
}} // namespace

Loading…
Cancel
Save