赞
踩
python 计算图像均值-方差等操作
推荐PIL种的ImageStat模块
from PIL importImage, ImageStat
img =Image.open("***.jpg")
stat =ImageStat.Stat(img)
# 统计最大 最小值(RGB3个通道的)
stat.extrema
# 统计均值, 每个通道的像素值总和
stat.mean stat.sum
# 统计图像中每个通道的像素值的均方根值 方差 标准差值
stat.rms stat.var stat.stddev
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。