可以读取文件里所有的图像,显示,评分并进行统计
源码如下:
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Test.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QGraphicsScene, QGraphicsPixmapItem,QGraphicsView
from PyQt5.QtGui import QPixmap, QImage
import os
import cv2
import sys
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(1677, 1013)
self.ImgView_1 = QtWidgets.QGraphicsView(Form)
self.ImgView_1.setGeometry(QtCore.QRect(10, 10, 400, 600))
self.ImgView_1.setMinimumSize(QtCore.QSize(400, 600))
self.ImgView_1.setMaximumSize(QtCore.QSize(400, 600))
self.ImgView_1.setObjectName("ImgView_1")
self.ImgView_2 = QtWidgets.QGraphicsView(Form)
self.ImgView_2.setGeometry(QtCore.QRect(420, 10, 400, 600))
self.ImgView_2.setMinimumSize(QtCore.QSize(400, 600))
self.ImgView_2.setMaximumSize(QtCore.QSize(400, 600))
self.ImgView_2.setObjectName("ImgView_2")
self.ImgView_3 = QtWidgets.QGraphicsView(Form)
self.ImgView_3.setGeometry(QtCore.QRect(830, 10, 400, 600))
self.ImgView_3.setMinimumSize(QtCore.QSize(400, 600))
self.ImgView_3.setMaximumSize(QtCore.QSize(400, 600))
self.ImgView_3.setObjectName("ImgView_3")
self.lineEdit_1 = QtWidgets.QLineEdit(Form)
self.lineEdit_1.setGeometry(QtCore.QRect(1240, 10, 370, 20))
self.lineEdit_1.setMinimumSize(QtCore.QSize(370, 20))
self.lineEdit_1.setMaximumSize(QtCore.QSize(370, 20))
self.lineEdit_1.setObjectName("lineEdit_1")
self.lineEdit_2 = QtWidgets.QLineEdit(Form)
self.lineEdit_2.setGeometry(QtCore.QRect(1240, 40, 370, 20))
self.lineEdit_2.setMinimumSize(QtCore.QSize(370, 20))
self.lineEdit_2.setMaximumSize(QtCore.QSize(370, 20))
self.lineEdit_2.setObjectName("lineEdit_2")
self.lineEdit_3 = QtWidgets.QLineEdit(Form)
self.lineEdit_3.setGeometry(QtCore.QRect(1240, 70, 370, 20))
self.lineEdit_3.setMinimumSize(QtCore.QSize(370, 20))
self.lineEdit_3.setMaximumSize(QtCore.QSize(370, 20))
self.lineEdit_3.setObjectName("lineEdit_3")
self.lineEdit_4 = QtWidgets.QLineEdit(Form)
self.lineEdit_4.setGeometry(QtCore.QRect(1240, 100, 370, 20))
self.lineEdit_4.setMinimumSize(QtCore.QSize(370, 20))
self.lineEdit_4.setMaximumSize(QtCore.QSize(370, 20))
self.lineEdit_4.setObjectName("lineEdit_4")
self.labelPath_1 = QtWidgets.QLabel(Form)
self.labelPath_1.setGeometry(QtCore.QRect(1620, 10, 50, 20))
self.labelPath_1.setMinimumSize(QtCore.QSize(50, 20))
self.labelPath_1.setMaximumSize(QtCore.QSize(50, 20))
font = QtGui.QFont()
font.setFamily("Times New Roman")
font.setPointSize(11)
font.setBold(True)
font.setWeight(75)
self.labelPath_1.setFont(font)
self.labelPath_1.setObjectName("labelPath_1")
self.labelPath_2 = QtWidgets.QLabel(Form)
self.labelPath_2.setGeometry(QtCore.QRect(1620, 40, 50, 20))
self.labelPath_2.setMinimumSize(QtCore.QSize(50, 20))
self.labelPath_2.setMaximumSize(QtCore.QSize(50, 20))
font = QtGui.QFont()
font.setFamily("Times New Roman")
font.setPointSize(11)
font.setBold(True)
font.setWeight(75)
self.labelPath_2.setFont(font)
self.labelPath_2.setObjectName("labelPath_2")
self.labelPath_3 = QtWidgets.QLabel(Form)
self.labelPath_3.setGeometry(QtCore.QRect(1620, 70, 50, 20))
self.labelPath_3.setMinimumSize(QtCore.QSize(50, 20))
self.labelPath_3.setMaximumSize(QtCore.QSize(50, 20))
font = QtGui.QFont()
font.setFamily("Times New Roman")
font.setPointSize(11)
font.setBold(True)
font.setWeight(75)
self.labelPath_3.setFont(font)
self.labelPath_3.setObjectName("labelPath_3")
self.labelPath_4 = QtWidgets.QLabel(Form)
self.labelPath_4.setGeometry(QtCore.QRect(1620, 100, 50, 20))
self.labelPath_4.setMinimumSize(QtCore.QSize(50, 20))
self.labelPath_4.setMaximumSize(QtCore.QSize(50, 20))
font = QtGui.QFont()
font.setFamily("Times New Roman")
font.setPointSize(11)
font.setBold(True)
font.setWeight(75)
self.labelPath_4.setFont(font)
self.labelPath_4.setObjectName("labelPath_4")
self.View_4 = QtWidgets.QGraphicsView(Form)
self.View_4.setGeometry(QtCore.QRect(1240, 130, 420, 480))
self.View_4.setMinimumSize(QtCore.QSize(420, 480))
self.View_4.setMaximumSize(QtCore.QSize(420, 480))
self.View_4.setObjectName("View_4")
self.LoadButton = QtWidgets.QPushButton(Form)
self.LoadButton.setGeometry(QtCore.QRect(1270, 630, 75, 30))
self.LoadButton.setMinimumSize(QtCore.QSize(75, 30))
self.LoadButton.setMaximumSize(QtCore.QSize(75, 30))
font = QtGui.QFont()
font.setFamily("Times New Roman")
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.LoadButton.setFont(font)
self.LoadButton.setObjectName("LoadButton")
self.ResetButton = QtWidgets.QPushButton(Form)
self.ResetButton.setGeometry(QtCore.QRect(1380, 6