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