一种可能的方法是在假设所有元素均呈正态分布的情况下应用普通且简单的标准化。
首先找到平均值(Mu)和标准偏差(S):
Mu = 1/N * Sum(a[i][j]) for each i,j S = sqrt(1/(N-1) * Sum((a[i][j] - Mu)^2)) for each i,j (in here N is the number of pixels, 20*20 in the viola jones case)
由此,我们可以使用标准正态分布公式(通过标准化所有值)来标准化每个像素的值:
a'[i][j] = (a[i][j] - Mu) / S
另一种方法是向量归一化,基本上说:
- 找到向量的 长度 :
|a| = sqrt(sum (a[i][j]*a[i][j])) for each i,j
- 分配:
a'[i][j] = a[i][j] / |a|



