Python實(shí)現(xiàn)PS濾鏡中的USM銳化效果
本文用 Python 實(shí)現(xiàn) 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()
實(shí)現(xiàn)效果:
以上就是Python實(shí)現(xiàn)PS濾鏡中的USM銳化效果的詳細(xì)內(nèi)容,更多關(guān)于python usm銳化的資料請關(guān)注好吧啦網(wǎng)其它相關(guān)文章!
相關(guān)文章:
1. Python自動化之定位方法大殺器xpath2. python調(diào)用百度API實(shí)現(xiàn)人臉識別3. 如何基于Python和Flask編寫Prometheus監(jiān)控4. Python Selenium破解滑塊驗(yàn)證碼最新版(GEETEST95%以上通過率)5. python 寫一個文件分發(fā)小程序6. 用python對oracle進(jìn)行簡單性能測試7. Python 利用flask搭建一個共享服務(wù)器的步驟8. Python QT組件庫qtwidgets的使用9. Vue3中使用this的詳細(xì)教程10. Python中Anaconda3 安裝gdal庫的方法
