“imagio.imsave”vs“imageio.core.util.array.tofile”

um6iljoc  于 2021-09-08  发布在  Java
关注(0)|答案(1)|浏览(249)

通过将一些matlab图像分析代码转换为python,我扩展了有限的python知识。我正在使用numpy和scipy进行图像处理。第2.6.1节中的代码使用两种方法保存图像 imageio.imsaveface.tofile 哪里 type(face)=<class 'imageio.core.util.Array>' .
我试图理解为什么导出图像有两种方法。我尝试了网络搜索 tofile ,但得到了numpy.ndarray.tofile。它非常稀疏,并且似乎不是特定于图像的。我还找了 imageio.core.util.Array.tofile ,但什么也找不到。
为什么有两种导出文件的方法?为什么 imageio.core.util.Array.tofile 似乎无法在网上找到?

vnjpjtjt

vnjpjtjt1#

区别在于这两个函数在文件中写入的内容。 imageio.imsave() 以jpeg/png格式保存常规图像,如图片或照片,可使用gimp等图像查看器查看, feh , eog 、photoshop或msxpaint。
tofile()以numpy兼容的格式保存,只有numpy(和少量其他python工具)使用。

相关问题