Stream OpenCV Video Stream in HTML webpage Django Python
I am using Django Framework. Can anyone advise how should I modify the views.py to enable Video Stream at HTML webpage? Views.py def camera(request): id = 0 cap = cv2.VideoCapture(0) font = cv2.FONT_HERSHEY_PLAIN while id == 0: _, frame = cap.read() decodedObjects = pyzbar.decode(frame) for obj in decodedObjects: #print("Data", obj.data) id = str(obj.data) id = id[2:-1] print(type(id)) print(id) cv2.putText(frame, str(obj.data), (50, 50), font, 2, (255, 0, 0), 3) cv2.imshow("Frame", frame) key = cv2.waitKey(1) if id != 0: cv2.destroyAllWindows() return redirect('product_detail', id) return ren
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.