如何才能获得“智能锐化”功能用python对我的图像产生影响? [英] How can I get the "smart sharpen" effect on my images with python?

查看:300
本文介绍了如何才能获得“智能锐化”功能用python对我的图像产生影响?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何智能锐化使用 python 或任何相关的图像库,如 ndimage skimage 甚至 PIL 。我可以找到实际锐化我的图像的方法,但是有大量的放大时的噪音和像素化。因为我知道 Photoshop 我试图获得那种智能锐化效果,通过python减少噪音和甜美的对比度来锐化图像但是我失败了。

I am wondering how to smart sharpen an image using python or any related image library like ndimage ,skimage or even PIL.I could find methods that actually sharpen my image but with a lot of noise and pixelating when zooming in .So since I know Photoshop I tried to get that smart sharpen effect which sharpens the image with a less noising and with a nice sweet contrast through python but I failed.

注意: -

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

Notes:-
(1) methods has been tested:-

>>> # 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

(2)I找到了一段代码,但它在 Perl 中。我只知道 Python 在这里直接
( 3)以下是使用上述方法的2个锐化图像,第3个使用 smartsharp 完成:

原始

原始图片http://imageshack.us/a/img600/6640/babyil.jpg

首先................................................. ................... second

1st http://imageshack.us/a/img803/3897/sharp1.png 2nd http://imageshack.us/a/img809/2235/sharp2.png

第三个我的目标>这就是我想要的效果

3rd 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

(2) I found a piece of code but it's in Perl . I only know Python In here or directly (3) Here are 2 of the sharpened image using above methods the third done with smartsharp:
Original
Original image http://imageshack.us/a/img600/6640/babyil.jpg
First ....................................................................second
1st http://imageshack.us/a/img803/3897/sharp1.png 2nd http://imageshack.us/a/img809/2235/sharp2.png
third MY GOAL>that's the effect I want
3rd http://imageshack.us/a/img832/4563/smartsharp.jpg
(4) Here are the tool I used to create the third image above:
smrsharpm http://imageshack.us/a/img210/2747/smartsharpentoolm.jpg smrsharp http://imageshack.us/a/img193/490/smartsharpentool.jpg

推荐答案

不幸的是,如果没有访问Photoshop代码,很难知道智能锐化是什么。在此期间,你可以尝试混合一个unsharpen面具,全变异过滤和一些颜色调整(可能有点色调提升)。

Unfortunately, it's hard to know what "Smart sharpen" does without having access to the Photoshop code. In the meantime, you can try to mix an unsharpen mask, total variation filtering and some color adjustment (perhaps a bit of hue boost).

另见: http://www.kenrockwell.com/tech/photoshop/sharpening.htm#

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

Update: here is an example of how to remove motion blur from an image:

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

(时钟图像位于同一个存储库中)。不幸的是,scikit-image目前还没有成熟的去模糊/反向过滤 - 但我们正在研究它!

(the clock image is in the same repository). Unfortunately, scikit-image does not currently have mature deblurring / inverse filtering--but we're working on it!

这篇关于如何才能获得“智能锐化”功能用python对我的图像产生影响?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆