Images and Statistics
Published May 19, 2022 - By Marco Garosi
Pixels of an image can be seen as a population on which to calculate statistics: mean, median, variance, standard deviation, quartiles and percentiles. You may think of an image as a collection of values arranged on a grid, each one with its own coordinates .
For simplicity, we’ll assume that images are functions with one, single output: the level of gray. Many images are RGB, so you may extend the following concepts and ideas to functions with three outputs. That should be pretty natural in most cases.
We’ll consider an image , with rows and columns.
An histogram is a distribution of the frequencies of grey levels. It is computed as follows:
An histogram can also be seen as a probability distribution:
The histogram does not take into account the spacial distribution of the pixels: this means that totally different images may have the exact, same histogram. And, of course, it also means that you cannot reconstruct an image only with its histogram.
Contrast is the ration or difference between the brightest point and the darkest. An image is said to be:
- overexposed if the histogram is skewed to the right. Note that being bright is a characteristic of the image, while it being overexposed is a characteristic of the acquisition process;
- underexposed, if the histogram is skewed to the left. Note that being dark is a characteristic of the image, while it being underexposed is a characteristic of the acquisition process.