python tkinter+opencv 视频转图片

本文介绍了在win10环境下,利用python3.7和opencv库结合tkinter进行界面开发,实现视频文件选择及转换为图片的功能。虽然目前功能简单,但计划在后续文章中完善成一个带预览功能的视频转图片软件。
摘要由CSDN通过智能技术生成

准备工作:
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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值