我想知道如何智能使用python
或任何相关图像库像ndimage
,skimage
甚至PIL
。我能找到的,其实我的锐化图像的方法,但有很大的噪音和像素化的锐化的图像缩放。所以当因为我知道Photoshop
我试图获得那种聪明的锐化效果,它通过较少噪音和与python的甜美对比来锐化图像,但是我失败了。如何使用python获得我的图像上的“智能锐化”效果?
注: -
(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
(2),我发现一段代码但它在Perl
。我只使用上述方法中的第三与smartsharp完成知道Python
In here或 directly (3)以下是锐化图像的2:
原始
Original image http://imageshack.us/a/img600/6640/babyil.jpg
首先............ .................................................. ......第二
1st http://imageshack.us/a/img803/3897/sharp1.png2nd 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.jpgsmrsharp http://imageshack.us/a/img193/490/smartsharpentool.jpg
但是好消息是,任何人都知道'Perl'可以将我附在我的文章中的代码修改为我可爱的'Python'。顺便谢谢scikit-image项目。 –
只有一种享受!我无法访问上面的Perl代码 - 你会介意检查链接吗? –
我试图从'scikit-image'使用'Wiener-filter',但它引发了一个错误**冲动响应必须是一个可调用的**(i。e我不知道如何使用Impulse响应参数来执行wiener -filter)。我坚持这个地方。你以前的文章是美好的,但代码是在'MatLab',我试图找出什么** fspecial()**功能,但我失败了。看来你可以帮助。你可以更新你的答案说明如何使用'skimage.filter.wiener()'做智能锐化。感谢你的耐心。 –