我正在研究全景图像拼接,在imread函数中我得到了格式错误:PNG文件有无效的签名。我在谷歌上搜索,但没有找到什么都可以你给我解释一下出错的原因?在
编辑:baseInputPath+path=Input/panoramage30/image1.png
baseInputPath='Input/'
baseOutputPath='Output/'
def imread(path='in.png'):
'''reads a PNG RGB image at baseInputPath+path and return a numpy array organized along Y, X, channel.
The values are encoded as float and are linearized (i.e. gamma is decoded)'''
global baseInputPath
print baseInputPath+path
reader=png.Reader(baseInputPath+path)
im=reader.asFloat()
a=numpy.vstack(im[2])
if im[3]['greyscale']:
raise NameError( 'Expected an RGB image, given a greyscale one')
x, y=im[0], im[1]
a.resize(y, x, 3)
a**=2.2
return a
一开始我把jpeg文件转换成png-so文件堕落了。现在重新改造了它并取得了成功。在
相关问题 更多 >
编程相关推荐