Skip to content

Commit

Permalink
Issue #75: Update ChArUco+Chessboard pattern to match SmartLiver conf…
Browse files Browse the repository at this point in the history
…ig files.
  • Loading branch information
MattClarkson committed May 5, 2020
1 parent 2e67e46 commit 769f4f5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion sksurgeryimage/calibration/charuco.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def make_charuco_with_chessboard(
charuco_squares=(19, 26),
charuco_size=(5, 4),
pixels_per_millimetre=10,
chessboard_squares=(13, 18),
chessboard_squares=(9, 14),
chessboard_size=3,
chessboard_border=0.7
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ class CharucoPlusChessboardPointDetector(PointDetector):
in a 2D grey scale video image.
"""
def __init__(self,
number_of_charuco_squares,
size_of_charuco_squares,
minimum_number_of_points,
number_of_charuco_squares=(19, 26),
size_of_charuco_squares=(5, 4),
minimum_number_of_points=50,
scale=(1, 1),
dictionary=cv2.aruco.getPredefinedDictionary(
cv2.aruco.DICT_4X4_250),
charuco_filtering=False,
use_chessboard_inset=False,
number_of_chessboard_squares=None,
chessboard_square_size=1,
number_of_chessboard_squares=(9, 14),
chessboard_square_size=3,
chessboard_id_offset=500
):
"""
Expand Down
14 changes: 6 additions & 8 deletions tests/calibration/test_charuco_plus_chessboard_point_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@

def test_charuco_plus_chess_detector():

file_name = 'tests/data/calibration/pattern_4x4_19x26_5_4_with_inset_13x18.png'

# Note: image generated with
calib_image = ch.make_charuco_with_chessboard()
cv2.imwrite('tests/data/calibration/pattern_4x4_19x26_5_4_with_inset_13x18.png', calib_image)
return
file_name = 'tests/data/calibration/pattern_4x4_26x19_5_4_with_inset_18x13.png'
cv2.imwrite(file_name, calib_image)

image = cv2.imread(file_name)
detector = CharucoPlusChessboardPointDetector((19, 26), (5, 4), 25, (1, 1),
use_chessboard_inset=False,
number_of_chessboard_squares=(18, 13),
chessboard_square_size=3
)
detector = CharucoPlusChessboardPointDetector()
ids, object_points, image_points = detector.get_points(image)
pdu.write_annotated_image(image, ids, image_points, file_name)
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 769f4f5

Please sign in to comment.