欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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()