STATISTICS
The pixel values are often analyzed for their statistics:
mean, standard deviation, histogram, cumulative, percentiles, and moments
are used in several image processing methods.
The mean value and (squared) standard deviation are
m | = | (1/N) ∑x I(x) |
s2 | = |
(1/N) ∑x ( I(x) - m )2 |
| = |
(1/N) ∑x I(x)2 - m2 |
The histogram is a counting of the distribution of the pixel values:
h(i) = Number of pixels such that I(x)=i
The histogram (divided by the total number N of pixels) can be
viewed as a probability density, namely the probability that picking
a pixel at random it has a certain value.
The cumulative is the analogue of the probability distribution function:
c(i) | = | ∑j<=i h(i) |
| = |
Number of pixels with value less or equal to i |
Histogram and cumulatives can be used to compute mean and standard deviation.
The mean is the first moment of the normalized histogram.
The (squared) standard deviation is the central second moment.
Here we give the formula for the second moment E[i2].
m | = | E[i] |
| = |
(1/N) ∑i i h(i) |
| = |
(1/N) ( 255 c(255) - ∑i<255 c(i) ) |
E[i2] | = |
(1/N) ∑i i2 h(i) |
| = |
(1/N) ( 2552 c(255)
- 2 ∑i<255 i c(i)
- ∑i<255 c(i) ) |
Higher order moments of the pixel values are also used.
In particular the third order and fourth order moments.
An alternate point of view consists of considering the image values as
a probability density in 2-D.
This is particularly useful for images of single objects, such as
medical images, or images of manufactured pieces.
In this case one computes the center of mass (centroid) of the image
and the second order moments relative to it, which describe the spread
of the image foreground.
xc | = | (1/N) ∑x,y x I(x,y) |
yc | = | (1/N) ∑x,y y I(x,y) |
E[xayb] | = |
(1/N) ∑x,y xa yb I(x,y) |
sxx | = |
E[x2] - xc2 |
sxy | = |
E[xy] - xc yc |
syy | = |
E[y2] - yc2 |
The 2x2 matrix
is symmetric posititive semidefinite, and its diagonalization yields
the directions of the axes of inertia of the image (eigenvectors)
and its size (eigenvalues).
Marco Corvi - Page hosted by
geocities.com.