九重水:弄好之后不要忘记贴个代码出来,[表情]
QImageReader里的
High Resolution verisons of Images那里有具体说明。
.......
(2020-11-10 10:36)
if img.ndim == 3:
img_show = cv2.cvtColor(img, code=cv2.COLOR_BGR2RGB)
height, width, bytes_per_component = img_show.shape
bytes_per_line = bytes_per_component * width
q_image = QImage(img_show.data, width, height, bytes_per_line, QImage.Format_RGB888)
转的代码是这个,我们采用的pyqt,img变量为传进来的opencv读的图