[英]What is the difference between an opencv BGR image and its reverse version RGB image[:,:,::-1]?
[英]OpenCV: What is the dimension of the array representing a BGR image?
来自文档
图像属性包括行数,列数和通道数,图像数据类型,像素数等。
图像的形状由img.shape访问。 它返回行,列和通道数的元组(如果图像是彩色的):
>>> print img.shape
(342, 548, 3)
注意
如果图像是灰度的,则返回的元组仅包含行数和列数。 因此,这是一种检查加载的图像是灰度图像还是彩色图像的好方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.