我策划这个图像的灰度版本: a busy cat http://matplotlib.org/_images/griddata_demo.png 来源:http://matplotlib.org/examples/pylab_examples/griddata_demo.html 我用下面的代码: import numpy as np
import matplotlib.pyplot as pl
我的程序要求用户输入P6 .ppm图像的文件名,然后我的程序将一个新文件写入P5 .pgm图像,将其转换为灰度。 我的程序完美运行,除非正在打开的图像在标题中有注释。我不确定我的问题是在我的Main()还是在我的GetNum中。任何帮助深表感谢! 我的主要看起来像这样 fileInput = raw_input("Enter the name of the original file includ