这段代码最初的出处有待考证,国内有诸多版本,下面给出两个链接
PySimpleGUI/Demo_OpenCV_Simple_GUI.py at master · PySimpleGUI/PySimpleGUI · GitHub
50 行代码,看 Python + OpenCV 玩转实时图像处理!_爬遍天下无敌手的博客-CSDN博客
下面这段代码是国外版本修改过的,我的mac上可以正常运行
import PySimpleGUI as sg
import cv2
import numpy as np
"""
Demo program that displays a webcam using OpenCV and applies some very basic image functions
- functions from top to bottom -
none: no processing
threshold: simple b/w-threshold on the luma channel, slider sets the threshold value
cann