1 Introduction

Histogram equalization (HE) is the most popular technique for generating better visualization of enhanced images. Since the demands of the electronic display are continually growing during the last decades, the HE method has been widely utilized in many applications, including high dynamic range imaging [1], head gesture recognition [7], speech recognition [8], face recognition [10], threshold determination in noise removal [11], tone mapping technique [14], electrophoretic displays [15], texture synthesis [24], fingerprint recognition [29], and black-light power reduction, etc. In recent years, the HE method is improved to enhance the color images [21, 22, 26, 30, 32], thus the most important utility of these methods is the video enhancement [13].

The conventional HE method [12] is a technique that stretches the dynamic range of the image histogram and generates the uniform probability distribution of grayscale for enhancing the contrast of the input images. Unfortunately, many kinds of undesirable and unpleased artifacts, e.g., the under-enhancement, will be produced by the conventional HE method because of the cumulative distribution with both significant and insufficient changes obtained from the input image. In addition, the mean brightness between the input and enhanced images cannot be well preserved after applying the HE method. As shown in Fig. 1, the original image is enhanced by the conventional HE method. It is observed that the textures of some regions are disappeared because of the under-enhancement, e.g., the neckband of the jacket and leaves behind the hedge in the upper left of the image. Moreover, the mean brightness is significantly changed after enhancement, and the noises of the whole image are increased. To overcome the problems of the under-enhancement and preserve the mean brightness of input image, the local HE is subsequently developed by partitioning the input image or histogram into several sub-images or sub-histograms for generating better enhancement results. In other words, the local HE is focus on generating various transformation functions from partitioned sub-images or sub-histograms to adaptively improve the contrast enhancement. Consequently, various local HE methods have been proposed in the literature [4, 6, 1618, 20, 25, 27, 31].

Fig. 1
figure 1

The example of the undesirable artifacts by the HE method. a Original image. b Enhanced image

Kim presented the mean preserving bi-histogram equalization (BBHE) [18], in which the mean gray value is used as the pivot to partition the histogram of the input image into two sub-histograms. The conventional He method is then applied to two sub-histograms. Instead of using the mean gray value as the pivot to partition the input image, Wang et al. presented an equal area dualistic sub-image-based histogram equalization (DSIHE) [31] to partition the histogram of the input image into two sub-histograms such that two sub-histograms have similar cumulative distribution function. The above methods partition the histogram of the input image into two sub-histograms, yet restrict the ability of brightness preservation. For the better brightness preservation ability, two extend HE methods are proposed, such as the recursive mean separate histogram equalization (RMSHE) [4] and recursive sub-image histogram equalization (RSIHE) [27], in which these methods preserve the essences of the BBHE and DSIHE and partition the histogram of the input image into several sub-histograms. Later, Kim and Chung presented a recursively separated and weighted histogram equalization (RSWHE) [16], and a weighting process of each sub-histogram is utilized for achieving better enhancement performance.

Contrary to those sub-histogram-based local HE methods, the regional block-based local HE methods are subsequently proposed to obtain more discernible contrast of the input images. Yet, the problem of over-enhancement often follows these kinds of local HE methods, and the computational complexity will be unacceptably increased because each pixel has its own transformation function, such as the wavelet-based histogram equalization (WLHE) [25] proposed by Sakellaropoulos et al.. To decrease the time consumption, Kim et al. presented partially overlapped sub-block histogram equalization (POSHE) [17]. Instead of applying the conventional HE method on each pixel, the input image is first partitioned into the non-overlapped sub-images, and the pixels are enhanced with identical cumulative distribution function in one sub-image. Since WLHE and POSHE have high computational complexity, Lamberti et al. presented the cascaded multistep binomial filtering histogram equalization (CMBFHE) [20] to speedup the POSHE by efficient filtering approach. Although the CMBFHE achieves acceptable computational complexity, the over- and under-enhancement remain to be solved for the practical applications.

Currently, some contrast enhancement methods [2, 3, 6, 13] have been proposed to enhance the color images or video frames, and these methods prefer to use efficient strategy to modify the probability or refine the cumulative distribution for producing naturally looking contrast enhancement and decreasing the time complexity. Although these methods achieve naturally looking visualization and low time consumption, some textures of the input image may still be disappeared and distorted because of the over- and under-enhancement. Celik and Tjahjadi proposed a contextual and variational contrast enhancement method (CVC) [3] to improve the visual quality of the image efficiently. This method adopts a 2D histogram to generate the contextual information in the input image, such as the object textures and boundaries, and then it directly constructs a priori probability distribution for generating a natural looking contrast enhancement. However, the CVC method requires higher computational complexity when increasing the grayscale differences between the neighboring pixels. Next, Cheng and Huang presented a bilateral Bezier curve-based histogram modification method (BBCHE) [6] to ameliorate the cumulative distribution with the significant and insufficient changes by using the bilateral Bezier curve for obtaining the better visualization of the enhanced images. Yet, the ability of histogram modification is limited, especially in the non-textured region with steep cumulative distribution, over-enhancement. Then, the under-enhancement cannot be well solved because of the bilateral Bezier curve. Subsequently, for applying the HE method to the video frames, Huang et al. presented an adaptive gamma correction with weighting distribution (AGCWD) [13] to modify the input histogram by weighting distribution, and this method automatically enhances image with gamma correction efficiently. However, the AGCWD method may result in loss of details on bright regions of image when there are high peaks in the input histogram because of the gamma correction curve. Then, Celik proposed a novel HE method, the spatial entropy-based contrast enhancement (SECE) [2], which enhances the image contrast by using spatial information of pixels. The SECE method computes the spatial entropy of pixels according to the spatial distribution of pixel grayscale. Different than the other HE methods, the SECE method considers the spatial distribution of grayscale in the input image instead of probability distribution of the histogram for generating a better visual quality of the enhanced image, yet some textures in the non-textured regions may be disappeared because they have extreme small entropy of its probability distribution, and some noises will be enlarged because of the large entropy.

In this paper, to accomplish a better contrast enhancement without over- and under-enhancement and an acceptable time complexity, an improved local HE method is proposed by combining the weighted transformation functions of the partitioned non-overlapped sub-images based on the gradient information for edge preservation, called the EPLHE method. First, the input image is divided into the non-overlapped sub-images with simple partition strategy, and the conventional HE method is then applied to each sub-image to generate the transformation function. To ameliorate the problem of over- and under-enhancement caused by the local HE method, the bilateral Bezier curve is employed to alter the cumulative distribution with the significant and insufficient changes. However, the problem of edge elimination remains to be solved because the modified cumulative distribution is still steep, thus the proportion of gradients detected by the Sobel operator in sub-images is calculated to create a set of weights. The transformation functions generated from all sub-images are then combined based on this set of weights. The key idea of the proposed weighting process is that the fewer gradients a sub-image contains, the more contribution its transformation function provides. In a nutshell, the proposed method creates a global transformation function from each sub-image by using the bilateral Bezier curve and a proposed weighting process with the gradient information, thus the proposed method can deal with the problem of edge elimination caused by the cumulative distribution with the significant and insufficient changes. The performance of contrast enhancement method can be assessed by two important factors, the mean opinion score and detailed examination. Based on the several test images as shown in Fig. 2, two important advantages are provided in this paper as follows.

Fig. 2
figure 2

Eight representative test images. a Baboon. b Barbara. c Boat. d Girl. e House. f Jet. g Lena. h Pepper

  • The proposed method generates a global transformation function by combining all cumulative distributions of the sub-images with the bilateral Bezier curve and a proposed weighting process based on the gradient information.

  • The proposed method has better performance on edge preservation, brightness preservation, and better visualization when compared with the other four state-of-the-art methods based on the subjective evaluations and qualitative comparisons.

  • The proposed method employs the non-overlapped sub-images for decreasing the time consumption of the local histogram equalization, thus it can be utilized in the practical applications, such as the video enhancement.

The remainder of the paper is organized as follows. Section 2 provides an overview of the main steps, and discusses the details of the proposed enhancement method, including the image partition, local histogram equalization, histogram modification by the bilateral Bezier curve, and final transformation function adjustment with the gradient information. Experimental results and performance comparisons are documented in Section 3. Finally, Section 4 draws the conclusion.

2 The proposed contrast enhancement method

In this paper, a novel local contrast enhancement method is proposed for edge preservation. Figure 3 illustrates the entire process of the proposed method which is composed of three steps: a.) The image partition and local histogram equalization; b.) the histogram modification by the bilateral Bezier curve; c.) the transformation function combination with the gradient information. The general algorithm works as follows. For better contrast enhancement, the local HE method is employed to sharpen the contrast of the input images. Thus, the first step is to separate the input image into several sub-images with simple partition strategy, and the HE method is then applied to each sub-image to generate the cumulative distributions of the sub-images. Although the local HE method can significantly enhance the contrast for solving the problem of under-enhancement, the over-enhancement is existed because of the significant cumulative distribution obtained from the input sub-images. Therefore, after obtaining all transformation functions, the bilateral Bezier curve is used to ameliorating the cumulative distributions with significant change in the sub-images for decreasing the influences of over-enhancement produced from the local HE method in the second stage. Yet, in some textured sub-images, the edges are still discard and eliminated because of the over-enhancement. Consequently, the final step is to combine all cumulative distributions of the sub-images by detecting the proportion of gradients in sub-images as a set of weights with the famous Sobel operator. According to these generated weights, a global cumulative distribution is generated from all cumulative distributions of the sub-images to provide an appropriate transformation function for edge preservation and better image contrast enhancement.

Fig. 3
figure 3

Overview of the proposed contrast enhancement method. a Image partition and local histogram equalization. b Bilateral Bezier curve-based histogram modification. c Transformation function combination

2.1 The image partition and local histogram equalization

Since the local HE method is selected to enhance the input images for more contrasty, a local HE method, the partially overlapped sub-block histogram equalization (POSHE) [17], is used to generate the cumulative distributions of the sub-images, and it employs the overlapped sub-images and applies the traditional HE method [12] on each sub-image. However, the convoluted computation of the traditional HE method consumes a lot of time on calculating the cumulative distribution function for each sub-image. Therefore, a simple image partition strategy is required to separate the input image into several non-overlapped sub-image first. For decreasing the time complexity of the proposed method, the input image I of size M × N is equally separated into K × K non-overlapped sub-images of size M/K × N/K, and I can be described as

$$ I=\bigcup\limits_{a=1}^{K} \bigcup\limits_{b=1}^{K} S_{a,b}, $$
(1)

where S a,b is the sub-image numbered as a and b, and K is calculated based on the image size by

$$ K={\lfloor(\log_{2}M)/2\rfloor}, M=N. $$
(2)

Figure 4 gives the example of the input image of size 512 × 512 partitioned as 4 × 4 sub-images, K is 4 in this example.

Fig. 4
figure 4

The input image is partitioned into 4 × 4 sub-images

After the image partition, the traditional HE method is applied to each sub-image for generating the cumulative distribution. In the HE method, the relation between the input and enhanced images can be formulated as below,

$$ E_{a,b}=f_{a,b}(S_{a,b}), $$
(3)

where S a,b and E a,b denote the given input sub-image and corresponding enhanced sub-image, respectively, and f a,b (⋅) is considered as the transformation function. The proposed local HE method calculates the probability density function (pdf) for the partitioned sub-image S a,b of size M/K × N/K, and then go through all partitioned sub-images. The cumulative distribution function (cdf) of each pdf is subsequently constructed to yield a transformation function, and they can be defined as below,

$$\begin{array}{@{}rcl@{}} p_{a,b}(g)&=&\frac{1}{|S_{a,b}|}\sum\limits_{(m,n)\in S_{a,b}}\delta(I(m,n)-g),\quad\text{ where }\quad g \in [0,L],\\ \text{and}\quad c_{a,b}(g)&=&\sum\limits_{h=0}^{g}p_{a,b}(h), \end{array} $$
(4)

where g denotes the possible values, and L is 255 in an 8-bit grayscale digital image; S a, b = {I(m, n)||m| ≤ ⌊M/2K⌋, |n| ≤ ⌊N/2K⌋} of size M/K × N/K denotes the neighboring pixels in each S a, b ; |S a, b | denotes the cardinality of S a, b ; p a, b (⋅) and c a, b (⋅) denote the pdf and cdf of the grayscale distribution, respectively. Subsequently, the transform function can be formulated as below,

$$ f_{a,b}(g)=L \ast c_{a,b}(g). $$
(5)

However, once the partitioned sub-image S a,b belongs to non-textured regions of the input image, the entropy of the pdf in S a,b partitioned by the proposed image partition strategy is extremely low. The generated cdf of this kind of S a,b will be significant steep, and the over-enhancement will be produced after the HE method. As shown in Fig. 5, the mean brightness and indistinct texture of the wall and tabletop is significantly increased and over-enhancement, respectively. The edges of the wall and tabletop are unclear and indistinct in Fig. 5a, thus it is difficult to observe these edges. Because these edges are located in the sub-image with low entropy and their corresponding cdf have insufficient changes, these edges with low contrast will be over-enhanced in Fig. 5b. Compared to the POSHE, the BBCHE can overcome these artifacts caused by over-enhancement by adjusting the cdf with the bilateral Bezier curve. Contrary to the over-enhancement, the edge between the border of the clock is not clear and indistinct, the under-enhancement, due to the insufficient change of the generated cdf. The BBCHE is hardly deal with the problem of the under-enhancement because the generated cdf of this kind of S a,b is already uniform. To solve the problem of over-enhancement first, the bilateral Bezier curve-based histogram equalization (BBCHE) [6] is adopted to modify those significant and insufficient cumulative distributions, and the detail is described in the next subsection.

Fig. 5
figure 5

The example of the over- and under-enhancement by the POSHE method. a Original image. b Enhanced image

2.2 The histogram modification by the bilateral Bezier curve

To overcome the over-enhancement, the bilateral Bezier curve-based contrast enhancement method (BBCHE) [6] is used to modify the cdf by using the bilateral Bezier curve, and it generates a smooth curve contained in the convex hull of the selected control points to approximate the original cdf. Instead of the original cdf with significant changes, the smooth curve generated by the BBCHE can efficiently overcome the over-enhancement. The key of the BBCHE is to partition the cdf c a,b (g) of each enhanced sub-image E a,b into two regions, the darker region and brighter region, and two sets of the control points are determined for each region. As shown in Fig. 6, it is observed that the BBCHE can ameliorate the over- and under-enhancement by generating a smooth cdf in the darker region with the first set of control points, and the high gray value in the brighter region will be slightly decreased to enhance the contrast with the intensity preservation.

Fig. 6
figure 6

The example of the original and modified histograms by the bilateral Bezier curve

To separate the original cdf into two sub-histograms, the mean of the cdf c a,b (g) in the enhanced sub-image E a,b is calculated as the pivot to discriminate two regions, and is formulated as

$$ \mu_{a,b}=\frac{\sum\limits_{i=0}^{g^{max}}c_{a,b}(i)\ast i}{\sum\limits_{j=0}^{g^{max}}c_{a,b}(j)}, $$
(6)

where g max denotes the maximum gray value appeared in a sub-image. Subsequently, the BBCHE method creates a smooth curve B a,b (g) as a new cdf to approximate the original cdf c a,b (g) by adopting the bilateral Bezier curve, and it can be formulated as

$$\begin{array}{@{}rcl@{}} B_{a,b}(z_{a,b})&=&\sum\limits_{s=0}^{2} \left( \begin{array}{c} 2 \\ s \end{array}\right)(1-z_{a,b})^{2-s}z_{a,b}^{s}C^{s}\\ &=&(1-z_{a,b})^{2}C^{0}+2(1-z_{a,b})z_{a,b}C^{1}+z_{a,b}^{2}C^{2}, \end{array} $$
(7)

where s denotes the index of three control points. z a,b ∈ [0, 1] denotes the normalized parameter and can be defined as

$$ z_{a,b}(g)=\left\{\begin{array}{ll} g/\mu_{a,b}, & \text{if }g\leq \mu_{a,b};\\ (g-\mu_{a,b})/\left( g^{max}-\mu_{a,b}\right), & \text{otherwise}, \end{array}\right. $$
(8)

where g∈{(k/g max)|k = 0, 1, 2,…,g max} denotes the grayscale of the original cdf c a,b (g). Finally, C s denotes the control points. For the darker region, C 0, C 1, and C 2 are 0, \(c_{a,b}\left (\frac {\mu _{a,b}}{2}\right )g^{max}\), and c a,b (μ a,b )g max, respectively. Likewise, for the brighter region, C 0, C 1, and C 2 are c a,b (μ a,b )g max, \(c_{a,b}\left (\frac {\mu _{a,b}+g^{max}}{2}\right )g^{max}\), and g max, respectively. Finally, the generated new cdf B a,b (g) is used to be the new transformation function for the sub-image.

Although the BBCHE method creates a linearly increasing cdf by the bilateral Bezier curve for slightly overcoming the over- and under-enhancement of the enhanced sub-images, the over-enhancement is still produced in the non-textured sub-images, leading to edge elimination. Thus, the gradient information of the partitioned non-overlapped sub-images should then be considered to generate an appropriate cdf curve and alter the transformation function of the HE method.

2.3 The transformation function combination with the gradient information

In the extreme non-textured sub-images, the cdf is unacceptable significant changes, thus the dynamic range of the image histogram cannot be stretched to form a linearly increasing cdf. In this section, the gradient information of the sub-images will be considered as a weighting process to combine all cumulative distributions B a,b (g) refined by the BBCHE method to recreate a global transformation function for reducing the over-enhancement and preserving the image textures. First, the proposed EPLHE method measures the proportion of gradients in the sub-images by using the Sobel operator. Because the Sobel operator is an efficient edge detection method, it is very suitable to extract the gradient information for saving the computational complexity in the proposed improved local HE method. Two masks of the Sobel operator are used to convolve on each pixel of input image I, and they can be defined as follows

$$ G(x) = \left[\begin{array}{ccc} +1 & 0 & -1 \\ +2 & 0 & -2 \\ +1 & 0 & -1 \end{array} \right] \text{ and }G(y) = \left[ \begin{array}{ccc} -1 & -2 & -1 \\ 0 & 0 & 0 \\ +1 & +2 & +1 \end{array}\right]. $$
(9)

For obtaining the gradient of each pixel G(x,y), the results of two masks are combined by the following equation.

$$ G(x,y)=\sqrt{G(x)^{2}+G(y)^{2}}. $$
(10)

Then, the total of the gradients G a,b in each sub-image S a,b is summed up to be a weight for further transformation function combination. Since some cdf B a,b (g) generated by the BBCHE method is still significant changes when the sub-image belongs to the non-textured regions, the proposed local HE method requires a linearly increasing cdf for better contrast enhancement. To generate a linearly increasing cdf, all cdf B a,b (g) generated by the BBCHE method are combined to form a global transformation function, thus a weighting process is proposed. The main idea of the proposed weighting process is to create a set of weights according to the proportion of gradients in each sub-image S a,b and combine all B a,b (g) according to the weights. The algorithm of the weighting process is described as follows.

  1. 1.

    Construct the vector of the gradients G = {G 1,1,G 1,2,…,G K,K } for each sub-image S = {S 1,1,S 1,2,…,S K,K }.

    1. 1.1

      for a = 1 to K

    2. 1.2

      for b = 1 to K

    3. 1.3

      \(G_{a,b}=\sum \limits _{x,y \in S_{a,b}}G(x,y)\)

    4. 1.4

      end for

    5. 1.5

      end for

  2. 2.

    Sort the vector of the gradients G in the descending order into the ranking vector G , and assign the corresponding weights W a,b from 0 to (K × K−1) based on the ranking vector \(G^{\prime }_{a,b}\).

After calculating the weight W a,b of the sub-image S a,b , the global transformation function f(x, y) is generated by

$$ f(g)=\frac{\sum\limits_{a=1}^{K}\sum\limits_{b=1}^{K}B_{a,b}(g)\ast W_{a,b}}{\sum\limits_{a=1}^{K}\sum\limits_{b=1}^{K}W_{a,b}}. $$
(11)

The main idea of the weighting global transformation function is the fewer gradients a sub-image contains, the larger weight the transformation function is allocated. Thus, in the algorithm of weighting process, the first weight W a,b is assigned to 0, the smallest weight, since its corresponding sub-image S a,b contains the largest number of gradients G a,b . The cdf of this sub-image is linearly increasing, and the transformation function of this sub-image with the most edges will not be considered into the weighting process to avoid reducing the ability of contrast enhancement of combined global transformation function f(x,y), while leading to the under-enhancement in the other sub-images with few edges after applying f(x,y). In addition, the weight is set from 0 to (K × K−1) based on the proportion of gradients in sub-images, not directly using the total of gradients as the weight, because the difference of total of gradients between each sub-image is too large. Subsequently, the new global transformation function f(x,y) is used to enhance the input image I by following equation.

$$ X=f(I(g)), $$
(12)

where X denotes the resultant enhanced image.

For those sub-images in the non-textured region, the over-enhancement generated by the proposed weighted global transformation function will be less than the original one. Contrary to the sub-images in the textured region, the ability of contrast enhancement will be increased by the proposed weighted global transformation function. In a nutshell, the proposed weighted global transformation function can suppress the over- and under-enhancement. Hence, it is clear that the sub-image with the fewest gradients gains the largest weight, and the cdf of the non-textured sub-image provides more contribution for combining the transformation function. Contrary to the non-textured sub-image, the textured sub-image with over-enhancement may not influence the global transformation function. Hence, the combined global transformation function f(x,y) can ameliorate the over-enhancement. Subsequently, the new global transformation function f(x,y) is used to enhance the input image I by following equation.

3 Experimental results

The section demonstrates that the performance of the proposed novel enhancement method is better than the other four published state-of-the-art enhancement methods in the literature, including the POSHE [17], BBCHE [6], SECE [2], and AGCWD [13]. The reasons of comparing the proposed method with these methods are explained as below. The POSHE is a conventional local HE method for obtaining more discernible contrast, yet the computational complexity of the POSHE is high and the over- and under-enhancement will be generated. Our work is proposed to improve these drawbacks based on the POSHE method. To reduce the over- and under-enhancement, the BBCHE is then proposed to altering the significant and insufficient changes of the cdf. The BBCHE method can generate a linearly increasing curve to be the new cdf by using the bilateral Bezier curve, yet the ability of edge preservation will be influenced by the positions of selected control points. The comparison between BBCHE and proposed method shows that the contrast enhancement obtained by applying bilateral Bezier curve to the sub-images is better than applying bilateral Bezier curve to the whole image. Our method is proposed to improve the ability of edge preservation by combining all cdf modified by the bilateral Bezier curve and weighting process. To demonstrate the proposed method is better than those efficient HE method on video frame enhancement, two color image enhancement methods are compared in the experiments. First, the AGCWD method is presented to adjust the cdf with gamma correction for overcoming the over-enhancement and decreasing the time complexity. However, the AGCWD method may still eliminate edges on brighter regions of image when the cdf has significant and insufficient changes. Second, the SECE method is presented to generate a natural looking enhancement by using the spatial distribution of pixel grayscale, recently. However, the contrast enhancement of SECE is sensitive to the smoothed regions because of the extreme large entropy. Our proposed method dedicates an efficient strategy of a linearly increasing cdf generation to preserve the edges, thus the AGCWD and SECE are used for comparison. Because the proposed method also expects to generate a good image visualization, this method is included into our comparisons. All the methods are implemented by Borland C ++ Builder 6.0 in Windows 7 operating system and run on a standard PC with Intel(R) Core i5-2520M CPU and 4GB of RAM.

The contrast enhancement can be measured by three factors, such as the edge preservation, brightness preservation, and enhancement effect, thus the subjective evaluations, the mean opinion score and detailed examination, are utilized. Although a lot of quality assessment metrics of the contrast enhancement have been proposed, such as the edge loss rate (ELR) [28], absolutely mean brightness error (AMBE) [5], the contrast per pixel (CPP) [9], and enhancement performance measure (EME) [23], the measurement score cannot well demonstrate the performance of the HE method. For example, The CPP and EME measures the contrast within a windows of size 3 × 3, yet the scores of the enhanced image with over-enhancement will be larger than the other scores generated with the natural looking enhancement. The ELR is used to measure the number of eliminated pixels and the AMBE is calculated by averaging the intensity of whole image, but the image contents are not considered. Therefore, the detailed examinations and mean opinion score (MOS) are provided to verify the performance of the proposed and the other relevant methods in this work. The experimental results of eight representative images used for detailed examination are shown in Figs. 789101112131415161718192021 and 22, including Baboon, Barbara, Boat, Girl, House, Jet,Lena, and Pepper. Then, the KODAK test image database [19] is also employed to obtain the MOS. After combining the evaluation results of detailed examination and MOS, the experimental results show that the proposed method preserves the most amount of gradients, while obtaining the best visualization for the resultant images based on eight representative test images of size 512 × 512. In a nutshell, the proposed novel local HE method is quite competitive with four compared HE methods. The results of these comparisons will be explained in the following section. Finally, the average execution-time of the proposed method and various test methods is shown for comparison.

Fig. 7
figure 7

The magnified image Baboon a Original image. b POSHE. c BBCHE. d AGCWD. e SECE. f Proposed EPLHE

Fig. 8
figure 8

The magnified image Barbara. a Original image. b POSHE. c BBCHE. d AGCWD. e SECE. f Proposed EPLHE

Fig. 9
figure 9

The magnified image Boat. a Original image. b POSHE. c BBCHE. d AGCWD. e SECE. f Proposed EPLHE

Fig. 10
figure 10

The magnified image Girl. a Original image. b POSHE. c BBCHE. d AGCWD. e SECE. f Proposed EPLHE

Fig. 11
figure 11

The magnified image House. a Original image. b POSHE. c BBCHE. d AGCWD. e SECE. f Proposed EPLHE

Fig. 12
figure 12

The magnified image Jet. a Original image. b POSHE. c BBCHE. d AGCWD. e SECE. f Proposed EPLHE

Fig. 13
figure 13

The magnified image Lena. a Original image. b POSHE. c BBCHE. d AGCWD. e SECE. f Proposed EPLHE

Fig. 14
figure 14

The magnified image Pepper. a Original image. b POSHE. c BBCHE. d AGCWD. e SECE. f Proposed EPLHE

Fig. 15
figure 15

The enhanced image Baboon a Original image. b POSHE. c BBCHE. d AGCWD. e SECE. f Proposed EPLHE

Fig. 16
figure 16

The enhanced image Barbara. a Original image. b POSHE. c BBCHE. d AGCWD. e SECE. f Proposed EPLHE

Fig. 17
figure 17

The enhanced image Boat. a Original image. b POSHE. c BBCHE. d AGCWD. e SECE. f Proposed EPLHE

Fig. 18
figure 18

The enhanced image Girl. a Original image. b POSHE. c BBCHE. d AGCWD. e SECE. f Proposed EPLHE

Fig. 19
figure 19

The enhanced image House. a Original image. b POSHE. c BBCHE. d AGCWD. e SECE. f Proposed EPLHE

Fig. 20
figure 20

The enhanced image Jet. a Original image. b POSHE. c BBCHE. d AGCWD. e SECE. f Proposed EPLHE

Fig. 21
figure 21

The enhanced image Lena. a Original image. b POSHE. c BBCHE. d AGCWD. e SECE. f Proposed EPLHE

Fig. 22
figure 22

The enhanced image Pepper. a Original image. b POSHE. c BBCHE. d AGCWD. e SECE. f Proposed EPLHE

3.1 Qualitative comparisons

In this section, the comparisons of eight representative images, Baboon, Barbara, Boat, Girl, House, Jet,Lena, and Pepper, enhanced by the POSHE, BBCHE, AGCWD, SECE, and the proposed method respectively, are provided for detailed examination. For the details of examination, the magnified images are given to visualize the contrast enhancement as shown in Figs. 714. In addition, the mean opinion score (MOS) is used to verify the experimental results, and the enhancement results are shown in Figs. 1522, and the KODAK test image database [19] is also used for evaluations. The MOS is acquired from 39 volunteers which have simple background knowledge about image processing, and the volunteer were aged is in between 25–65 years and comprised 35 males and 4 females. The value of MOS is between 1 to 5, and 5 indicates the best visual effect of contrast enhancement. In our experiments, all subjects can observe the original input image in 2 min, and then five enhanced images arranged in the random order are given for measuring the MOS at the same time. In addition, each subject can give the same MOS to different enhanced images.

3.1.1 Detailed examination

The magnified image is generated by subtracting the original image from the enhanced image, and it is useful to examine the enhancement as shown in Figs. 714. In the magnified image, the brighter regions indicates the pixels have more contrast enhancement, and the darker regions may be under-enhanced. To examine the performance, the enhanced images and resultant pdf are shown in Figs. 1522.

For the first test image Baboon, the results are shown in Fig. 7. The original image has a lot of textures, and this image is very suitable to verify the contrast enhancement of all concerned methods on textured image. The enhancement result of the POSHE method is over-enhanced, especially in the areas around the eyes and the hair on the baboon’s cheek. The proposed method combines all generated transformation function, thus some inappropriate transformation functions with over enhancement will be refined by those with appropriate pixel changes to obtain a better contrast enhancement. The BBCHE method also over-enhances the hair of baboon’s chin because the cdf in this area has extreme significant changes. Although the BBCHE refines the cdf generated from the hair of baboon’s chin by using bilateral Bezier curve, the over enhancement is still appeared, as shown in Fig. 7c. The proposed method combines all transformation functions to generate a global transformation function to decrease the number of the sub-images with over- and under-enhancement, thus the resultant images seems to have a natural looking compared with the BBCHE. Then, the results of the AGCWD method has worst ability on brightness preservation, and this method may result in loss of details on bright regions of image when there are high peaks in the input histogram. According to the gamma correction curve, the luminance of middle of input pdf will have a lot of changes, thus the brighter region of input pdf will be squeezed, leading to edge elimination. For example, the hair of baboon’s cheek is unclear in Fig. 7d. The proposed method adoptively refines the cdf by employing bilateral Bezier curve and generates a combined transformation function to average those transformation functions with over- and under-enhancement. Next, it is observed the SECE method generates the over-enhancement on the baboon’s nose and hair of baboon’s chin because the entropy of the nose is very low as shown in Fig. 7e. Contrary to the SECE method, the proposed EPLHE method has better natural looking on the baboon’s nose and hair of baboon’s chin because the transformation function of these areas have been weighted and refined.

For the second test image Barbara, the results are shown in Fig. 8. The image Barbara has grid structure on her kerchief, and this is a good image for testing the HE method will abnormally increase the noises or not. In Fig. 8b, the enhancement results of the POSHE method have problems of over- and under-enhancement, e.g., the leg of the table and Barbara’s arm, respectively. The result of the BBCHE is similar to the proposed EPLHE method because all sub-images of this image Barbara are rich. The BBCHE method has a good ability to deal with the sub-images with slightly over-enhancement, but the under-enhancement will be a problem in BBCHE because the modified curve is contained in the convex hull of the selected control points. Similar to the result of image Baboon, the AGCWD method cannot well preserve the mean brightness because of gamma correction curve. Obviously, the wall in the upper left of the image and leg of the table are under-enhancement, and the edges behind Barbara are eliminated. The histogram equalization with gamma correction will generate brighter image as shown in Fig. 8d, but not a natural looking image. The proposed method can preserve mean brightness of the original image. Then, it is observed that there has a noise addition problem in SECE method as shown in Fig. 8e because of the spatial information of pixels. The entropy of the the grid structure in the sub-image is extreme high, thus the noises will be enlarged.

For the third test image Boat, the results are shown in Fig. 9. The difference between the brighter and darker regions in the original image is significant so that the artifact, ringing effect, will be easily produced. It is observed that the over-enhancement is produced by POSHE on trees, lake, and forest because the contrast of these regions is strong and the tree enhanced by the POSHE in the right side of the image looks unnatural, a half dark a half bright. The main problem of BBCHE is under-enhancement, thus the texture of cloud is not enhanced. The proposed method can alter the transformation function by weighting process to increase contrast enhancement on cloud of the image. Due to the gamma correction, the enhanced image looks unnatural and is too bright. Finally, the clouds and lake are under-enhanced because the entropy of these areas are extreme low, and some noises of the trees will be appeared by the SECE method.

Subsequently, for the test image Girl, the results are shown in Fig. 10. The original image is bright and less contrasty, thus it is easy to produce the over-enhancement results on this kind of image. Therefore, the POSHE method generates the heavy over-enhancement because of steep cdf caused by less contrasty, especially on the skin of girl’s face and hands. The contrast enhancement of the BBCHE and proposed EPLHE is similar, but the enhancement result of the forehead by the proposed EPLHE method is slighter than the BBCHE method. Because the textures of all sub-images are almost the same and all transformation functions are similar, the combined global transformation function has its own limits on contrast enhancement so that the performance of BBCHE and proposed method are similar. Although the magnified image of the AGCWD method looks more natural than the other compared methods, the mean brightness is heavily shifted, leading to some undesirable artifacts, e.g. edge elimination. Next, after applying the SECE method, the image contrast is barely changed because the entropy of each luminance is almost the same, leading to the edge elimination. The textured regions, e.g., nostril and the areas nearby the right ear, are well enhanced.

For the test image House, the results are shown in Fig. 11. The vehicle, the greensward, and the tree between the roof and sky are all over-enhanced by the POSHE method because the textures of vehicle and sky are all smoothed. The contrast enhancement of the BBCHE and proposed methods are similar besides the roof, the cloud, and the trees between the roof and sky. Next, it is observed that the contrast of the road in the lower of the image and the car are under-enhanced by the AGCWD and SECE methods because of the less contrasty and low entropy.

Next, for the test image Jet, the results are shown in Fig. 12. The non-textured regions, e.g., clouds, has significant cdf, leading to unnatural looking enhancement, thus this image is chosen to be the representative image. The brightness of the mountains and clouds is significantly changed by the POSHE and BBCHE method, respectively, because of the less contrasty. Then, the contrast of the clouds and mountains are not well enhanced by the AGCWD method because the AGCWD method adopts the gamma correction to create a linearly increasing curve to enhance the contrast. If the luminance of the image is high, the curve change of the gamma correction is small, leading to obscure enhanced image. Similar to the AGCWD method, the SECE method has bad contrast enhancement on the background of this image because the proportion of the entropy of each gray level is improper and too small. Contrary to these two methods, the proposed EPLHE generates more distinguishable contrast and natural looking enhancement on the clouds. In addition, the contrast of the letters, “F16” and “U.S.AIR FORCE”, and the aircraft enhanced by the proposed method are more clear than those of the POSHE and BBCHE, respectively.

For the test image Lena, the results are shown in Fig. 13. Lena is a classic image for image processing, hence it is used for assessment. The face, hat, and mirror in the input image are over-enhanced by the POSHE method. Although the enhancement results between the BBCHE and proposed EPLHE methods is competitive. It is observed that the proposed EPLHE has better enhancement effect on the hair. As mentioned above, the BBCHE has failed to deal with the problem of under-enhancement, thus the contrast enhancement of the hair is indistinct. The AGCWD method produces brighter enhanced image and unnatural looking on Lena’s face, although it achieves the best contrast enhancement on hair. The SECE method generates a lot of noises on the hair because of the large entropy, and the contrast of Lena’s face and shoulders are not stretched.

For the last test image Pepper, the results are shown in Fig. 14. The contrast of this image is good enough so that it is employed to examine the compared methods will generate unpleasing artifacts or not. Although the pdf of the input image is uniform, the POSHE method also has a little over-enhancement on the eggplant. Obviously, the proposed method provides more contrast enhancement on the input image than the BBCHE method as shown in Fig. 14c and f because the proposed weighted transformation function has more ability on providing contrast enhancement than original one in each sub-image. The contrast enhancement of the AGCWD and SECE methods is slightly over-enhanced, and the mean brightness has been greatly changed. Although brighter luminance will make color image more colorful visually, the changed brightness will cause the edge elimination.

The proposed method has better ability of brightness and edge preservations and produces less artifacts according to the detailed examination. In addition, the enhanced images by the proposed method looks more natural by subjective evaluations. In a nutshell, the proposed method is quite competitive to the other four state-of-the-art HE methods.

3.1.2 Mean opinion score

In this section, 39 volunteer subjects were invited to assess the performance of the proposed HE method and the other four compared methods, and the MOS is then implemented according to their evaluations. The subjects were asked to set a numerical indication of the perceived quality for each enhanced image, eight representative images are shown in Figs. 1522. In addition, the MOS is presented as a number in the range 1 to 5, where 1 is lowest quality and 5 is the highest quality. Table 1 shows the the average MOS of each method evaluated by 39 subjects for eight representative images and KODAK test image database [19]. Obviously, the proposed EPLHE method achieves better image visualization of contrast enhancement because of the higher average MOS. Yet, for the image Girl, the subjects prefer the contrast enhancement of the girl’s face generated by the SECE method. For the test image Pepper, the MOS of the BBCHE method is the same with the proposed EPLHE method because the subjects cannot visually tell the differences. In a nutshell, the proposed EPLHE method achieves an appropriate enhancement effect and low computation cost for the natural images.

Table 1 Performance comparisons among five methods in terms of mean opinion score (MOS)

3.2 Comparison of execution time

The comparison of the computational complexity between the proposed method and compared methods is shown in Table 2. The average execution-time of the proposed method is around 0.046 s, and it is observed that the time complexity of the proposed method is more complicate than the BBCHE and AGCWD because the local HE method is adopted to generate various cdf. Then, the overlapped sub-image and entropy calculation consumes a little time, leading to the high time complexity of the POSHE and SECE methods, respectively. In a nutshell, the concern methods can be used in the practical applications because their computational complexity is all acceptable. Although the execution time of the BBCHE and AGCWD is smaller than ours, the proposed method may not produce the undesirable artifacts. Consequently, considering the performance of the contrast enhancement, the proposed method is quite competitive and more practical for the real commercial market.

Table 2 Average execution time among five methods

4 Conclusions

In this paper, a novel local histogram equalization method is proposed by modifying the cumulative distribution functions of the non-overlapped sub-images and then combining all cumulative distribution functions with a weighting process for the edge preservation and natural looking enhancement. The input image is first divided into the non-overlapped sub-images with the simple partition strategy for decreasing the time complexity. Then, to obtain more discernible contrast of the enhanced image, the local histogram equalization method is used to create the cumulative distribution functions of every non-overlapped sub-images. Then, the cumulative distribution of each sub-image is modified according to the bilateral Bezier curve to reduce the over- and under-enhancement. However, some sub-images still suffers from the edge elimination because of the significant and insufficient changes of the cumulative distribution. Therefore, the proportion of gradients in the sub-images is calculated and collected to generate a set of weights, and all cumulative distribution functions is summed up based on these weights to generate a global transformation function. The key contributions of this work are two-fold. First, the proposed method employs a simple image partition strategy to separate input image into several non-overlapped sub-images for decreasing the time consumption. Second, the proposed method combines all modified cumulative distribution functions with a proposed weighting process to deal with the problem of edge elimination caused by the cumulative distribution with the significant and insufficient changes. Based on eight representative test images, published database, and two kinds of subjective evaluations, the experimental results demonstrate that the proposed method achieves better contrast enhancement and reasonable computational complexity compared with other four well-known histogram equalization methods. Future endeavor can be put to distinguish the noises from the detected edge information to avoid over-enhancement the unwanted gradients and apply the proposed method to the color image, while considering the chromatology.