李宏毅老师机器学习作业hw0李宏毅老师机器学习作业hw0
李宏毅老师机器学习作业hw0

content=open("words.txt").read()
array=content.split(" ")
orderindex=0
for i in range(len(array)):
    if array.index(array[i])==i:
        print("%s %s %s"%(array[i],orderindex,array.count(array[i])))
        orderindex=orderindex+1

李宏毅老师机器学习作业hw0李宏毅老师机器学习作业hw0

from PIL import Image
import matplotlib.pyplot as plt

img = Image.open('westbrook.jpg')
pix = img.load()
width = img.size[0]
print(width)
height = img.size[1]
print(height)
for x in range(width):
    for y in range(height):
        r,g,b=pix[x, y]
        pix[x,y]=int(r/2),int(g/2),int(b/2)
plt.figure("westbrook")
plt.imshow(img, cmap='gray')
plt.axis('off')
plt.show()

相关文章:

  • 2021-06-06
  • 2021-11-16
  • 2021-05-14
  • 2021-10-08
  • 2021-08-08
  • 2021-05-25
  • 2021-11-19
猜你喜欢
  • 2021-10-12
  • 2022-12-23
  • 2021-07-05
  • 2022-12-23
  • 2021-06-15
  • 2021-12-06
  • 2021-11-23
相关资源
相似解决方案