Keywords

1 Introduction

Image enhancement is a usual method for highlighting certain information in an image according to the specific need and weakening or removing some unnecessary information simultaneously to improve the image quality [1]. Literatures indicate that lots of effective algorithms in specific areas are proposed as a local algorithm for image enhancement based on models such as filtering, partial differential equation, and digital morphology [2]. Niu et al. [3] proposed a new image contrast enhancement algorithm based on wavelet transform and un-sharp mask. Literature [4] proposed an improved image contrast enhancement algorithms based on partial differential equation (PDE). This method gives a general design method of piecewise linear stretch function to achieve better histogram equalization. Literature [5] proposed a method based on mathematical morphology with multiple structural elements, and multiscale dual-gradient edge detection. As a classic local adaptive image enhancement algorithm, Lee algorithm can reduce the complexity of calculation and enhance the image detail. However, excessive noise enhancement and large object edge oscillation is still a problem worth to be discussed further.

2 Lee Algorithm

The general form of Lee algorithm [6] is as follows:

$$ g(i,j) = \bar{f}(i,j) + \beta \,[f(i,j) - \bar{f}(i,j)] $$
(27.1)

In the formula, the gray value of the preprocessed and postprocessed image pixels is represented by \( f(i,j) \) and \( g(i,j) \), respectively. \( \overline{f} (i,j) \) means the arithmetic mean in the neighborhood of the preprocessed image which has taken \( (i,j) \) as the center and the size n × n; β is a real number.

In order to enhance the image with ill-conditioned distribution histogram, which means to readjust the gray level of the image, the improved Lee algorithm is proposed:

$$ g(i,j) = \alpha \bar{f}(i,j) + \eta + \beta \,[f(i,j) - \bar{f}(i,j)] $$
(27.2)

In the formula (27.2), \( y = \alpha \overline{f} (i,j) + \eta \) is a linear gray-level stretching function, and α, β, and η are real numbers. When β > 1, the edge of the image can be sharpened. And when α > 1, the gray value of the image can be stretched to high brightness area; otherwise, the gray value of the image can be stretched to lower intensity. Parameter η is used to adjust the dynamic range of the global image.

3 The Adaptive Local Image Enhancement Based on Lee

3.1 Logarithmic Transformation

Logarithmic transformation [7] followed by gray value normalized complement transformation is introduced into Lee algorithm, which constructs a new nonlinear transform for Lee’s image enhancement. The transformation is defined as follows:

$$ \bar{f} = 1 - (f/M) $$
(27.3)

In the formula (27.3), gray function f is defined in [0, M] interval, for 8-bit images, M = 255. The substituted and simplified equation can be expressed as follows:

$$ \log (\bar{g}((i,j)) = \alpha \log (\bar{\alpha }(i,j)) + \beta \log [(\bar{f}(i,j))] - \log (\bar{\alpha }(i,j)) $$
(27.4)

In the formula (27.4), \( \bar{f}(i,j) \) represents preprocessed image after normalized complement transformation, and \( \bar{g}(i,j) \) represents postprocessed image after normalized complement transformation. The meaning of α and β in the formula (27.4) is the same as the formula (27.2). Among them,

$$ \log (\bar{\alpha }(i,j)) = \frac{1}{n \times n}\left( {\sum\limits_{{k = - \frac{n}{2}}}^{{\frac{n}{2}}} {\sum\limits_{{l = - \frac{n}{2}}}^{{\frac{n}{2}}} {\log \left( {\bar{f}(i + k,j + l)} \right)} } } \right) $$
(27.5)

In the formula (27.5), n is the neighborhood size. In the formula (27.4), the first term \( \alpha \log (\bar{\alpha }(i,j)) \) is to stretch image dynamic range to expected extent, and the second term \( \beta \left[ {\log \left( {f(i,j)} \right) - \log \left( {\bar{\alpha }(i,j)} \right)} \right] \) is to sharpen the image, while \( g(i,j) \), which means the output image, is obtained via an inverse transformation of \( \bar{g}(i,j) \), which is given in Eq. (27.4), as the following formula:

$$ g(i,j) = M(1 - \bar{g}(i,j)) $$
(27.6)

3.2 Dual-Platform Histogram Equalization

In the paper, fixed dual-platform threshold is proposed. The algorithm of dual-platform histogram equalization [8] is defined as follows:

  1. (1)

    Calculating the histogram of image \( g(i,j) \) obtained by the formula (27.6).

  2. (2)

    Transferring the histogram by dual-platform threshold as follows.

    $$ H(r_{k} ) = \left\{ {\begin{array}{*{20}l} {T_{1} } \hfill & {h(r_{k} ) \le T_{1} } \hfill & {} \hfill \\ {h(r_{k} )} \hfill & {T_{1} < h(r_{k} ) < T_{2} } \hfill & {(k = 0,1,2, \ldots ,L - 1)} \hfill \\ {T_{2} } \hfill & {h(r_{k} ) \ge T_{2} } \hfill & {} \hfill \\ \end{array} } \right. $$
    (27.7)

    In the formula (27.7), T 1 is the lower threshold, T 2 is the upper threshold, L is the gray level, and \( h(r_{k} ) \) is the probability density of the grayscale image.

  3. (3)

    Calculating the cumulative histogram \( F(r_{k} ) \) of images based on the modified histogram statistics in the formula (27.7).

    $$ F(r_{k} ) = \sum\limits_{j = 0}^{k} {H(r_{k} )} ,\quad k = 0,1,2, \ldots ,L - 1 $$
    (27.8)
  4. (4)

    Remapping the image gray levels based on the cumulative histogram \( F(r_{k} ) \) to obtain the grayscale values after equalization \( D(r_{k} ) \) as given in the following equation.

    $$ D(r_{k} ) = \left\lfloor {(L - 1)F(r_{k} )/F(r_{L - 1)} } \right\rfloor $$
    (27.9)

where ⌊∙⌋ means rounding operation.

3.3 Calculation of the Adaptive Dual-Platform Threshold

The calculation of the dual-platform threshold is referred to relative research [9]. The upper platform threshold T 2 should equal to the peak value \( h\left( {k_{\text{target}} } \right) \) of interested object in histogram. When \( h\left( {k_{\text{target}} } \right) \) is difficult to be located accurately in the histogram, the range of T 2 will be approximately calculated according to the consideration that the value of T 2 should locate between the peak value \( h\left( {k_{\text{target}} } \right) \) of the interested object and the peak value \( h\left( {k_{\text{background}} } \right) \) of the background, and it is near to \( h\left( {k_{\text{target}} } \right) \) usually. That is,

$$ h\left( {k_{\text{target}} } \right) < T_{2} < h\left( {k_{\text{background}} } \right) $$
(27.10)

and

$$ T_{2} - h\left( {k_{\text{target}} } \right) < h\left( {k_{\text{background}} } \right) - T_{2} $$
(27.11)

Therefore,

$$ h\left( {k_{\text{target}} } \right) < T_{2} < \frac{{h\left( {k_{\text{target}} } \right) + h\left( {k_{\text{backound}} } \right)}}{2} $$
(27.12)

In the formulas above, \( h\left( {k_{\text{target}} } \right) \) is the corresponding histogram peak value of the interested objects, and \( h\left( {k_{\text{background}} } \right) \) is the corresponding histogram peak value of the image background.

In order to avoid the combining of smaller gray levels in histogram, the rule that the intervals of adjacent gray levels in original histogram should be larger than 1 in the modified histogram should be considered in the setting of lower platform threshold. That means that

$$ D = \frac{F(K) - F(K - 1)}{F(L)}*L \ge 1 $$
(27.13)

where D is the interval of two adjacent gray levels in the valid gray level set of the modified histogram, L is the total gray levels, F(k) is the modified cumulative histogram of the image, F(L) is the total cumulative histogram values of the modified image, and F(k) − F(k − 1) is the statistical value h(k) of the gray value k in modified histogram.

Let \( T_{1} = H_{\hbox{min} } (k) \)), when T 1 is used as the lower platform value, the modified image will not lose any original gray value. Then, the algorithm guarantees

$$ \frac{{T_{1} }}{F(L)}*L \ge 1 $$
(27.14)

4 Experiment and Analysis

To verify the algorithm, one of the samples and experiment results is provided in Fig. 27.1, and comparison among Lee algorithm, the proposed algorithm and other algorithms is provided in Fig. 27.2. The samples are usually low-contrast images.

Fig. 27.1
figure 1

The result of adaptive local enhancement algorithm based on Lee. a Original image. b Result

Fig. 27.2
figure 2

Experiment result comparison. a Original image. b Lee method. c Logarithmic transformation method. d Proposed method

Figure 27.2a is an original color image with low contrast.

Figure 27.2b is the result of local Lee algorithms, which is similar to Wallis filtering. The method achieved increased global brightness and enlarged image dynamic range, but the texture in sky is enhanced improperly.

Figure 27.2c is the result of logarithmic transformation. The method also achieved increased global brightness and enlarged image dynamic range. Compared to the previous two figures, it is more coincident to human visual system, especially in global color saturation and image details. However, the sky is overenhanced.

Figure 27.2d is the result of the proposed algorithm. The details in the foreground and background images are all enhanced effectively with enlarged image dynamic range and increased global brightness. Particularly, compared with Fig. 27.2c, the proposed method avoids excessive enhancement of image background, retains excellent color consistency, and is more coincident with human visual system. It demonstrates that the proposed algorithm shows good performance in image detail enhancement and background noise suppression. It is an effective image enhancement algorithm.

To demonstrate the result of the proposed algorithm, quantitative indicators are listed in Table 27.1. Gray mean value is used to measure the global brightness of the images. Standard deviation is used to measure the global contrast of the images. Entropy is used to measure the global quantity of information. PSNR is used to measure the feature information quantity relative to origin image.

Table 27.1 The quantitative comparison of the image enhancement algorithms

As the indicators in Table 27.1, either the proposed method or the Lee method performs well on image brightness improvement, but the proposed method shows better performance in contrast enhancement and can effectively reduce the image noise at the same time.

Integrating subjective evaluation and objective evaluation, the proposed method has better performance than Lee and other methods, and the proposed method can enhance image details and reduce noise simultaneously, which matches the research target.

5 Conclusions

A novel adaptive local image enhancement algorithm is proposed in this paper, which is able to enhance images effectively and overcome the shortcomings of traditional methods. Based on Lee algorithm, logarithmic transformation, together with normalized complement transformation, was introduced, and adaptive dual-platform threshold based on histogram equalization was integrated to form a new algorithm. The algorithm proposed in this paper achieves good combination of image contrast enhancement, feature preservation and noises removing to improve image quality greatly.