版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_43154228/article/details/86703432

img.shape[:2] 取彩色图片的长、宽。
如果img.shape[:3] 则取彩色图片的长、宽、通道。

关于img.shape[0]、[1]、[2]
img.shape[0]:图像的垂直尺寸(高度)
img.shape[1]:图像的水平尺寸(宽度)
img.shape[2]:图像的通道数

在矩阵中,[0]就表示行数,[1]则表示列数。

参考:
[1]https://www.cnblogs.com/denny402/p/5121897.html
[2]https://blog.csdn.net/u014345473/article/details/80631467
[3]https://blog.csdn.net/yournevermore/article/details/84317984

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐