📜  Python中的魔杖统计()函数

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

Python中的魔杖统计()函数

统计效果类似于传播效果,唯一的区别是,它将每个像素替换为对相邻像素值执行的数学运算的结果。宽度和高度定义了相邻像素的大小或孔径。

统计操作的类型可以是以下任何一种:

  • '坡度'
  • '最大'
  • '意思是'
  • '中位数'
  • '最低限度'
  • '模式'
  • “非高峰”
  • 'root_mean_square'
  • '标准偏差'

输入图像:

示例 1:
# Import Image from wand.image module
from wand.image import Image
  
# Read image using Image function
with Image(filename ="koala.jpeg") as img:
    img.statistic("median", width = 8, height = 5)
    img.save(filename ="kl-statistic.jpeg")

输出:

输入图像:

示例 2:

# Import Image from wand.image module
from wand.image import Image
  
# Read image using Image function
with Image(filename ="road.jpeg") as img:
    img.statistic("median", width = 8, height = 5)
    img.save(filename ="rd-statistic.jpg")

输出: