猫史档案馆


【Python作品分享】图像处理——1【作业帖】

用户:火红怒放火红怒放查看:0 回复:0 评论:0 创建时间:2020-08-26T19:43:51


【作品展示】

center_image

 

【作品介绍】

这是我的最基本的图像处理帖子,是一个作业。如果大家有任何的高见,请在评论区指教。

 

【作品源代码】

from PIL import Image,ImageFilter
# from matplotlib import pyplot as p
import matplotlib.pyplot as p
img = Image.open('bcm.jpg')

_23 = [
    ImageFilter.BLUR, # 模糊
    ImageFilter.CONTOUR, # 轮廓
    ImageFilter.EDGE_ENHANCE, # 边缘增强
    ImageFilter.EMBOSS, # 浮雕
    ImageFilter.SHARPEN, # 锐化
    ImageFilter.SMOOTH, # 平滑
    ImageFilter.GaussianBlur # 模糊(可调参数)
]

row = 2
col = 3

_, axes = p.subplots(row,col,figsize = (20,20))

for i in range(row):
    for j in range(col):
        index = j+col*i
        im2 = img.filter(_23[index])
        axes[i][j].imshow(im2)
        axes[i][j].set_title(_23[index].name)
p.show()

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页