其他分享
首页 > 其他分享> > 将numpy图片转化为QPixmap

将numpy图片转化为QPixmap

作者:互联网

img = image_data #numpy类型图片
img = img.astype("uint8")
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img = QtGui.QImage(img[:], img.shape[1], img.shape[0], img.shape[1] * 3,QtGui.QImage.Format_RGB888)
self.label.setPixmap(QtGui.QPixmap(img))

标签:QtGui,img,cv2,shape,numpy,QPixmap,图片
来源: https://blog.csdn.net/weixin_44431795/article/details/122016214