[英]Converting image to grayscale python
任何人都可以在for循環之后通過平均方法或加權方法將代碼轉換為go
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()
已經有一篇關於此的帖子- 您可以輕松使用 PIL,也可以使用 Numpy 和 Matplotlib 自己創建它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.