mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
Merge branch 4.x
This commit is contained in:
@@ -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)):
|
||||
|
||||
Reference in New Issue
Block a user