资源简介
利用OpenCV实现用电脑上连接的摄像头拍照并保存照片,利用pyqt5设计了个相机界面。资源中包含全部完整文件(UI文件,图片,qrc、py文件),所有代码已调试通过,详细实现过程及代码注释可参考本人博客。

代码片段和文件信息
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file ‘Camera.ui‘
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore QtGui QtWidgets
class Ui_MainWindow(object):
def setupUi(self MainWindow):
MainWindow.setobjectName(“MainWindow“)
MainWindow.setWindowModality(QtCore.Qt.NonModal)
MainWindow.resize(765 645)
MainWindow.setMinimumSize(QtCore.QSize(765 645))
MainWindow.setMaximumSize(QtCore.QSize(16777215 16777215))
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(“:/newPrefix/pic/pai.png“) QtGui.QIcon.Normal QtGui.QIcon.Off)
MainWindow.setWindowIcon(icon)
MainWindow.setToolTip(““)
MainWindow.setAutoFillBackground(False)
MainWindow.setTabShape(QtWidgets.QTabWidget.Rounded)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setobjectName(“centralwidget“)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.centralwidget)
self.horizontalLayout_2.setobjectName(“horizontalLayout_2“)
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setobjectName(“verticalLayout“)
self.label = QtWidgets.QLabel(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
self.label.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setFamily(“华文隶书“)
font.setPointSize(20)
self.label.setFont(font)
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setobjectName(“label“)
self.verticalLayout.addWidget(self.label)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
self.horizontalLayout.setContentsMargins(-1 50 -1 -1)
self.horizontalLayout.setSpacing(0)
self.horizontalLayout.setobjectName(“horizontalLayout“)
self.pushButton_open = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_open.setMinimumSize(QtCore.QSize(100 40))
self.pushButton_open.setMaximumSize(QtCore.QSize(120 40))
font = QtGui.QFont()
font.setFamily(“华文彩云“)
font.setPointSize(12)
self.pushButton_open.setFont(font)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(“:/newPrefix/pic/g1.png“) QtGui.QIcon.Normal QtGui.QIcon.Off)
self.pushButton_open.setIcon(icon1)
self.pushButton_open.setobjectName(“pushButton_open“)
self.horizontalLayout.addWidget(self.pushButton_open)
self.pushButton_take = QtWidgets.QPushButton(self.centralwidget)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 138 2019-06-03 11:55 Qt-Camera\.idea\encodings.xm
文件 301 2019-06-03 11:56 Qt-Camera\.idea\misc.xm
文件 277 2019-06-03 11:55 Qt-Camera\.idea\modules.xm
文件 448 2019-06-03 11:56 Qt-Camera\.idea\Qt-Camera.iml
文件 6681 2019-06-03 11:57 Qt-Camera\.idea\workspace.xm
文件 7631 2019-06-02 14:51 Qt-Camera\Camera.py
文件 7726 2019-06-02 01:41 Qt-Camera\Camera.ui
文件 178 2019-06-02 00:27 Qt-Camera\icon.qrc
文件 1331550 2019-06-02 00:30 Qt-Camera\icon_rc.py
文件 101198 2019-06-02 13:00 Qt-Camera\m15.ico
文件 221151 2019-06-02 00:17 Qt-Camera\pic\down.png
文件 15179 2019-05-18 23:10 Qt-Camera\pic\g1.png
文件 3896 2019-05-25 16:12 Qt-Camera\pic\Hint.png
文件 77147 2019-06-02 00:20 Qt-Camera\pic\pai.png
文件 5632 2019-06-02 00:25 Qt-Camera\pic\Thumbs.db
文件 10585 2019-06-02 15:30 Qt-Camera\run_Camera.py
文件 318995 2019-06-02 14:58 Qt-Camera\__pycache__\icon_rc.cpython-37.pyc
目录 0 2019-06-03 11:57 Qt-Camera\.idea
目录 0 2019-06-02 14:49 Qt-Camera\pic
目录 0 2019-06-02 14:58 Qt-Camera\__pycache__
目录 0 2019-06-03 11:57 Qt-Camera
----------- --------- ---------- ----- ----
2108713 21
相关资源
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 15个pyqt5项目
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- pyqt5动态加载ui文件,动态加载背景图
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
- 基于PyQt5的视频播放器设计
- 一个简单的python爬虫
- csv文件行列转换python实现代码
- Python操作Mysql教程手册
- Python Machine Learning Case Studies
- python获取硬件信息
评论
共有 条评论