Python实现PS滤镜中的USM锐化效果
作者:未雨愁眸 时间:2023-07-10 12:58:24
本文用 Python 实现 PS 滤镜中的 USM 锐化效果
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)
# alpha 0 - 5
alpha = 1.5
img_out = (img - gauss_out) * alpha + img
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()
实现效果:
来源:https://www.cnblogs.com/mtcnn/p/9412157.html
标签:python,ps滤镜,usm锐化
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
python opencv实现图像边缘检测
2022-08-05 08:40:34
![](https://img.aspxhome.com/file/2023/4/86404_0s.jpg)
详解Linux下安装php环境并且配置Nginx支持php-fpm模块
2023-11-11 02:02:50
![](https://img.aspxhome.com/file/2023/5/64195_0s.png)
用javascript连接access数据库的方法
2024-01-15 11:11:51
VSCODE添加open with code实现右键打开文件夹
2022-02-06 05:09:43
![](https://img.aspxhome.com/file/2023/9/132429_0s.png)
Linux下C连接MySQL出现错误解决一例
2008-12-29 13:17:00
Pyqt助手安装PyQt5帮助文档过程图解
2021-01-31 00:34:06
![](https://img.aspxhome.com/file/2023/5/101015_0s.png)
瞎扯之Web导航
2009-03-18 19:32:00
![](https://img.aspxhome.com/file/UploadPic/20093/18/01-85s.jpg)
理解Vue2.x和Vue3.x自定义指令用法及钩子函数原理
2024-05-28 15:46:41
![](https://img.aspxhome.com/file/2023/1/123191_0s.jpg)
关于Python3爬虫利器Appium的安装步骤
2022-06-04 15:30:59
![](https://img.aspxhome.com/file/2023/8/92218_0s.png)
Pycharm生成可执行文件.exe的实现方法
2023-07-19 12:09:54
![](https://img.aspxhome.com/file/2023/3/64273_0s.jpg)
下载Internet Explorer 9 平台预览版4
2010-08-05 20:59:00
js实现限定范围拖拽的示例
2024-04-29 13:38:55
Python通过调用mysql存储过程实现更新数据功能示例
2024-01-25 11:28:51
Python实现可获取网易页面所有文本信息的网易网络爬虫功能示例
2023-08-21 18:51:04
vue绑定class与行间样式style详解
2024-05-08 10:12:12
Python Opencv实战之文字检测OCR
2023-03-18 14:05:41
![](https://img.aspxhome.com/file/2023/7/134667_0s.png)
MySQL学习之数据库操作DML详解小白篇
2024-01-14 11:59:48
pytorch tensor int型除法出现的问题
2021-05-18 13:18:17
![](https://img.aspxhome.com/file/2023/5/121155_0s.jpg)
Oracle基本PLSQL的使用实例详解
2024-01-21 11:17:41
对Python3之方法的覆盖与super函数详解
2023-08-25 19:05:28
![](https://img.aspxhome.com/file/2023/8/107268_0s.jpg)