Ignore invalid marker IDs
This commit is contained in:
parent
d8c93fbc49
commit
a71712b8a4
1 changed files with 5 additions and 1 deletions
6
bot.py
6
bot.py
|
@ -147,7 +147,11 @@ class Bot:
|
|||
)
|
||||
if corners is not None and ids is not None:
|
||||
for corner, i in zip(corners, ids):
|
||||
aruco_corners[i[0]] = corner
|
||||
index = i[0]
|
||||
if not (0 <= index < 4):
|
||||
warnings.warn(f"Invalid ArUco marker ID: {index}")
|
||||
continue
|
||||
aruco_corners[index] = corner
|
||||
assert annotated_image is not None
|
||||
|
||||
del vcap
|
||||
|
|
Loading…
Reference in a new issue