def set_img(self, img):
self.img = cv2.imread(img, 1)
self.img = cv2.cvtColor(self.img, cv2.COLOR_RGB2BGR)
if self.img is not None:
showImage = QImage(self.img.data, self.img.shape[1], self.img.shape[0],
QImage.Format_RGB888)
self.setPixmap(QPixmap.fromImage(showImage))
else:
self.update()
在label中显示原彩图片
最新推荐文章于 2024-07-23 13:46:49 发布