Algorithm For Nonlinear Transformations Of Local Contrasts

: Enhancing contrast is one of the important tasks of image processing, pattern recognition and machine vision. The solution to this problem directly related to an increase in the likelihood of correct image perception. The paper presents fuzzy methods for improving images, which based on nonlinear transformations of local contrasts, taking into account the peculiarities of human vision.


Introduction
The analytical expression describing the quantitative determination of the reaction of the visual system to light excitation is its contrast.The type of this expression is determined by the properties of a particular visual perception system [1,2].That is, a change in the expression for determining the contrast corresponds to a change in the type of the visual system or its parameters.This creates opportunities for the adaptation of the visual system by changing the expression to determine local contrast.It goes without saying that in this case the analytical expression must ensure the preservation of the basic limiting properties.These properties are that the local contrast ( , ) C x y acquires a maximum value only when its components have values that lie on opposite ends of the range, and equal to zero -if these components are equal in magnitude.The criterion for evaluating contrast expressions is the effectiveness of their application in digital image processing.Consequently, a successful choice of one or another definition of contrast significantly affects the further application of the method [1,2].
Image quality in local areas can be improved using such parameters of pixel intensities as the average value of the intensity and the change in intensity (or the standard deviation of the intensities of the elements of the local area of the image).Average is a measure of the average brightness.When calculating and analyzing the average brightness of image elements, it is possible to correct it, i.e. make dark areas of the image lighter, and darken too light areas of the image.However, if the image contains dark and light areas, then this approach will only worsen its visual perception.Therefore, it is advisable to use one more parameter that would characterize the distribution of the brightness of the image elements in some local neighborhood.In other words, this parameter would characterize changes in intensities or a measure of image contrast [3].
Enhancing contrast is one of the important tasks of image processing, pattern recognition and machine vision.The solution to this problem is directly related to an increase in the likelihood of correct image perception.Recently, fuzzy methods for improving images have been developed, which are based on nonlinear transformations of local contrasts, taking into account the peculiarities of human vision [3,4].Image F, describedin a fuzzy environment, look slike: respectively, the degree of belonging ( , ) xy-th pixel to set in accordance with the properties of the image.

Algorithm for nonlinear transformations of local contrasts
The implementation of these methods consists of the following basic steps [4]: Step 1. Determination of the quantitative measure of local contrast.To describe the contrast of an 8-bit grayscale digital image, two formulas are proposed: Calculating local contrast: and calculating the global contrast: C -maximum and minimum brightness values in the vicinity of pixels.
Consider several neighborhoods with varying degrees of smoothness [5]: a) a local neighborhood with the same brightness levels (homogeneous neighborhood); b) a local neighborhood, the elements of which have brightness values located at opposite ends of the range (conventionally a binary neighborhood); c) a local neighborhood that contains elements whose brightness values are not the same and are not at the edges of the range.
The above types of neighborhoods will be characterized by different values of local characteristics [5,6].Let's consider this in more detail using the example of entropy, the function of the histogram length and standard deviation.
Step 2. Determine the function of the length of the histogram, which is calculated by the expression max min max ( , ) , where min max , ff -minimum and maximum brightness values in a sliding neighborhood W centered at the element with coordinates (x,y); max h -the maximum value of the sliding local neighborhood histogramW centered at the element with coordinates ( , ) xy.
This characteristic of the local neighborhood acquires minimum values in homogeneous areas, and maximum values -in binary areas.
Step 3. Determination of the degree of transformation of local contrasts by functions of the length of the histogram: , where 0 s  .
Step 4: Determination of fuzzy entropy in a sliding local neighborhood with dimensions nm  by expression: where Here: ( ) According to expression (1), the fuzzy entropy acquires a maximum value in homogeneous areas, and a minimum value in areas with elements whose brightness values are at opposite ends of the range.
Step 5. Determination of the degree of transformation of local contrasts  by fuzzy entropy [8]: Step 6: Determination of the mean square deviation of the brightness values of the elements of the sliding neighborhood W, which is calculated by the expression ( ) where [] j Mf -fuzzy arithmetic mean of the brightness of local neighborhood elements Wcentered on element [ (x, y)] j Mf with coordinates (x,y): 2) is equal to zero for homogeneous neighborhoods and increases with increasing inhomogeneity.
Step 7. Determination of the degree of transformation of local contrasts  by the fuzzy standard deviation of the brightness values: ) are set by the researcher.This is due to the fact that there is still no theoretical solution to the problem of optimality of local contrast transformation.Therefore, based on the experience and knowledge of the researcher, the transformation function is formed in such a way that it provides the maximum image contrast with a minimum of distortions caused by excessive enhancement of local contrasts.

Computational experiment
We present the results of the program's work by the method of nonlinear stretching of local contrasts with images, we see the resulting effect and possible practical application (Fig. 1 -2).

Fi h f x
y -local neighborhood histogram value W(number of elements with brightness ( , ) i f x y in the surrounding area W) for the brightness value of the element with coordinates (x,y).
Increase according to a certain law of a certain quantitative measure of local contrast.For nonlinear transformation of local contrast, we use the following expression: C x y -the value of the local contrast of an element of the original image with coordinates (x,y), * ( , ) C x y -enhanced value of local contrast of an image element with coordinates (x,y); -maximum possible value of local contrast R=1; max min , C C -maximum and minimum values of the local contrast of the original image; Ĉ -evaluation of the mathematical expectation of local contrast values (for example, the arithmetic mean of local contrasts of image elements)Restoration of the element of the transformed image with enhanced local contrast.Now, when the nature of the change in the values of local statistics in sliding neighborhoods of various types is known, we will consider the procedure for generating the function of transforming local contrasts.An important problem facing the researcher in the formation of this function is how much it is necessary to increase the local contrasts in a particular area of the image.The nature of the gain change is determined by local statistics, but the boundaries of the change ( max min , 

.
Fig. 4. A locally adaptive method for improving the visual quality of images using the standard deviations of the brightness values of the local neighborhood elements:а -original image; b -picture а, processed by a known method; c -image a, processed by the proposed method using the theory of fuzzy sets