pyQT界面显示OpenCV采集的摄像头视频
while(1):
print("c")
ret_2, self.image_2 = self.cap.read()
show_2 = cv2.resize(self.image_2, (400, 400))
# 把图片缩小为了快速追踪人眼
# show_4 = cv2.resize(self.image_2, (200, 200))
show_3 = cv2.cvtColor(show_2, cv2.COLOR_BGR2RGB)
detect_image = QImage(show_3.data, show_3.shape[1], show_3.shape[0], QImage.Format_RGB888)
self.label_show.setPixmap(QPixmap.fromImage(detect_image))
为啥在循环体中,调用pyqt中的显示函数QImage无法显示视频