准备工作:
1.开发环境:win10,python3.7, python-opencv
然后进入主题
一、界面开发
def cz():
root.title("视频抽帧")#设标题
#设定软件窗口合适大小并居中显示(root.winfo_screenwidth获取电脑屏幕宽度,height获取屏幕高度)
x = (root.winfo_screenwidth()-300)/2
y = (root.winfo_screenheight()-270)/2
root.geometry("300x140+"+str(int(x))+"+"+str(int(y)))
path = Entry(root)
path.place(x=10, y=20, width=200, height=30)#文件路径输入框
file = Button(root, text="选择文件", command=lambda: choose(path=path,))#文件选择按钮
file.place(x=220, y=20, width=75, height=30)
second = Spinbox(root, from_=0, to=10, increment=1, textvariable=v)#定时
second.place(x=10, y=70, width=30, height=20)
slabel = Label(root, text="秒")
slabel.place(x=40, y=70, width=15, height=20)
fps = Spinbox(root, from_=0, to=60, increment=1, textvariable=v1)#定量
fps.place(x=55, y=70, width=35, height=20)
flabel = Label(root, text="帧")
flabel.place(x=90, y=70, width=15, height=20)
beginbt = Button(root, text="开始", command=lambda: begin1(path=path))#转化开始
beginbt.