PySimpleGUI/DemoPrograms/PyDroid3/Demo_OpenCV_4_Line_Program.py

6 lines
306 B
Python
Raw Normal View History

2019-12-08 14:16:55 +00:00
import tkinter
import cv2, PySimpleGUI as sg
2019-12-08 14:17:42 +00:00
window, cap = sg.Window('Demo Application - OpenCV Integration', [[sg.Image(filename='', key='image')], ], location=(0, 0)), cv2.VideoCapture(0)
2019-12-08 14:16:55 +00:00
while window(timeout=20)[0] is not None:
window['image'](data=cv2.imencode('.png', cap.read()[1])[1].tobytes())