如何使用 python 在图像上获得“智能锐化”效果?

Som*_*lse 5 python image-processing scipy scikit-image

我想知道如何使用或任何相关的图像库(例如,甚至是)智能锐化图像。我可以找到实际锐化图像的方法,但在放大时会产生大量噪音和像素化。所以,自从我知道我试图得到它智能锐化效果,通过 python 锐化图像,噪音更少,对比度更佳,但我失败了。 pythonndimageskimagePILPhotoshop

注:-
(1) 方法已经过测试:-

>>> # The 1st Method:  
>>> import Image                 
>>> import ImageFilter
>>> image.filter(ImageFilter.SHARPEN)               
>>> Image.filter(ImageFilter.EDGE_ENHANCE_MORE)    #Look down:1st image created  

>>> # The 2nd Method:
>>> blurred_l=scipy.ndimage.gaussian_filter(b,3)  
>>> filter_blurred_l = scipy.ndimage.gaussian_filter(blurred_l, 1)  
>>> alpha =30  
>>> sharpened = blurred_l + alpha * (blurred_l - filter_blurred_l)  

>>> # The 3rd Method:  
>>> shar=imfilter(Image,'sharpen')               #Look down:2nd image created
Run Code Online (Sandbox Code Playgroud)

(2) 我找到了一段代码,但它在Perl. 我只知道Python 在这里直接 (3)这里有 2 个使用上述方法锐化的图像,第三个是用smartsharp完成的:
原始
原始图像http://imageshack.us/a/img600/6640/babyil.jpg
首先... ...................................................... ........................第二
个http://imageshack.us/a/img803/3897/sharp1.png 第二个http://imageshack.us/a/img809/2235/sharp2 .png
第三个 我的目标>这就是我想要的效果
第三个 http://imageshack.us/a/img832/4563/smartsharp.jpg
(4) 以下是我用来创建上面第三张图片的工具:
smrsharpm http:// imageshack.us/a/img210/2747/smartsharpentoolm.jpg smrsharp http://imageshack.us/a/img193/490/smartsharpentool.jpg

Ste*_*alt 4

不幸的是,如果无法访问 Photoshop 代码,就很难知道“智能锐化”的作用。与此同时,您可以尝试混合使用不锐化蒙版、总变化过滤和一些颜色调整(也许是一点色调增强)。

另请参阅:http ://www.kenrockwell.com/tech/photoshop/sharpening.htm#

更新:以下是如何从图像中消除运动模糊的示例:

https://github.com/stefanv/scikit-image-demos/blob/master/clock_deblur.py

(时钟图像位于同一存储库中)。不幸的是,scikit-image 目前没有成熟的去模糊/逆过滤——但我们正在努力!