1 Introduction

There are two kinds of cells in the human vision structure, rod cell and cone cell, which, respectively, treat brightness imaging and color imaging. In the evening, the rod cell acts more, while the cone cell is relatively weak, meaning humans have relatively poor color sensitivity in the evening, and the information is relatively weak; thus, image enhancement can play a very important role [1].

In recent years, the digital image has gradually replaced the traditional image. The storage of digital images makes it easier to treat and apply the image. Therefore, digital image processing has become a very important application technology in life, like monitoring systems, medical image analysis [2], and plate identification [3]. However, due to the influence of external factors in the process of image acquisition, especially the influence of light, the quality of the recorded image will be influenced, and the direction and position of the light source environment is another key, which is the main reason for overexposure and underexposure, which image contains relatively low-pixel information volume. Image enhancement technology is very effective for parts with relatively weak image information, and many image enhancement technologies were proposed in the past, for example, typical contrast enhancement and histogram equalization [4, 5], which can both change image contrast for image enhancement. The human vision structure is relatively sensitive to the image brightness value; thus, technologically, the brightness value of the image must be enhanced, meaning the brightness value of an overexposed image is reduced, while that of an underexposed image is increased. Appropriate adjustment of the brightness value will be helpful to increase the visual quality of an image, while improving the weak information in the image.

The traditional histogram equalization algorithm cannot smoothly enhance an image, and the application of total regional enhancement technology will easily cause image distortion, which will directly influence the original brightness and color quality; thus, it is relatively difficult for a histogram equalization algorithm to apply processing for diversified and uncertain images. Therefore, this paper proposes processing such diversified and uncertain images based on the fuzzy theory, in combination with adaptive adjustment parameters, and the enhancement result of a processed image by the fuzzy theory relatively conforms to human visual perception. In this manner, as the image can be appropriately enhanced without generating serious distortion, the quality of the original image can be preserved and the detailed information of the image can be increased.

Image processing has to deal with many ambiguous situations. Fuzzy set theory is a useful mathematical tool for handling the ambiguity or uncertainty. Therefore, the fuzzy set theory [6] has been successfully applied to many image processing, which has come in a big way into the image processing area. Because fuzzy systems are capable of representing diverse, non-exact, uncertain, and inaccurate knowledge or information, the image processing and recognition based on the fuzzy theory [7]. The image processing based on the fuzzy theory has attracted attention since S. K. Pal et al. [6] proposed the fuzzy enhancement. For the purpose of improving the effect or reducing computational complexity, the different membership function, iterative computations and the parameter’s selecting had been proposed. Traditional fuzzy enhancement focus on improving the contrast, that is high brightness higher and low brightness lower, in the limiting case, produces an extreme image [8]. The gray-level maximum does not change in the classical fuzzy enhancement method [9], [10]; hence, it is of no use for degraded images with less dynamic range and low contrast. The night color image enhancement [8] hopes to decrease high brightness and increase low brightness a little that is limited to only an underexposed low-brightness (night) image, but is unable to process an overexposed high-brightness image. Based on the fuzzy problem, this study proposed adaptive parameter image contrast enhancement technology, in order to solve the problems of overexposed and underexposed images.

The remainder of this paper is organized as follows: Sect. 2 introduces the principle of fuzzy image enhancement, Sect. 3 discusses the adaptive image enhancement technology based on fuzzy theory, Sect. 4 offers the experimental results and discussion, and Sect. 5 offers conclusions.

2 Principle of Fuzzy Theory Image Enhancement

In the image enhancement method based on the fuzzy theory, first the image F of the M × N pixel matrix is mapped to the L-order gray-level matrix, where fxy is the gray-level value in the pixel point (x, y), and the mathematical formula of the image enhancement method, as based on fuzzy theory, can be expressed as:

$$F = \mathop {\bigcup }\limits_{x = 1}^{M} \mathop {\bigcup }\limits_{y = 1}^{N} \left( {\mu_{xy} /f_{xy} } \right) , \quad 0 \le \mu_{xy} \le 1$$
(1)

In the typical fuzzy image enhancement algorithm, Pal and King used membership function \(\mu_{xy}\) to express [6, 7]:

$$\mu_{xy} = T\left( {f_{xy} } \right) = \left[ {1 + \left( {\left( {L - 1} \right) - f_{xy} } \right)/F_{d} } \right]^{{ - F_{e} }}$$
(2)

where \(F_{e}\) is the index parameter, the given value of which is generally 2, and \(F_{d}\) is the threshold parameter.

The image enhancement of fuzzy theory is to use image contrast strengthening for enhancement. When the threshold value of \(\mu_{xy}\) is 0.5, image brightness (I) is divided into upper and lower blocks, and its membership value is changed with the mapping relation between the upper block and lower block and by using the nonlinear transfer function. The transfer function \(\mu_{xy}^{\prime }\) of the R-order gray-level value of the brightness (I) is expressed as:

$$\mu_{xy}^{'} = I_{R} \left( {\mu_{xy} } \right) = I\left( {I_{R - 1} \left( {\mu_{xy} } \right)} \right) R = 1,2, \ldots$$
(3)
$$I\left( {\mu_{xy} } \right) = \left\{ {\begin{array}{*{20}l} {2\left( {\mu_{xy} } \right)^{2} } \hfill & {0 \le \mu_{xy} \le 0.5} \hfill \\ {1 - 2\left( {1 - \mu_{xy} } \right)^{2} } \hfill & { 0.5 < \mu_{xy} \le 1} \hfill \\ \end{array} } \right.$$
(4)

Finally, \(\mu^{\prime }\) is defuzzified to obtain the enhanced image \(F^{\prime }\) of the fuzzy theory image, where the enhanced gray-level value \(f_{xy}^{\prime }\) of the pixel point (x, y) is expressed as:

$$f_{xy}^{'} = I^{ - 1} \left( {\mu_{xy}^{'} } \right)$$
(5)

where \(I^{ - 1}\) is the inverse operation of I.

Based on this basic structure, it is possible to use the membership function of fuzzy theory for reconversion in order to achieve the purpose of image enhancement. By referencing the night color image enhancement using fuzzy set method, as developed by Pal and King [11], the research experiment result shows that this method is limited to only an underexposed low-brightness (night) image, but is unable to process an overexposed high-brightness image. Therefore, the problem of this algorithm will be improved in this paper in order that it can be applied to overexposed and underexposed images and adaptively process image enhancement.

3 Fuzzy Theory-Based Adaptive Image Enhancement Technology

Figure 1 shows the flowchart of the fuzzy theory-based adaptive image enhancement technology, as based on the complete preservation of the color information (hue and saturation) of the original image; first, the original image is converted from the RGB color space to the color information of HSI (hue, saturation, intensity); then, fuzzy theory-based adaptive parameter adjustment image enhancement processing is conducted, which is only aimed at the brightness value of the original image. In image processing, if the image hue and saturation are changed, the color information of the original image will be distorted. The enhancement processing method proposed in this paper only aims at the image brightness value, which can achieve the effect of image brightness enhancement without influencing the color. Finally, the brightness value after fuzzy enhancement is used for recovery in combination with the hue and saturation information of the original image, and the color space is converted from the HSI color space back to the RGB color space, in order to generate the processed enhancement image output.

Fig. 1
figure 1

Flowchart of fuzzy theory-based adaptive image enhancement technology

Figure 2 shows the system diagram of proposed fuzzy theory. The proposed fuzzy theory can be divided into three main steps: fuzzification, modified membership value and defuzzification. The technique used here is based on the modification of pixels in the fuzzy property plane of an image. The property domain is extracted from the spatial domain using fuzzifiers which play the role of creating different amounts of fuzziness in the plane. The explained processing steps of proposed fuzzy theory are as follows.

Fig. 2
figure 2

System diagram of the proposed fuzzy theory

3.1 Fuzzification

The algorithm proposed in this paper uses the average brightness value \(\bar{f}(0 \le \bar{f} \le )\) of the original image to analyze and distinguish overexposed or underexposed images. Then, the adaptive threshold (f d) is converted according to the image brightness characteristics and fuzzification process processing is conducted, where the conversion of the adaptive threshold value f d is expressed as:

$$f_{d} = 1 - \bar{f}$$
(6)

where \(\bar{f}\) is the average brightness value of the original image, where a higher average brightness value of the original image represents the overexposure of the image, while a lower average value represents an underexposure value. Therefore, the average of brightness value of image is higher that have to mapping to lower adaptive threshold value, and the average of brightness value of image is lower that have to mapping to higher adaptive threshold value. The adaptive threshold parameter is estimated based on this, and then, the image is fuzzified based on the characteristics of the original image, and the applied fuzzified function \(\mu_{xy}\) is expressed, as follows:

$$\mu_{xy} = \left\{ {\begin{array}{*{20}l} {\left( {f_{xy} - f_{\hbox{min} } } \right)/\left( {f_{d} - f_{\hbox{min} } } \right)\quad f_{xy} \le f_{d} } \hfill \\ {\left( {f_{\hbox{max} } - f_{xy} } \right)/\left( {f_{\hbox{max} } - f_{d} } \right)\quad f_{xy} > f_{d} } \hfill \\ \end{array} } \right.$$
(7)

where f max, f min, and f xy, respectively, represent the largest brightness value, smallest brightness value of the original image, and the brightness value of the image in point (x, y).

3.2 Membership Value Adjustment Change

The adaptive threshold parameter f d is substituted into the transfer function in order to adjust and change the strength of membership function \(\mu_{xy}\). The brightness value in the original image area greater than the brightness value of threshold area is down-regulated, while the brightness value smaller than the threshold area is up-regulated. The research shows that the corresponding stimulation value transfer function is a triangular function. If enhancement and inhibition are simultaneously conducted, the demands described above can be met. When \(\mu_{xy} \in [0,1]\), a transfer with a square root operation can enhance the effect more smoothly and softly. Thus, the mathematical formula to change the membership value is expressed as:

$$\mu_{xy}^{'} = \sqrt {\mu_{xy} }$$
(8)

3.3 Defuzzification

Finally, through fuzzification, the adaptive threshold parameter f d is defuzzified with enhanced image brightness \(\mu_{xy}^{\prime }\), in order to obtain enhanced image \(f_{xy}^{\prime }\) subject to fuzzy theory image enhancement, which represents the brightness value of the enhanced image in pixel point (x, y), where \(f_{xy}^{\prime }\) is the inverse operation of original image \(f_{xy}\), and its mathematical formula is expressed as:

$$f_{xy}^{'} = \left\{ {\begin{array}{*{20}l} {\mu_{xy}^{'} \times \left( {f_{d} - f_{min} } \right) + f_{min} f_{xy} \le f_{d} } \hfill \\ {f_{max} - \mu_{xy}^{'} \times \left( {f_{max} - f_{d} } \right) f_{xy} > f_{d} .} \hfill \\ \end{array} } \right.$$
(9)

4 Experimental Result

In this section, the overexposed and underexposed images caused by the ambient light source will be experimented, compared with the common image enhancement algorithm, and their processing capacity and enhanced image visual quality will be analyzed and compared. This study conducts the experiment with two common image enhancement algorithms, respectively, the histogram equalization method and night color image enhancement using fuzzy set algorithm, and compares them with the algorithm proposed in this paper. As shown in Figs. 3, 4 and 5, (a) is the original image, (b) is the result processed with histogram equalization, (c) is the result processed with night color image enhancement using fuzzy set algorithm, (d) is the result processed with fuzzy theory image enhancement, and (e) is the result processed with the algorithm proposed in this paper.

Fig. 3
figure 3

Over-bright image caused by overexposure in scene 1. a Original image, b histogram equalization, c night color image enhancement using fuzzy set, d fuzzy theory image enhancement, e algorithm proposed in this paper

Fig. 4
figure 4

Low-contrast image with concentrated brightness in scene 2. a Original image, b histogram equalization, c night color image enhancement using fuzzy set, d fuzzy theory image enhancement, e algorithm proposed in this paper

Fig. 5
figure 5

Over-dark image caused by underexposure in scene 3. a Original image, b histogram equalization, c night color image enhancement using fuzzy set, d fuzzy theory image enhancement, e algorithm proposed in this paper

In subjective analysis, the visual quality of an image is evaluated with the visual feeling of human eyes as the benchmark. As shown in Figs. 3 and 4, the histogram equalization algorithm has generated a serious blocking effect and color distortion, which damages the characteristic of the original image. Although this method is quite good for the enhancement effect of a night image (see Fig. 5), it is obvious that for an overexposed image, the enhancement processing will cause excessive serious distortion. In addition, the fuzzy image enhancement algorithm is an enhancement algorithm aimed at night images; thus, for an overexposed image, the original image characteristics can be preserved; however, as enhancement of defective detailed information is insufficient, even the required information is fuzzy and weakened. The algorithm proposed in this paper will preserve the characteristics of the original image, enhance some required detailed information, smoothly reduce the brightness value of the overexposed part, and smoothly increase the brightness value of the underexposed part; thus, it can highlight more detailed information.

Aimed at the processing result of the three above algorithms, in objective analysis, this study uses three image quality evaluation methods to evaluate the quality of the processed image: mean square error (MSE), signal-to-noise ratio (SNR), and peak signal-to-noise ratio (PSNR). MSE is used to evaluate the difference between the original image and the enhanced image, where the smaller MSE represents a smaller difference between the enhanced image and original image, and better image visual quality. SNR is used to evaluate the ratio between signal and noise in the image, where the larger the value of SNR, the smaller the noise will be, and the enhanced image is similar to the original image. PSNR is the ratio between the maximum value of the image signal and the noise in the image. The larger ratio represents more approximation of the enhanced image to the original image, and better visual effect of image quality. This study, respectively, evaluates the image processed with the three algorithms, and the evaluation result is as shown in Table 1.

Table 1 MSE, SNR, PSNR image quality evaluation and comparison

Given an m × n monochrome original image I and its produced image K, MSE is defined as:

$${\text{MSE}} = \frac{1}{m \times n}\mathop \sum \limits_{i = 0}^{m - 1} \mathop \sum \limits_{j = 0}^{n - 1} \left( {I\left( {i,j} \right) - K\left( {i,j} \right)} \right)^{2}$$

The SNR is used in imaging as a physical measure of the sensitivity of an imaging system. Industry standards measure SNR in decibels (dB) of power and therefore apply the 10 log rule to the “pure” SNR ratio. The SNR is defined as:

$${\text{SNR}} = 10 \cdot \log_{10} \left( {\mathop \sum \limits_{i = 0}^{m - 1} \mathop \sum \limits_{j = 0}^{n - 1} \frac{{I\left( {i,j} \right)^{2} }}{{\left( {I\left( {i,j} \right) - K\left( {i,j} \right)} \right)^{2} }}} \right)$$

PSNR is most easily defined via the mean squared error (MSE). The PSNR (in dB) is defined as:

$${\text{PSNR}} = 10 \cdot \log_{10} \left( {\frac{{MAX_{I}^{2} }}{MSE}} \right)$$

Here MAX I is the maximum possible pixel value of the image.

As shown in Table 1, the MSE value of histogram equalization is obviously higher, while the values of SNR and PSNR are obviously lower, which represents that the difference between the enhanced image and original image is too large, which makes the image has a significant blocking effect, color distortion, loss of the original image characteristics, and its distortion is the most serious of the three algorithms. The MSE value of the algorithm proposed in this paper is obviously lower than the night color image enhancement using fuzzy set algorithm, while the values of SNR and PSNR are also higher than the night color image enhancement using fuzzy set algorithm. It is especially obvious from the image in scene 1 that the algorithm proposed in this paper can preserve the information of the original image, improve the image visual information, and enhance the detailed information.

To sum up, the algorithm proposed in this paper can preserve the characteristics of the original image, while enhancing the image adaptively aimed at the overexposed and underexposed images, in order to highlight more image detailed information.

5 Conclusion

The fuzzy theory-based adaptive image contrast enhancement technology can process various types of images, as caused by the external light source. It can effectively weaken the brightness of an overexposed image in order that the image can preserve the detailed part presented in the original image. For an underexposed part, it can effectively supplement the brightness value, thus supplementing the part with insufficient information volume, and present a clear visual effect for an underexposed image without causing the phenomenon of excessive distortion due to excessive image enhancement. The fuzzy theory-based adaptive image enhancement algorithm can smoothly enhance an image, without excessively enhancing the image. The algorithm proposed in this paper does not require manual parameter adjustment, as it can judge the exposure degree based on image brightness distribution, thus adaptively enhancing the image. In addition, as it conforms to the original characteristics of the image and achieves the visual effect of enhancing the image, the image can present more detailed information.