- 运行到
img.shap
提示如下:
(h1, w1) = img.shape[:2]
AttributeError: 'NoneType' object has no attribute 'shape'
原因:img是空的,所以为了保持程序的健壮性,在类似读取图片后有返回值的函数时,都要判断函数功能是否正确执行。
img.shap
提示如下:(h1, w1) = img.shape[:2]
AttributeError: 'NoneType' object has no attribute 'shape'
原因:img是空的,所以为了保持程序的健壮性,在类似读取图片后有返回值的函数时,都要判断函数功能是否正确执行。