1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 07:13:02 +04:00

Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2026-02-19 17:10:14 +03:00
120 changed files with 650 additions and 465 deletions
@@ -258,10 +258,12 @@ class aruco_objdetect_test(NewOpenCVTests):
image = board.generateImage((cell_size*board_size[0], cell_size*board_size[1]))
# Note: Expected values adjusted by -0.5px after fixing the systematic offset bug in charuco_detector.cpp
# The fix removes the incorrect +0.5 offset that was added after cornerSubPix
list_gold_corners = []
for i in range(1, board_size[0]):
for j in range(1, board_size[1]):
list_gold_corners.append((j*cell_size, i*cell_size))
list_gold_corners.append((j*cell_size - 0.5, i*cell_size - 0.5))
gold_corners = np.array(list_gold_corners, dtype=np.float32)
charucoCorners, charucoIds, markerCorners, markerIds = charuco_detector.detectBoard(image)
@@ -280,8 +282,10 @@ class aruco_objdetect_test(NewOpenCVTests):
image = board.generateImage((cell_size*board_size[0], cell_size*board_size[1]))
list_gold_corners = [(cell_size, cell_size), (2*cell_size, cell_size), (2*cell_size, 2*cell_size),
(cell_size, 2*cell_size)]
# Note: Expected values adjusted by -0.5px after fixing the systematic offset bug in charuco_detector.cpp
# The fix removes the incorrect +0.5 offset that was added after cornerSubPix
list_gold_corners = [(cell_size - 0.5, cell_size - 0.5), (2*cell_size - 0.5, cell_size - 0.5),
(2*cell_size - 0.5, 2*cell_size - 0.5), (cell_size - 0.5, 2*cell_size - 0.5)]
gold_corners = np.array(list_gold_corners, dtype=np.float32)
diamond_corners, diamond_ids, marker_corners, marker_ids = charuco_detector.detectDiamonds(image)
@@ -357,7 +361,9 @@ class aruco_objdetect_test(NewOpenCVTests):
projectedCharucoCorners, _ = cv.projectPoints(copyChessboardCorners, rvec, tvec, cameraMatrix, distCoeffs)
if charucoIds is None:
self.assertEqual(iteration, 46)
# Detection can fail at extreme viewing angles
self.assertTrue(abs(yaw) >= 45 or abs(pitch) >= 45,
f"Detection failed unexpectedly at yaw={yaw}, pitch={pitch}")
continue
for i in range(len(charucoIds)):