import cv2
import webbrowser
import qrcode
video = cv2.VideoCapture(0)
dedektor= cv2.QRCodeDetector()
video.set(3,1920)
video.set(4,1080)
while True:
ret, frame = video.read()
data, bbox, straight_qrcode = dedektor.detectAndDecode(frame)
print(time.perf_counter() -st)
if len(data) > 0:
print("QRCODE")
# print(data)
break
cv2.imshow('frame', frame)
if cv2.waitKey(1)== ord('e'):
break
video.release()
cv2.destroyAllWindows()
webbrowser.open(data, new=2)
I'm trying to throw this code into the raspberry pi, but it gives a module error. Even though I try to install the ubuntu packages in the terminal, the error does not change.
我尝试下载 Ubuntu 版本的软件包,但失败了。还有另一个模块吗?我该怎么办?