本文用 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()

最新文章

  1. Spring框架学习(一)
  2. Ubuntu12.04配置静态ip地址
  3. jquery 父页面 子页面 同级页面 调用
  4. python(5)-正则表达式
  5. iOS svn版本回退 cornerstone
  6. .Net版InfluxDB客户端使用时的一些坑
  7. bsp总结
  8. SQL server 存储过程中 列传行
  9. 文件上传之Servlet
  10. 怎么检测自己fastq的Phred类型 | phred33 phred64
  11. UFT12 更新模式
  12. mybatis框架下使用generator插件自动生成domain/mapping/mapper
  13. Python函数初识
  14. 【Unity笔记】UGUI物体的Rect Transform组件(Pivot中心点,Anchor锚点)
  15. AJAX.basic
  16. hadoop2.6.0的eclipse插件编译和设置
  17. ubuntu ibus&language 启动失败
  18. 03 java 基础:注释 关键字 标识符 JShell
  19. 【mysql优化】大数据量分页优化
  20. 51nod 1851 俄罗斯方块

热门文章

  1. cogs 304. [NOI2001] 方程的解数(meet in the middle)
  2. Qt之qInstallMessageHandler(输出详细日志)
  3. 使用默认system_health分析死锁(Deadlock)
  4. UI自动化
  5. 深搜解Riding the Fences
  6. Android之使用weight属性实现控件的按比例分配空间
  7. hdoj--1950--Bridging signals(二分查找+LIS)
  8. ShellExcuteA
  9. MYSQL5.6/5.7 数据库密码丢失问题处理(需重启)
  10. WPF学习(四) - 附加属性