有人能帮我把代码转换成平均法或加权法的灰度值吗
import matplotlib.pyplot
import numpy
myImage = matplotlib.pyplot.imread('flower.png')
height=myImage.shape[0]
width=myImage.shape[1]
for x in range(0, height-1):
for y in range(0,width-1):
INSET CODE HERE
imgplot = matplotlib.pyplot.imshow(myImage)
matplotlib.pyplot.show()
关于这一点已经有了一个post的说法——您可以轻松地使用PIL,也可以使用Numpy和Matplotlib自己创建它
相关问题 更多 >
编程相关推荐