这里是,显示到 ui.label_41上
from PyQt5 import QtGui
import cv2 as cv
image = cv.imread('lena.png')
height, width = image.shape[:2]
# 显示lena图像到界面
img = cv.cvtColor(image_brightened, cv.COLOR_BGR2RGB)
img = QtGui.QImage(img.data, width, height, 3 * width, QtGui.QImage.Format_RGB888)
img = QtGui.QPixmap(img)
self.ui.label_41.setScaledContents(True) # 设置铺满
self.ui.label_41.setPixmap(img) # 显示lena图像
代码只有关键部分,不能直接运行,要结合界面文件