One possible way is to apply plain and simple normalization assuming normal distribution to all elements.
First find the average (Mu) and standard deviation (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)
From this, we can normalize the value of each pixel using standard normal distribution formula (by standardizing all values):
a'[i][j] = (a[i][j] - Mu) / S
Another method is vector normalization, which basically says:
- Find the length of the vector:
|a| = sqrt(sum (a[i][j]*a[i][j])) for each i,j
- Assign:
a'[i][j] = a[i][j] / |a|