cm
This commit is contained in:
parent
74de674d28
commit
f47585fb68
@ -1,29 +1,29 @@
|
|||||||
import cv2
|
import cv2
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pyzbar.pyzbar as pyzbar
|
import pyzbar.pyzbar as pyzbar
|
||||||
import webbrowser
|
import webbrowser
|
||||||
|
|
||||||
|
|
||||||
cap = cv2.VideoCapture(0)
|
cap = cv2.VideoCapture(0) # PRZCHYWĆ OBRAZ
|
||||||
font = cv2.FONT_HERSHEY_PLAIN
|
font = cv2.FONT_HERSHEY_PLAIN
|
||||||
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
_, frame = cap.read()
|
_, frame = cap.read() #CZYTAJ OBRAZ Z OKNA
|
||||||
|
|
||||||
decodedObjects = pyzbar.decode(frame)
|
decodedObjects = pyzbar.decode(frame)
|
||||||
for obj in decodedObjects:
|
for obj in decodedObjects:
|
||||||
#print("Data", obj.data)
|
|
||||||
cv2.putText(frame, str(obj.data), (50, 50), font, 2, # POKAŻ NA EKRAN NAPIS Z LINKU KODU QR
|
cv2.putText(frame, str(obj.data), (50, 50), font, 2, # POKAŻ NA EKRAN NAPIS Z LINKU KODU QR
|
||||||
(255, 0, 0), 3)
|
(255, 0, 0), 3)
|
||||||
|
|
||||||
webbrowser.open(obj.data, new=2) # OTWÓŻ PRZEGLĄDARKĘ, WYŚWIETL LINK Z KODU QR
|
webbrowser.open(obj.data, new=2) # OTWÓRZ PRZEGLĄDARKĘ
|
||||||
|
|
||||||
|
|
||||||
cv2.imshow("Frame", frame)
|
cv2.imshow("Frame", frame) # WYŚWIETL OBRAZ W OKNIE
|
||||||
|
|
||||||
key = cv2.waitKey(1)
|
key = cv2.waitKey(1) & 0xFF == ord('q') #CZEKAJ NA OBRAZ
|
||||||
if key == 27:
|
if key == 27:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user