I did a program with python, importing the OpenCV's libraries. Now, I'm doing the GUI in Tkinter. I'm trying to show the webcam in the GUI but I couldn't. I put the code in the Function because I would like with a push button see my webcam.
My code is:
def webcam():
img= cv.QueryFrame(cap)
cam= PhotoImage(img)
label1 = Label(root, image=cam)
label1.image = cam
label1.pack()
label1.place(x=0, y=400)
Also, I don't know how update constantly without a while cycle, because I have another push button to quit the program.