pyqt5 opencv QLabel

通过QLabel显示opencv读取的图片

            from PyQt5.QtGui import QImage,QPixmap
            import cv2
            img = cv2.imread(list_path[index])
            print(list_path[index])
            img = cv2.resize(img, (200, 200))
            frame = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
            img = QImage(frame.data, frame.shape[1], frame.shape[0], QImage.Format_RGB888)
            self.face_show_recognition.setPixmap(QPixmap.fromImage(img))
            cv2.waitKey(1)

你可能感兴趣的:(pyqt5 opencv QLabel)