Código Python:
Ver original
import cv import time from Tkinter import * from threading import Timer ventana = Tk() ventana.title("Botones") ventana.geometry("350x50+500+150") def foto_seg(): def stream(): global camara global frame frame = cv.QueryFrame(camara) cv.ShowImage("camara", frame) cv.MoveWindow("camara", 600, 320) cv.SaveImage("testing.png", frame) stream() def contador(texto): def count(): global counter counter += -1 texto.config(text=str(counter)) texto.after(1000, count) count() global istime while (istime): stream() cv.WaitKey(15) istime -= 1 seg = Tk() seg.geometry("350x50+700+350") seg.title("Captura") Label(seg, text="Tomando foto en ....", fg = "black", font = "Verdana 10 bold").pack() texto = Label(seg, fg="red", font = "Verdana 16 bold") contador(texto) texto.pack() for x in range(0, 60): seg.update() time.sleep(0.07) seg.destroy() time.sleep(5) boton = Button(ventana, text="Iniciar", width=10, command=foto_seg).pack() boton = Button(ventana, text="Exit", width=10, command=sys.exit).pack() istime = 10 frame = None counter = 5 camera = None camara = cv.CaptureFromCAM(0) cv.SetCaptureProperty(camara, cv.CV_CAP_PROP_FRAME_HEIGHT, 480/2) cv.SetCaptureProperty(camara, cv.CV_CAP_PROP_FRAME_WIDTH, 640/2) cv.NamedWindow("camara", cv.CV_WINDOW_AUTOSIZE) cv.DestroyAllWindows("camara") cv.ShowImage("camara", frame) ventana.mainloop()
Me sale este error nose como solucionarlo
invalid command name "40594240callit"
while executing
"40594240callit"
("after" script)
Gracias