From cbc08514fde2002ea8aaf87145f021d7df20ba26 Mon Sep 17 00:00:00 2001 From: Alexander Panov Date: Thu, 6 Jun 2024 14:22:58 +0300 Subject: [PATCH] updated testSeveralBoardsWithCustomIds to enable in 5.x --- modules/objdetect/test/test_charucodetection.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/objdetect/test/test_charucodetection.cpp b/modules/objdetect/test/test_charucodetection.cpp index 47166fa78e..b85558627e 100644 --- a/modules/objdetect/test/test_charucodetection.cpp +++ b/modules/objdetect/test/test_charucodetection.cpp @@ -866,12 +866,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