import cv2
import numpy as np
width = 640 # 图像宽度
height = 480 # 图像高度
channels = 3 # 颜色通道数
imgEmpty = np.empty((height, width, channels), np.uint8) # 创建空白数组
imgBlack = np.zeros((height, width, channels), np.uint8) # 创建黑色图像 RGB=0
imgWhite = np.ones((height, width, channels), np.uint8) * 255 # 创建白色图像 RGB=255
# 读取图像文件
image = cv2.imread('F:\\MYOpenCV\\xihuduanqiao.jpg')
if image is None:
print('Image not found!!!')
else:
# 显示图像
cv2.imshow('Loaded Image', image)
cv2.waitKey()
cv2.destroyAllWindows()