Python實現PS濾鏡中的USM銳化效果
本文用 Python 實現 PS 濾鏡中的 USM 銳化效果
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)# alpha 0 - 5alpha = 1.5img_out = (img - gauss_out) * alpha + imgimg_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()
實現效果:
以上就是Python實現PS濾鏡中的USM銳化效果的詳細內容,更多關于python usm銳化的資料請關注好吧啦網其它相關文章!
相關文章:
1. 低版本IE正常運行HTML5+CSS3網站的3種解決方案2. jsp實現局部刷新頁面、異步加載頁面的方法3. xml文件的結構解讀第1/2頁4. Jsp中request的3個基礎實踐5. python GUI庫圖形界面開發之PyQt5工具欄控件QToolBar的詳細使用方法與實例6. 使用python修改文件并立即寫回到原始位置操作(inplace讀寫)7. python GUI庫圖形界面開發之PyQt5計數器控件QSpinBox詳細使用方法與實例8. Python填充任意顏色,不同算法時間差異分析說明9. Java map.getOrDefault()方法的用法詳解10. 什么是python的id函數
