commit 5e25dd67b17bc052dbc41dc0e9cdfffa1882f177
parent 5ea57facf4ed0a6cb2d38b250ced1b217da57403
Author: 諒太 林 <ryouturn@gmail.com>
Date: Wed, 28 Aug 2024 14:40:38 +0900
remove while code
Diffstat:
1 file changed, 5 insertions(+), 25 deletions(-)
diff --git a/hacku-tokyo-v2-pim.py b/hacku-tokyo-v2-pim.py
@@ -107,31 +107,11 @@ keep = [[0] * 32 for i in range(24)]
busy = True
-while(True):
- ret, frame = cap.read()
-
- gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
- mos = mosaic(gray)
- count = dump(gray, keep)
-
- print('{0} {1}'.format(count,busy))
- if(count[0] >= 50):
- escapeL
- elif(count[1] >= 50):
- escapeR
-
- cv2.imshow('frame',frame)
- cv2.imshow('mos',mos)
-
- if cv2.waitKey(1) != -1:
- break
-
-cap.release()
-cv2.destroyAllWindows()
-
-
try:
main()
except KeyboardInterrupt:
print('interrupted!')
- GPIO.cleanup()-
\ No newline at end of file
+ GPIO.cleanup()
+
+cap.release()
+cv2.destroyAllWindows()+
\ No newline at end of file