图像的BGR格式说明
OpenCV中图像读入的数据格式是numpy的ndarray数据格式。是BGR格式,取值范围是[0,255].
如下图所示,分为三个维度:
?...image.size 返回图像的像素
image.dtype 返回图像的数据类型
1 import cv2
2 import numpy as np
3 img=cv2.imread('buffer.jpg...')
4 print("长度:",img.shape[1], "宽度:",img.shape[0], "通道:", img.shape[2], "像素:", img.size, "数据类型:", img.dtype