博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Python: PS 滤镜--高反差保留 (High pass)
阅读量:4515 次
发布时间:2019-06-08

本文共 612 字,大约阅读时间需要 2 分钟。

本文用 Python 实现 PS 滤镜中的 高反差保留 特效,具体的算法原理和图像效果可以参考之前的博客:

import matplotlib.pyplot as pltfrom skimage import iofrom skimage.filters import gaussianfile_name='D:/Visual Effects/PS Algorithm/4.jpg';img=io.imread(file_name)img = img * 1.0gauss_out = gaussian(img, sigma=5, multichannel=True)img_out = img - gauss_out + 128.0img_out = img_out/255.0# 饱和处理mask_1 = img_out  < 0 mask_2 = img_out  > 1img_out = img_out * (1-mask_1)img_out = img_out * (1-mask_2) + mask_2plt.figure()plt.imshow(img/255.0)plt.axis('off')plt.figure(2)plt.imshow(img_out)plt.axis('off')plt.show()

转载于:https://www.cnblogs.com/mtcnn/p/9412402.html

你可能感兴趣的文章
给DEDE织梦CMS添加搜索结果页显示自定义字段
查看>>
第二章 第五节 获取帮助
查看>>
分布式监控系统Zabbix-3.0.3-完整安装记录(0)
查看>>
关于源代码及其管理工具的总结
查看>>
此文对你人生会有莫大好处的,建议永久保存 2013-07-26 11:04 476人阅读 评论(0) ...
查看>>
win10 压缩包安装mysql8.0.11报错:Access denied for user 'root'@'localhost'
查看>>
随笔:关于去年的WordPress建站的回忆
查看>>
iptables配置——NAT地址转换
查看>>
vue----生命周期
查看>>
tornado ThreadPoolExecutor
查看>>
类里的方法要不要加参数
查看>>
C#毫秒转时分秒格式
查看>>
flask SQLAlchemy pymysql 连接数据库
查看>>
Mac 域名解析
查看>>
ios ViewController present不同的方向
查看>>
未知宽高元素水平垂直居中
查看>>
while 、函数、参数
查看>>
POJ 2762 Going from u to v or from v to u?(Tarjan + 拓扑排序)
查看>>
洛谷P1312 [NOIP2011提高组Day1T3]Mayan游戏
查看>>
BZOJ4293: [PA2015]Siano
查看>>