📜  Python – Wand 中的自适应模糊

📅  最后修改于: 2022-05-13 01:55:17.660000             🧑  作者: Mango

Python – Wand 中的自适应模糊

自适应模糊是一种模糊。唯一的区别是图像中可检测边缘周围的模糊强度较小,而在没有边缘的区域则较大。自适应模糊可以使用adaptive_blur函数来完成。

示例 #1:

Python3

wand.image.adaptive_blur(radius="radius_value",
                           sigma="sigma_value",
            channel = "optional_channel_value")
 
# radius should always be greater than sigma(standard deviation)

输出:


示例 #2:

Python3

# import Image from wand.image module
from wand.image import Image
 
# read file using Image function
with Image(filename ="gfg.png") as img:
    # perform adaptive blur effect using adaptive_blur() function
    img.adaptive_blur(radius = 8, sigma = 4)
    # save final image
    img.save(filename ="adblur_gfg.png")

输出: