Ejemplo n.º 1
0
def show_frame():
    _, frame = cap.read()
    frame = cv2.flip(frame, 1)
    cv2image = cv2.cvtColor(frame, cv2.COLOR_BGR2RGBA)
    cv2image = cv2.resize(cv2image, (width, height));
    img1 = Image.fromarray(cv2image)
    imgtk1 = ImageTk.PhotoImage(image=img1)
    videoStream1.imgtk1 = imgtk1
    videoStream1.configure(image=imgtk1)
    
    frame_open = etMain.startFrame()
    frame_resized = cv2.resize(frame_open, (width, height), interpolation = cv2.INTER_AREA)
    img2 = Image.fromarray(frame_resized)
    imgtk2 = ImageTk.PhotoImage(image=img2)
    videoStream2.imgtk2 = imgtk2
    videoStream2.configure(image=imgtk2)

    frameBinary = etMain.thresholdFrame()
    frameB_resized = cv2.resize(frameBinary, (width, height), interpolation = cv2.INTER_AREA)
    img3 = Image.fromarray(frameB_resized)
    imgtk3 = ImageTk.PhotoImage(image=img3)
    videoStream3.imgtk3 = imgtk3
    videoStream3.configure(image=imgtk3)
    
    frameCopy = etMain.detectedFrame()
    if(frameCopy != None):
        frameC_resized = cv2.resize(frameCopy, (width, height), interpolation = cv2.INTER_AREA)
        img4 = Image.fromarray(frameC_resized)
        imgtk4 = ImageTk.PhotoImage(image=img4)
        videoStream4.imgtk4 = imgtk4
        videoStream4.configure(image=imgtk4)

    videoStream1.after(20, show_frame)
def show_frame3():
    frame_open = etMain.startFrame()
    frameBinary = etMain.thresholdFrame()
    frameCopy = etMain.detectedFrame()
    frameC_resized = cv2.resize(frameCopy, (width, height), interpolation = cv2.INTER_AREA)
    img = Image.fromarray(frameC_resized)
    imgtk = ImageTk.PhotoImage(image=img)
    videoStream3.imgtk = imgtk
    videoStream3.configure(image=imgtk)
    videoStream3.after(30, show_frame3)