How do one find the mean, std dev, and gradient from image integral? Given an image such as follows:
If C+A-B-C is the sum of all gray levels in the zone, then the mean is not
mean = C+A-B-D/4
but
mean = C+A-B-D/K
where K is the number of graylevels in the zone.
Also,
dev = sqrt( C'+A'-B'-D'/4 - (mean*mean) )
is not the stdev, because
dev = sqrt( (1/N)*sum_N ( x_i - u )^2 )
the equation here is equivalent to
dev = sqrt( (1/N)*sum_N ( (x_i)^2 ) - u^2 )
those equations are not equivalent.