Plt.imshow(img) # IMG was originally in BGR format and was converted to RGB format through img # cv2 read image - > qpixmap let QLabel displayĭef Opencv_to_QPixmap(self,pic_show_label,path): Self.cvread_labelshow(pic_show_label=self.label,path=path) # Call cv2 to read the image - > qpixmap to make QLabel display Plt.imshow(image) # Normal displayĬomplete process: opencv - > qimage - > qpixmap On the contrary, if it is the same as the original image, it is in RGB format # image type must be, plt can be displayed Since the test image is red, if the result shows blue, it proves that the image is in BGR format. The following method will see two pictures compared together: This is to use matplotlib alone to display and view the effect of conversion: The parameters photo and path involved in the following methods come from this # print('photo type:', type(photo), photo.width(), photo.height()) # r'F:\python\gradu_design\gra_des\imges\logo1_1.jpg' Path = r'F:\python\gradu_design\gra_des\compr\bamarket115.jpg' Here is a collection of simple image processing basic format conversion used in image interface design. Later, I saw this article occasionally: displays multiple pictures and supports scrolling, one line of code: label Setscaledcontents (true) adapts the size of window controls, so I collected all kinds of information on the Internet, tested it myself, and finally summarized it into this blog. This method is simple and clear, but you know the disadvantages Save the rotated image CV2 Imwrite() and read the image againīecause of the basic operation of images, I am a little white and have never touched anything.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |