Keywords

1 Introduction

Artificial intelligence has significant effect in different domains such as data mining [1,2,3,4,5,6,7], pattern recognition [8,9,10,11,12], machine learning [13,14,15,16,17,18,19] and image processing [20,21,22,23]. One of the applications of image processing is image enhancement [24]. In image contrast enhancement, numerous image enhancement techniques have been researched like a gray-level transformation techniques and histogram processing techniques. In the first group, these methods map the gray-level value in the image to the new one by using transformation function such as power-law transformation, logarithm transformation, etc. For example, in Ref. [25] proposed a method on the statistic image features. The proposed method which is a local, adaptive and multiscale takes the local average and local minimum/maximum in the window at the center of each pixel and then for each pixel identifies a transformation function. Another method in this group is on the 2D Taeger–Kaiser Energy Operator which is quadratic filter. This filter computes the average of the gray values at each pixel by the energy activity. A certain function transforms this value in order to enhance the pixel’s contrast. After that the updated pixel is obtained by applying the reverse steps.

In histogram processing techniques, various studies have already been studied on histogram equalization. Histogram Equalization (HE) is such a method which is used in contrast Enhancement widely [26,27,28]. Achieving a uniform distributed histogram is the major aim of this method. This goal is done by applying the cumulative density function (CDF) of the input image [29]. One of the problems of HE is that it may cause to a washed-out looking, intensified noise and every undesirable artifacts. It can be verified that the mean brightness of the output image is placed at the center of original image gray level regardless of its mean. This property is annoying characteristic in the number of application where brightness preservation is needed [25].

To solve the aforementioned problems different methods such as mean preserving Bi-Histogram Equalization (BBHE) [30], Equal Area Dualistic Sub-Image Histogram Equalization (DSIHE) [31] and Recursive Mean-Spread Histogram Equalization (RMSHE) [29] have been proposed. Singh and Kapoor proposed [32] exposure based sub-image histogram equalization (ESIHE) method for low exposure image enhancement and to divide the image into sub-image, exposure threshold is used. Additional studies which are known as recursive exposure based sub-image histogram equalization (R-ESIHE) [33] applies, recursively ESIHE method until the exposure remnant among consecutive step is less than a certain threshold. The second method which is known as recursively separated exposure based sub-image histogram equalization (RS-ESIHE) [33] recursively applies the segregation of image histogram. In this method, each updated histogram is separated more rely on their correspondence exposure thresholds and each sub-histogram is equalized, exclusively. They have also proposed Median-Mean based sub-image clipped histogram equalization (MMSICHE) [34] algorithm, which partitions histogram based on median intensity and after that based on mean intensity, each sub-histograms are divided. Finally, each clipped sub-histograms are equalized.

Generally, methods based on the Histogram Equalization are grouped into two main groups: local and global [35]. In Global Histogram Equalization (GHE) [36], it is used the total image histogram for enhancement of input image. This method is good for equal frequency gray levels and it fails in image with very high-frequency gray levels. Because the image contrast is limited in high frequency gray levels, therefore, it leads to considerable contrast lack for gray levels with lower frequency [35]. To solve this drawback, local histogram equalization (LHE) is proposed [37,38,39]. In block-overlap histogram equalization [40] which is a LHE method used a windows placed on each pixel of image and HE is implemented only on sub-image that are encompassed in this windows. Then, the gray level of center pixel of window is mapped for enhancement. Shape preserving histogram modification [41] and Partially Overlapped Sub-Block Histogram Equalization (POSHE) [42] are different LHE methods. The only different between the mentioned methods and block-overlap histogram equalization is that in shape preserving histogram modification instead of rectangular window, it is used connected components and level set while in POSHE method the block size is increased in horizontal and vertical coordinate by the constant step size instead of one pixel like in block-overlap histogram equalization method. These approaches need a considerable computational cost and also it strengthens the noise of original image. Recently, combination of both LHE and GHE is proposed [43].

In this study, a Modified Histogram Segmentation Bi-Histogram Equalization (MHSBHE) is proposed. In this study, the histogram segmentation is modified based on average bins. The main contribution of MHSBHE is that it can handle images automatically with high brightness. Results of Simulation illustrate that MHSBHE outperforms recent existing methods in the literature in PSNR, entropy, AMBE and also visual assessment.

The rest of this paper is as follows: in Sect. 2 MHSBHE will be described. Finally, experimental results and conclusion are discussed in Sects. 3 and 4, respectively.

2 Proposed Method

In this section, we introduce Modified Histogram Segmentation Bi-Histogram Equalization (MHSBHE) method. MHSBHE is applied in three steps: histogram modification, histogram segmentation, sub-histogram equalization.

In first step, the histogram is modified before segmentation. In fact, this step is considerably helpful in the segmentation of histogram and is effective in brightness preservation. The past methods have not any modification in segmentation (Table 1).

Table 1 Quantitative analyses for six test images

In this way, the value of histogram bins is more than the average number of gray levels and they are confined to the threshold. The average value is calculated in (1) and (2):

$$ T_{c} = \frac{1}{L}\mathop \sum \limits_{k = 1}^{L} h(k) $$
(1)
$$ h_{c} (k) = T_{c} \quad h(k) \ge T_{c} $$
(2)

where \( h(k) \) and \( h_{c} (k) \) are the input and clipped histogram, respectively.

In the second step, an exposure threshold [32] is applied to compute severity image exposure. This step splits the modified image in two sub-images, under-exposed and over-exposed sub-image. [0–1] is the normalized exposure value range. If this value is more than 0.5, it shows that the majority area of image is over-exposed and if this value is lower than 0.5 then image has majority of under-exposed area. Contrast enhancement should be done in both cases. This value is formulated as

$$ exposure = \frac{1}{L}\frac{{\mathop \sum \nolimits_{k = 1}^{L} h_{c} (k)k}}{{\mathop \sum \nolimits_{k = 1}^{L} h_{c} (k)}} $$
(3)

where L is total gray levels number. In addition that parameter \( X_{\alpha } \) (Eq. (4)) is introduced, which determines the gray level value threshold and splits the image into under and over-exposed sub-images.

This parameter obtains a value of larger (lower) than \( L/2 \) for exposure value lower (larger) than 0.5 for an image with a running range of 0 to L.

$$ X_{\alpha } = L\left( {1 - {\text{exposure }}} \right) $$
(4)

Finally, in step three, HE is implemented on sub-histograms. In such process, the original image histogram is divided rely on exposure threshold value \( X_{\alpha } \) as formulated in (4) and its results are two sub-images IL and IU from 0 to \( X_{\alpha } \) gray level and \( X_{\alpha } + 1 \) to \( L - 1 \) gray level. This is known as under and over-exposed sub-images. \( P_{L} (k) \), \( P_{U} (k),C_{L} (k) \), and \( C_{U} (k) \) are related to Probability Density Function (PDF) and Cumulative Density Function (CDF) of these sub-images, respectively and they are defined in (5)–(8).

$$ P_{L} (k) = h_{c} (k)/N_{L} ,\quad k = 0 \ldots X_{\alpha } . $$
(5)
$$ P_{U} (k) = h_{c} (k)/N_{U} ,\quad k = X_{\alpha } + 1 \ldots L - 1. $$
(6)
$$ C_{L} (k) = \mathop \sum \limits_{k = 0}^{{ X_{\alpha } }} P_{L} (k), $$
(7)
$$ C_{U} (k) = \mathop \sum \limits_{{k = X_{\alpha } + 1}}^{L - 1} P_{U} (k), $$
(8)

where \( N_{L} \) and \( N_{U} \) are pixels number in sub-images IL and IU, respectively.

Equalization is implemented on two sub-histograms, individually. For histogram equalization, the transfer functions can be defined as

$$ F_{L} = X_{\alpha } \times C_{L} $$
(9)
$$ F_{U} = (X_{\alpha } + 1) + (L - X_{\alpha } + 1)C_{U} $$
(10)

\( F_{L} \) and \( F_{U} \) are the transfer functions are applied for equalizing the sub-histograms, exclusively. Finally, two sub-images combine into one full image. The enhanced image is generated by merging two transfer functions.

3 Experimental Results

The simulation results of the proposed method, MHSBHE, are presented and compared to six well-known literature works, i.e., HE, BBHE [30], DSIHE [31], RMSHE [29], ESIHE [32] and R_ESIHE [33]. To analyze these methods, 400 test images are used. Visual quality comparison of two images i.e. Road, Mass are illustrated in Figs. 1 and 2.

Fig. 1
figure 1

Enhancement results of road image

Fig. 2
figure 2

Enhancement results of mass image

To measure the function of MHSBHE, Entropy is being used as image quality measure to evaluate enhanced image [33]. Higher entropy value shows greater information content is accessible in the image. Equation (11) calculates Entropy

$$ {\text{Ent}}(p) = - \mathop \sum \limits_{I = 0}^{L - 1} P(I){ \log }P(I) $$
(11)

where \( P(I) \) shows PDF of image at intensity level I.

In addition that entropy is measured in units as bits and can be as a criteria of affluence of the image details. Referred to Shannon Entropy, this entropy measures the uncertainty related to image’s gray levels. An image with a superior entropy value has the affluence of details and is assumed to have superior quality.

To evaluate the performance of MHSBHE, AMBE [44] is used. AMBE is a useful in calculating the brightness preservation level. The AMBE between two input and enhanced image is computed as follows:

$$ {\text{AMBE}}\left( {M.N} \right) = \left| {M\_M - N\_M} \right| $$
(12)

where M and N are input and output image, respectively. Also, M_M and N_M are the mean of the two original and enhanced image, respectively. If the mean difference is less, then the input image’s brightness is preserved in the enhanced image.

Lastly, \( P_{snr} \) measures the peak signal-to-noise of the enhanced image. Regarding to noise expanding problem during the enhancement, PSNR quantifies the quality of an enhanced image

$$ P_{\text{snr}} \left( {I(c)} \right) = \frac{{10 \times \log_{10} \left( {L - 1} \right)^{2} }}{\text{MSE}}, $$
(13)

3.1 Performance Assessment

For comparison, accuracy measurement is necessary between MHSBHE and literature work based on the PSNR, entropy, and AMBE for 400 benchmark images. Table 2 shows quantitative analyses for two test images. MHSBHE produces highest values in most cases. Beside this comparison, MHSBHE implemented on 400 images on different databases such as USC-SIPI (Misc and Sequences), USF-DM, Astronomical images, Medical images, Miscellaneous, etc. The comparison results are presented in Table 3. As it can be seen in this Table, the proposed method, MHSBHE, has better results in all measurements.

Table 2 Quantitative analyses for six test images
Table 3 Average values of quantitative analyses for 400 test images

3.2 Assessment of Visual Quality

Finally, the methods are compared based on image visual assessment. The enhanced images which are resulted after applying the MHSBHE and the mentioned method are demonstration in Figs. 1 and 2. As shown in these enhanced images, MHSBHE has better natural appearance and high contrast images.

Obviously, in Fig. 1 of Road image, it is shown that the MHSBHE image improves the Truck in the image, effectively. This enhancement obviously can be seen compared to other methods. In Fig. 2, by applying MHSBHE, an extreme contrast of the results in contrast enhancement as well as natural appearance, can be obviously observed in this figure. Results of other methods enhance the noise. However, MHSBHE image manages on over-enhancement which cause to desirable contrast enhancement outputs.

Although the MHSBHE results in some images are visually comparable to literature approaches, MHSBHE gives considerably the highest PSNR, entropy and AMBE value for these images. This shows that the MHSBHE method generates enhanced images with preserving brightness, retaining the shape features of the original histogram and control over enhancement rate.

3.3 Summary of Assessment and Discussion

By visually inspecting the enhanced images and assessment of PSNR, entropy and AMBE measures, it can be summarized that

  1. (i)

    MHSBHE technique is the best among other methods in terms of maximum signal value of the image (PSNR) and high richness of details (entropy) and the degree of brightness preservation (AMBE).

  2. (ii)

    MHSBHE is robust against the noise compared to other methods which enhance noise during enhancement.

  3. (iii)

    MHSBHE performs well on the images with high dynamic range with the low and high illumination.

  4. (iv)

    MHSBHE generates images with high contrast enhancement and manage on over-enhancement.

In this proposed method, it produces images which are quantitatively better in quality compared to other literature methods.

4 Conclusion

In this study, the Modified Histogram Segmentation Bi-Histogram Equalization was proposed. In this study, MHSBHE was applied in three steps: histogram modification, histogram segmentation, sub-histogram equalization. The histogram segmentation was modified based on average bins. The main motivation of MHSBHE is that it can handle images automatically with high brightness.

MHSBHE is suitable for a wide variety of images with low-contrast. Also, the proposed method can control various images, automatically. This method attains multi objective of preserving brightness, maintaining the shape features of the original histogram and controlling over-enhancement rate, suiting for applications of consumer electronics.

MHSBHE eschewed over-enhancement and generated images with natural enhancement. In experimental results, the proposed method was applied on 400 standard images and it outperformed based on four criteria: PSNR, entropy, AMBE and visual assessment. In addition that the results showed that MHSBHE is applicable for consumer electronic products.