0
我想调整python中的.tif图像。 但是,当我尝试运行代码我得到以下错误:AttributeError:'NoneType'对象没有属性'形状'调整大小图像
AttributeError: 'NoneType' object has no attribute 'shape'
下面的代码片段:
# Open de beeldfile
image = cv2.imread(fullinname)
# Bepaal afmetingen en aantal kleurkanalen
width = image.shape[1]
height = image.shape[0]
colors = image.shape[2]
print ("{} pixels breed".format(width))
print ("{} pixels hoog".format(height))
print ("{} kleur kanalen".format(colors))
img = cv2.resize(image, (512, 512))
有谁知道如何解决这个问题?
不,只有1个cv2.imread在我的文件 –
如果没有发布5个答案没有解决您的问题,那么也许[任何这些](https://www.google.ca/search?client = safari&rls = en&q = python + cv2.imread +返回+ none&ie = UTF-8&oe = UTF-8&gfe_rd = cr&ei = NF7pWLCjNMuC8Qe4hqPACw)可以提供帮助吗?这是一个相当普遍的问题,我相信一些研究会产生一个解决方案。 (参见[Stack Overflow用户需要多少研究工作?](https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users) ) –
你可以调试'fullinname'吗? – ZdaR