Work on normalization script

This commit is contained in:
Matt McWilliams 2022-11-13 22:36:25 -05:00
parent 9e11d95447
commit 2798729373
2 changed files with 6 additions and 3 deletions

3
calculate_center.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
echo "scale=2;${1}+((${2}-${1})/2.0)" | bc

View File

@ -24,7 +24,7 @@ def display (image) :
resized = image_resize(image, 800, 800) resized = image_resize(image, 800, 800)
cv2.imshow('img', resized) cv2.imshow('img', resized)
while True: while cv2.getWindowProperty('img', cv2.WND_PROP_VISIBLE) > 0:
key = cv2.waitKey(0) key = cv2.waitKey(0)
if key == 27: if key == 27:
cv2.destroyAllWindows() cv2.destroyAllWindows()
@ -244,7 +244,7 @@ def find_hole_punches (img) :
i = 0 i = 0
for hp in holePunches : for hp in holePunches :
hp['order'] = i hp['order'] = i
#cv2.putText(img, str(i + 1), (hp['x'], hp['y']), cv2.FONT_HERSHEY_SIMPLEX, 20, (0, 0, 255), 5, cv2.LINE_AA, False) cv2.putText(img, str(i + 1), (hp['x'], hp['y']), cv2.FONT_HERSHEY_SIMPLEX, 20, (0, 0, 255), 5, cv2.LINE_AA, False)
i+=1 i+=1
return holePunches return holePunches
@ -382,7 +382,7 @@ print(f'Offset: {offset[0]},{offset[1]}')
display(img)
#normal = place(blank, rotated, 0, 0) #normal = place(blank, rotated, 0, 0)
#display(normal) #display(normal)