diff --git a/calculate_center.sh b/calculate_center.sh new file mode 100644 index 0000000..36ab993 --- /dev/null +++ b/calculate_center.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "scale=2;${1}+((${2}-${1})/2.0)" | bc diff --git a/fourcell/normalize.py b/fourcell/normalize.py index 5b168fc..60a9fe3 100644 --- a/fourcell/normalize.py +++ b/fourcell/normalize.py @@ -24,7 +24,7 @@ def display (image) : resized = image_resize(image, 800, 800) cv2.imshow('img', resized) - while True: + while cv2.getWindowProperty('img', cv2.WND_PROP_VISIBLE) > 0: key = cv2.waitKey(0) if key == 27: cv2.destroyAllWindows() @@ -244,7 +244,7 @@ def find_hole_punches (img) : i = 0 for hp in holePunches : 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 return holePunches @@ -382,7 +382,7 @@ print(f'Offset: {offset[0]},{offset[1]}') - +display(img) #normal = place(blank, rotated, 0, 0) #display(normal) \ No newline at end of file