Skip to content

Instantly share code, notes, and snippets.

@JayateerthDambal
Created November 28, 2020 13:01
Show Gist options
  • Save JayateerthDambal/488670c13aadf752d7b7c3f69448ef23 to your computer and use it in GitHub Desktop.
Save JayateerthDambal/488670c13aadf752d7b7c3f69448ef23 to your computer and use it in GitHub Desktop.
Webcam reader
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