Python: PS 滤镜--高反差保留 (High pass)
2024-08-31 13:43:45
本文用 Python 实现 PS 滤镜中的 高反差保留 特效,具体的算法原理和图像效果可以参考之前的博客:
http://blog.csdn.net/matrix_space/article/details/25492391
import matplotlib.pyplot as plt
from skimage import io
from skimage.filters import gaussian
file_name='D:/Visual Effects/PS Algorithm/4.jpg';
img=io.imread(file_name)
img = img * 1.0
gauss_out = gaussian(img, sigma=5, multichannel=True)
img_out = img - gauss_out + 128.0
img_out = img_out/255.0
# 饱和处理
mask_1 = img_out < 0
mask_2 = img_out > 1
img_out = img_out * (1-mask_1)
img_out = img_out * (1-mask_2) + mask_2
plt.figure()
plt.imshow(img/255.0)
plt.axis('off')
plt.figure(2)
plt.imshow(img_out)
plt.axis('off')
plt.show()
最新文章
- Spring框架学习(一)
- Ubuntu12.04配置静态ip地址
- jquery 父页面 子页面 同级页面 调用
- python(5)-正则表达式
- iOS svn版本回退 cornerstone
- .Net版InfluxDB客户端使用时的一些坑
- bsp总结
- SQL server 存储过程中 列传行
- 文件上传之Servlet
- 怎么检测自己fastq的Phred类型 | phred33 phred64
- UFT12 更新模式
- mybatis框架下使用generator插件自动生成domain/mapping/mapper
- Python函数初识
- 【Unity笔记】UGUI物体的Rect Transform组件(Pivot中心点,Anchor锚点)
- AJAX.basic
- hadoop2.6.0的eclipse插件编译和设置
- ubuntu ibus&language 启动失败
- 03 java 基础:注释 关键字 标识符 JShell
- 【mysql优化】大数据量分页优化
- 51nod 1851 俄罗斯方块
热门文章
- cogs 304. [NOI2001] 方程的解数(meet in the middle)
- Qt之qInstallMessageHandler(输出详细日志)
- 使用默认system_health分析死锁(Deadlock)
- UI自动化
- 深搜解Riding the Fences
- Android之使用weight属性实现控件的按比例分配空间
- hdoj--1950--Bridging signals(二分查找+LIS)
- ShellExcuteA
- MYSQL5.6/5.7 数据库密码丢失问题处理(需重启)
- WPF学习(四) - 附加属性