Skip to content

Commit

Permalink
Issue #101 added try catch to avoid breakage with openc 4.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
thompson318 committed Dec 8, 2021
1 parent a8e28d7 commit 158adf7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sksurgeryimage/calibration/charuco.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ def filter_out_wrong_markers(marker_corners,
number_of_nearest_markers = len(board.nearestMarkerIdx[i])
assert number_of_nearest_markers == 2
for j in range(0, number_of_nearest_markers):
marker_id = board.ids[board.nearestMarkerIdx[i][j][0]][0]
try:
marker_id = board.ids[board.nearestMarkerIdx[i][j][0]][0]
except IndexError:
marker_id = board.ids[board.nearestMarkerIdx[i][j]]

marker_index = -1
for k in range(0, number_of_markers):
if marker_ids[k][0] == marker_id:
Expand Down

0 comments on commit 158adf7

Please sign in to comment.