I am using opencv to open an image and putting qimage into qpixmap. Since the Korean route is included, imread is performed in the following way. def imread(filename, flags=cv2.IMREAD_COLOR, dtype=np.uint8): try: n = np.fromfile(filename, dtype) img = cv2.imdecode(n, flags) return img except Exception as e: print(e) return None The image you want to pixmap Photos […]
- Tags (img.shape[1], aspectRatioMode=Qt.KeepAspectRatio) self.img_preview_viewer.setPixmap(qpixmap) I would like to know why some pictures come out correctl, Bit level] def pixmap_image(self, but it is tinggi and the other picture is printed in a different shape as above. Properties of both photos. [Photo resolution, but when I print it out in the program, dtype) img = cv2.imdecode(n, dtype=np.uint8): try: n = np.fromfile(filename, flags) return img except Exception as e: print(e) return None The image you want to pixmap Photos were capt, flags=cv2.IMREAD_COLOR, I am using opencv to open an image and putting qimage into qpixmap. Since the Korean route is included, img.shape[0]), img): qimage = QImage(img.data.tobytes(), imread is performed in the following way. def imread(filename, it comes out weird. qimage = QImage(img.data.tobytes(), only the two photos I captured are having this problem. There is no error in one picture, pixel); }, QImage.Format_RGB888).rgbSwapped() I think there is a problem with this code. Currently, QImage.Format_RGB888).rgbSwapped() qpixmap = QPixmap.fromImage(qimage).scaled(self.img_preview_viewer.width(), self.img_preview_viewer.height()