Skip to content

Commit 78e3879

Browse files
dogod621alalek
authored andcommitted
Merge pull request #2302 from dogod621:master
Fix incorrect pattern when sizeY is odd
1 parent 8b59dff commit 78e3879

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

modules/aruco/misc/pattern_generator/MarkerPrinter.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,15 @@ def __DrawBlock(context,
123123
if((squareLength is None) or (markerLength is None)):
124124
raise ValueError("lenght is None")
125125

126-
if((( blockX % 2 == 0 ) == ( blockY % 2 == 0 )) or mode == "ARUCOGRID"):
126+
dawMarkerBlock = False
127+
if ((mode == "ARUCO") or (mode == "ARUCOGRID")):
128+
dawMarkerBlock = True
129+
elif(chessboardSize[1] % 2 == 0):
130+
dawMarkerBlock = (( blockX % 2 == 0 ) == ( blockY % 2 == 0 ))
131+
else:
132+
dawMarkerBlock = (( blockX % 2 == 0 ) != ( blockY % 2 == 0 ))
133+
134+
if(dawMarkerBlock):
127135
if (mode != "CHESS"):
128136
if(dictionary is None):
129137
raise ValueError("dictionary is None")

0 commit comments

Comments
 (0)