资源简介

利用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.xml

     文件        301  2019-06-03 11:56  Qt-Camera\.idea\misc.xml

     文件        277  2019-06-03 11:55  Qt-Camera\.idea\modules.xml

     文件        448  2019-06-03 11:56  Qt-Camera\.idea\Qt-Camera.iml

     文件       6681  2019-06-03 11:57  Qt-Camera\.idea\workspace.xml

     文件       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


评论

共有 条评论