Merged loop

This commit is contained in:
Lukas Wölfer
2019-06-23 17:35:34 +02:00
parent 7f2ae50804
commit c0c216e929

View File

@@ -2,6 +2,7 @@
from typing import Optional, Tuple
from dataclasses import dataclass
import itertools
import numpy
import cv2
@@ -35,8 +36,7 @@ def _adjust_squares(
adjustment = Adjustment(0, 0, 0, 0, 0, 0)
while True:
working_image = image.copy()
for index_x in range(count_x):
for index_y in range(count_y):
for index_x, index_y in itertools.product(range(count_x), range(count_y)):
square = get_square(adjustment, index_x, index_y)
cv2.rectangle(working_image,
(square[0], square[1]),