树莓派下OpenCv没有QImage.Format_BGR888导致显示的色彩翻转不能正确显示色彩的问题

阅读 133

2022-04-14

在树莓派下使用opencv显示图像色彩的时候,QImage()方法没有QImage.Format_BGR888,我使用了QImage.Format_RGB888,然后颜色是翻转色

showImage = QImage(self.image, self.image.shape[1],self.image.shape[0], QImage.Format_RGB888)

原题

请添加图片描述

# 显示画面
self.image = cv.cvtColor(self.image, cv.COLOR_BGR2RGB)

showImage = QImage(self.image.data, self.image.shape[1], self.image.shape[0],self.image.shape[1] * 3, QImage.Format_RGB888)

精彩评论(0)

0 0 举报