Created
November 28, 2020 13:01
-
-
Save JayateerthDambal/488670c13aadf752d7b7c3f69448ef23 to your computer and use it in GitHub Desktop.
Webcam reader
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
import cv2 | |
def qr_readervideo(): | |
cam = cv2.VideoCapture(0) | |
reader = cv2.QRCodeDetector() | |
while True: | |
_, img = cam.read() | |
data, bbox, _ = reader.detectAndDecode(img) | |
if data: | |
print("Detected the QR Code -->", data) | |
cv2.imshow("QR Image", img) | |
if cv2.waitKey(10) == ord('q'): | |
break | |
cam.release() | |
cv2.destroyAllWindows() | |
qr_readervideo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment