Remove excessive logging

This commit is contained in:
Matt McWilliams 2022-11-15 20:55:06 -05:00
parent 5a0da25109
commit b93ef905ae
1 changed files with 19 additions and 21 deletions

View File

@ -346,41 +346,41 @@ def normalize_image(blank, rotated, offset, tl) :
diffX = offset[0] - tl["x"]
diffY = offset[1] - tl["y"]
print(f'diffX : {diffX}')
print(f'diffY : {diffY}')
#print(f'diffX : {diffX}')
#print(f'diffY : {diffY}')
crop = rotated.copy()
if diffX < 0 :
crop = crop[0:rotatedHeight, abs(diffX):rotatedWidth]
rotatedHeight, rotatedWidth = crop.shape[:2]
print('Cropped X')
print(f'Rotated: {rotatedWidth},{rotatedHeight}')
#print('Cropped X')
#print(f'Rotated: {rotatedWidth},{rotatedHeight}')
diffX = 0
if diffY < 0 :
crop = crop[abs(diffY):rotatedHeight, 0:rotatedWidth]
rotatedHeight, rotatedWidth = crop.shape[:2]
print('Cropped Y')
print(f'Rotated: {rotatedWidth},{rotatedHeight}')
#print('Cropped Y')
#print(f'Rotated: {rotatedWidth},{rotatedHeight}')
diffY = 0
if rotatedWidth > width :
crop = crop[0:rotatedHeight, 0:rotatedWidth-(rotatedWidth - width)]
rotatedHeight, rotatedWidth = crop.shape[:2]
print('Cropped X')
print(f'Rotated: {rotatedWidth},{rotatedHeight}')
#print('Cropped X')
#print(f'Rotated: {rotatedWidth},{rotatedHeight}')
if rotatedHeight > normalHeight :
crop = crop[0:rotatedHeight-(rotatedHeight - normalHeight), 0:width]
rotatedHeight, rotatedWidth = crop.shape[:2]
print('Cropped Y')
print(f'Rotated: {rotatedWidth},{rotatedHeight}')
#print('Cropped Y')
#print(f'Rotated: {rotatedWidth},{rotatedHeight}')
print(f'diffX : {diffX}')
print(f'diffY : {diffY}')
#print(f'diffX : {diffX}')
#print(f'diffY : {diffY}')
print(f'Rotated: {rotatedWidth},{rotatedHeight}')
print(f'Blank : {width},{normalHeight}')
#print(f'Rotated: {rotatedWidth},{rotatedHeight}')
#print(f'Blank : {width},{normalHeight}')
cropHeight = normalHeight
cropWidth = width
@ -432,9 +432,7 @@ tl = None
for hp in holePunches :
if tl is None :
tl = hp
print(f'{hp["order"] + 1} {hp["x"]},{hp["y"]}')
print(f'Normal dimensions: {width},{normalHeight}')
#print(f'{hp["order"] + 1} {hp["x"]},{hp["y"]}')
# the mean rectangle is the average width and height
# determined by the four corner hole punches
@ -444,10 +442,10 @@ print(f'Mean rectangle: {meanRect[0]},{meanRect[1]}')
# offset is the position within the new normal image
# the top left hole punch should be centered to
offset = center_within((width, normalHeight), meanRect)
print(f'Offset : {offset[0]},{offset[1]}')
print(f'Topleft: {tl["x"]},{tl["y"]}')
print(f'Rotated: {rotatedWidth},{rotatedHeight}')
print(f'Blank : {width},{normalHeight}')
#print(f'Offset : {offset[0]},{offset[1]}')
#print(f'Topleft: {tl["x"]},{tl["y"]}')
#print(f'Rotated: {rotatedWidth},{rotatedHeight}')
print(f'Normal : {width},{normalHeight}')
#cv2.rectangle(blank, offset, (offset[0]+meanRect[0], offset[1]+meanRect[1]), (255, 0, 0), thickness=20)