-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d0f9fd
commit bfb2eeb
Showing
5 changed files
with
98 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
# turbo-server data directory | ||
20* | ||
|
||
# turbo-qr data directory | ||
qr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
""" | ||
turbo-qr | ||
This is a script for quickly storing QR code data. | ||
Requirements: python 3, opencv2, a camera | ||
""" | ||
|
||
import cv2 | ||
import time | ||
import os | ||
import hashlib | ||
|
||
capture = cv2.VideoCapture(0) | ||
detector = cv2.QRCodeDetector() | ||
|
||
os.makedirs("./qr", exist_ok=True) | ||
|
||
while True: | ||
_, image = capture.read() | ||
data, bbox, _ = detector.detectAndDecode(image) | ||
|
||
if data: | ||
with open(f"qr/scan-{time.time()}.json", "w") as fp: | ||
fp.write(data) | ||
print("Data saved (hash=%s)" % hashlib.md5(data.encode('utf-8')).hexdigest()) | ||
break |