OpenCV-001:读取图片并显示
程序员文章站
2022-03-19 22:01:41
...
#https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_gui/py_image_display/py_image_display.html#display-image
###########################################
####Import Module ####
import cv2
#import numpy
###########################################
####Main Function ####
img=cv2.imread("D:\\Data\\016_ComputerVision\\img\\img.jpg",cv2.IMREAD_GRAYSCALE)
#img=cv2.imread("D:\\Data\\016_ComputerVision\\img\\img.jpg",cv2.IMREAD_COLOR )
cv2.namedWindow("opencv001",cv2.WINDOW_NORMAL )
#cv2.namedWindow("opencv001",cv2.WINDOW_AUTOSIZE )
cv2.imshow("opencv001",img)
cv2.waitKey(0)
#cv2.waitKey (1000)
cv2.destroyAllWindows()