1 #!D:/Code/python 2 # -*- coding: utf-8 -*- 3 # @Time : 2019/8/26 17:55 4 # @Author : Johnye 5 # @Site : 6 # @File : imageIO.py 7 # @Software: PyCharm 8 9 10 11 """ 12 # WINDOW_AUTOSIZE = 1 13 # WINDOW_FREERATIO = 256 14 # WINDOW_FULLSCREEN = 1 15 # WINDOW_GUI_EXPANDED = 0 16 # WINDOW_GUI_NORMAL = 16 17 # WINDOW_KEEPRATIO = 0 18 # WINDOW_NORMAL = 0 19 # WINDOW_OPENGL = 20 CV_WINDOW_NORMAL或CV_WINDOW_AUTOSIZE:CV_WINDOW_NORMAL 允许您调整窗口大小, 21 CV_WINDOW_AUTOSIZE 自动调整窗口大小以适合显示的图像(请参阅 imshow()),并且您无法手动更改窗口大小。 22 CV_WINDOW_FREERATIO 调整图像而不考虑其比例而 23 CV_WINDOW_KEEPRATIO 保持图像比率。 24 CV_GUI_NORMAL或CV_GUI_EXPANDED: CV_GUI_NORMAL 是绘制没有状态栏和工具栏的窗口的旧方法,而 CV_GUI_EXPANDED 是一个新的增强GUI。 25 cv.namedWindow("input", cv.WINDOW_GUI_EXPANDED) 26 27 """ 28 import cv2 as cv 29 src = cv.imread("D:wallpaperdesk770295728.jpg") 30 cv.namedWindow("input", cv.WINDOW_NORMAL) 31 cv.imshow("input", src) 32 cv.waitKey(5000)