So I want the user to click a button that will move them to the window with a QR scanner, which I found already written code for using cv2. The issue is that it just creates a cv2 frame instead of a kv screen, and the button that is supposed to be on that screen is not there, it just shows the previous screen with a cv2 frame in a different window
Part with the cv2 webcam screen:
class QrScan(Screen):
def runcam(self):
while True:
_, frame = cap.read()
decodedObjects = pyzbar.decode(frame)
for obj in decodedObjects:
cv2.putText(frame, str(obj.data), (50, 50), font, 2,
(255, 0, 0), 3)
cv2.imshow("Frame", frame)
key = cv2.waitKey(1)
def back(self):
sm.current = "main"
The .kv for it:
<QrScan>:
name: "Qr"
on_pre_enter: root.runcam()
FloatLayout:
Button:
pos_hint:{"x":0.3,"y":0.1}
size_hint: 0.4, 0.1
font_size: (root.width**2 + root.height**2) / 17**4
text: "Back"
on_release:
root.manager.transition.direction = "right"
root.back()
I have seen integration where the whole app is just a cv2 webcam, but those solutions don't work for screens