When it comes to measuring certain image parameters, an unpleasant subtlety immediately arises. Man and computer perceive images differently. A person isolates objects from noise, may consider something in low light, and the computer understands the image as a set of coordinates with corresponding brightness. And when a person and a computer are asked about any distinctive features of the image, they will immediately diverge from the readings. We must somehow make it so that the conclusions they draw are similar.
Consider the methods used to analyze the contrast in black and white images, and try to choose something more or less objective.
Method One
The method is canonical, from 1977 [1].

The contrast is determined by the ratio of the difference between the brightness of the object of observation 1 and background 2 to one of these brightness. The range of output values is from 0 to 1.
In fact - does not show anything. Go ahead.
Second method
It was proposed by domestic scientists in 1979, for parsing plot images.
The point is this: since the image has a complex plot character, it makes it necessary, when determining its contrast, to proceed from the contrast of individual combinations of picture elements. In this case, all elements are considered equivalent, and the contrast of each pair of them is calculated by the formula:

where elements of the numerator and denominator are the brightness of the elements of the plot image. The plot of the image suggests the possibility of its use by man. Therefore, when assessing contrast, as one of the image quality parameters, it is necessary to take into account a number of features of a person’s visual perception. Next, applying the rule of summation of contrasts, calculate a set of values that determine the perception of each pair of picture elements. By averaging the matrix of local contrasts, we obtain a total contrast [2].
The method is too complicated, will not work.
Method three
Set out in GOST 18862-73 from 1983:

The brightness of the image areas is measured by a photometer in candela per square meter, an error of 10%, which is too much. And if there is a photometer (I've never seen it live). In the absence of such, he personally had experience measuring with an oscilloscope:
a wire is taken where the signal is output (say, a composite), a test signal is sent (stripes or a chessboard), an oscillogram is output, and, comparing with the standard for a video signal, the difference is measured, then normalized relative to the maximum. Accuracy - I think, somewhere 20-25%, which is beyond the rationality of use. The range of output values is from 0 to 1. Non-objective.
Obviously not suitable, go ahead.
')
Method Four
Similarly, the federal standard US 1037C from 1996:
says only that "the contrast is the ratio of the brightness of some element of the image (pixel) to the brightness of the rest of the image." It is also worth noting that this standard defines brightness as an immeasurable value.
It does not suit us at all. Just note that this is.
Method Five
Justified by Vorobel in 1999, mentioned on such a substantial resource as MATLAB.Exponenta.

It is already interesting, because it is normalized in the range of brightness from 0 to 1, and it is very objective.
With the calculation of contrast, there is one subtlety. There are two objects side by side, one has a brightness of 10, another has 20, according to the first and third methods we get 0.5, in the second - 0.3. Brightness 100 and 200, according to the first and third methods we get the same 0.5, according to the second - again 0.3, however, with brightness 10 and 20, the difference can not be seen.
Contrast, in my opinion, is more objective to consider according to the Vorobel method, if the quality is poor and there is a lot of noise, to take into account the areas of objects, and to average the values of the brightness of objects from them.
Now let's look at this in action:



Three images are consecutive - normal, with an equalized histogram, and an ideal one. The selected areas were analyzed in the .bmp format, the brightness range 0–255.
- the contrast of a conventional image K = 0.67.
- the contrast of the equalized image K = 0.88.
- the contrast of the ideal image K = 1.
Here is a story, thank you for your attention!
Bibliography1. Yashtold-Govorko V. A. Photographing and processing. Shooting, formulas, terms, recipes. Ed. 4th, abbr. M., "Art", 1977.
2. Gurov A.A., Porfireva N.N. Questions assess the contrast of plot images // Proceedings of GOI im. S.I. Vavilova. - v. 44, no. 178. - L. - 1979. - C. 31 - 34.
3. Vorobel R.A. Digital image processing based on the theory of contrast: Dis. Dr. tech. Sciences: 05.13.06. - Lviv, 1999. - 369 p.