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 or CV_WINDOW_AUTOSIZE: CV_WINDOW_NORMAL allows you to resize a window, 21 CV_WINDOW_AUTOSIZE automatically resize the window to fit the displayed image (See imshow ()), and you can not manually change the window size. 22 is CV_WINDOW_FREERATIO image adjustment ratio thereof regardless 23 is CV_WINDOW_KEEPRATIO holding image ratio. 24- CV_GUI_NORMAL or CV_GUI_EXPANDED: CV_GUI_NORMAL is to draw the old method no window status bar and toolbar, and CV_GUI_EXPANDED is a new enhanced GUI. 25 cv.namedWindow ( "INPUT", cv.WINDOW_GUI_EXPANDED) 26 is 27 "" " 28 Import CV2 AS CV 29 the src = cv.imread ( " D: \ Wallpaper \ desk7702 \ 95728.jpg " ) 30 cv.namedWindow("input", cv.WINDOW_NORMAL) 31 cv.imshow("input", src) 32 cv.waitKey(5000)