mirror of
https://github.com/opencv/opencv.git
synced 2026-07-21 19:33:03 +04:00
Added ArUco marker size check for Aruco and Charuco boards.
This commit is contained in:
committed by
Alexander Smorkalov
parent
f3c724d449
commit
e5b114e5b8
@@ -186,6 +186,8 @@ class PatternMaker:
|
||||
yspacing = (self.height - self.rows * self.square_size) / 2.0
|
||||
|
||||
ch_ar_border = (self.square_size - self.aruco_marker_size)/2
|
||||
if ch_ar_border < side*0.7:
|
||||
print("Marker border {} is less than 70% of ArUco pin size {}. Please increase --square_size or decrease --marker_size for stable board detection".format(ch_ar_border, int(side)))
|
||||
marker_id = 0
|
||||
for y in range(0, self.rows):
|
||||
for x in range(0, self.cols):
|
||||
@@ -283,6 +285,9 @@ def main():
|
||||
else:
|
||||
raise ValueError("The marker {},{} is outside the checkerboard".format(x, y))
|
||||
|
||||
if p_type == "charuco_board" and aruco_marker_size >= square_size:
|
||||
raise ValueError("ArUco markers size must be smaller than square size")
|
||||
|
||||
pm = PatternMaker(columns, rows, output, units, square_size, radius_rate, page_width, page_height, markers, aruco_marker_size, dict_file)
|
||||
# dict for easy lookup of pattern type
|
||||
mp = {"circles": pm.make_circles_pattern, "acircles": pm.make_acircles_pattern,
|
||||
|
||||
Reference in New Issue
Block a user