图像属性:
import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt
# 读取图像
img1 = cv.imread("img/img1.jpeg")
print(img1.shape) # 图像形状
print(img1.size) # 图像大小
print(img1.dtype) # 数据类型
import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt
# 载入图片
img = np.zeros((512,512,3),np.uint8)
# 操作像素点
img[100,100] = (0,0,255)
plt.imshow(img[:,:,::-1])
plt.show()