Abstract
Histogram equalization is one of the basic image processing tasks for contrast enhancement, and its generalized version is histogram specification, which accepts arbitrary shapes of target histograms including uniform distributions for histogram equalization. It is well known that strictly ordered pixels in an image can be voted to any target histogram to achieve exact histogram specification. This paper proposes a method for ordering pixels in an image on the basis of the local contrast of each pixel, where a Gaussian filter without approximation is used to avoid the duplication of pixel values that disturbs the strict pixel ordering. The main idea of the proposed method is that the problem of pixel ordering is divided into small subproblems which can be solved separately, and then the results are merged into one sequence of all ordered pixels. Moreover, the proposed method is extended from grayscale images to color ones in a consistent manner. Experimental results show that the state-of-the-art histogram specification method occasionally produces false patterns, which are alleviated by the proposed method. Those results demonstrate the effectiveness of the proposed method for exact histogram specification.
1. Introduction
Histograms represent the distribution of pixel values in images, and can offer various image statistics [1] to us, i.e., histograms have useful information for image processing applications such as image enhancement, compression, and segmentation [2,3,4]. Therefore, histograms are the basis for numerous spatial domain processing techniques [5], which include intensity transformation as a special case where the smallest neighborhood of size is used. Histogram equalization, which theoretically transforms an input image into the corresponding output image having a uniform histogram, is one of the intensity transformation techniques for contrast enhancement [5]. More generally, the method for generating an output image that has a specified target histogram is called histogram specification or histogram matching [5], in which histogram equalization is included as a special case [6]. It is pointed out that histogram equalization may cause over enhancement [7]. In such situations, histogram specification will be a good candidate for substitute methods because it accepts any shape of histograms. In this paper, although we would like to use a Gaussian distribution constantly for the target histogram in histogram specification to simplify our explanation, other choices such as bimodal or multimodal distribution may work well.
For digital images that are composed of pixels with quantized values, it is usual that the number of pixels in an image is greater than the number of possible quantized pixel values. Therefore, there are a large number of pixels that share the same quantized pixel value in a digital image, which means that exact histogram specification for digital images is an ill-posed problem [8]. For the effective utilization of all possible quantized pixel values and the suppression of the occurrence of false contours, a number of research works have been conducted for more than four decades since Hall published his work on discrete distribution transformation [9]. In addition to these technical needs, it is our genuine curiosity to make and see exactly histogram-equalized or specified images because the solution of the ill-posed problem is not unique. A promising approach to exact histogram specification is to obtain a meaningful strict ordering of all pixels in an image. Once we obtain the ordering of pixels, we can assign a limited number of pixel values to the ordered pixels so that the resultant histogram coincides with a specified target histogram.
The simplest way of pixel ordering is random ordering [10]. However, the random ordering is not a meaningful ordering. Coltuc et al. [11] described the process of exact histogram specification when a strict ordering is given, and proposed an ordering method, which is called the local mean method (LM), based on a filter bank of multiple moving average filters. Wan and Shi [12] proposed a wavelet-based exact pixel ordering algorithm (WA) for both exact histogram specification and image enhancement, which takes into account not only local mean intensity values, but also local edge information. Nikolova and Steidl [13] proposed a fast ordering algorithm for exact histogram specification based on a variational approach, which is equivalent to an iterative nonlinear filtering, and demonstrated that their variational ordering method outperforms both LM [11] and WA [12]. They also applied their algorithm to hue and range preserving enhancement of color images [14], where the histogram of an intensity image is exactly equalized or specified, and then an affine transform is applied to each color in a hue and range preserving manner.
In this paper, we propose a local contrast-based pixel ordering method for exact histogram specification, which computes the local contrast of each pixel by using a Gaussian filter [15] without approximation, and compare the proposed method with the state-of-the-art method by Nikolova and Steidl [13]. Furthermore, the proposed method for grayscale images is extended to that for color images in a consistent manner. Experimental results demonstrate that Nikolova and Steidl’s method can produce false patterns in flat areas of images, which are alleviated by the proposed method. For color images, it is experimentally shown that the proposed method outputs exactly histogram-equalized or specified images with closer hue to original images than that obtained by a separable method that utilizes Nikolova and Steidl’s method for exact histogram equalization and specification of each color channel. These results demonstrate the effectiveness of the proposed method compared with the state-of-the-art method.
The rest of this paper is organized as follows: Section 2 provides a brief review of some related works. Section 3 briefly summarizes conventional histogram equalization. Section 4 summarizes conventional histogram specification and Nikolova and Steidl’s exact histogram specification [13]. Section 5 proposes a local contrast-based exact histogram specification method, which is extended to that for color images. Section 6 shows experimental results, where the proposed method is compared with the state-of-the-art methods by Nikolova and Steidl [13] and Ramos et al. [16]. Finally, Section 7 concludes this paper.
2. Related Work
In this section, we review recent related works on histogram equalization and specification. Recently, Pallavi et al. [17] reviewed state-of-the-art techniques for image enhancement, in which the techniques of histogram equalization are also included such as contrast limited adaptive histogram equalization (CLAHE) [18] and brightness preserving bi-histogram equalization (BBHE) [19]. Trongtirakul and Agaian [20] proposed a weighted histogram equalization using entropy of probability density function, which outperformed related methods including a low-rank regularized retinex model (LR3M) [21]. More recently, Zhang et al. [22] proposed an unsupervised low-light image enhancement method via a histogram equalization prior (HEP) based on the observation that the feature maps of histogram equalization enhanced image and the ground truth are similar.
Hussain et al. [23] proposed a locally transformed histogram-based technique for dark image enhancement, which does not get affected from the over-enhancement problem. Balado [24] examined an optimum exact histogram specification problem and the inverse problem, and presented their closed-form performance analyses. Ramos et al. [16] proposed two algorithms for histogram specification and quantile transformation of data without local information. As one of the state-of-the-art algorithms for histogram specification, we implemented the first algorithm of Ramos et al. in this paper as described below. However, their algorithm does not produce an output image having the histogram being exactly identical to the target one.
The above review of recent related works draws a conclusion that Nikolova and Steidl’s algorithm [13] is still one of the state-of-the-art algorithms for exact histogram specification.
3. Histogram Equalization
Let be a grayscale image for and , where denotes the pixel value at the position on the image plane with m rows and n columns. The maximum pixel value L is typically given by in an 8-bit grayscale. Then, the histogram of the pixel values in F is given by whose kth element is computed by
for where denotes the Kronecker delta function defined by for , and 1 for . Note that the histogram is not normalized, i.e., . The corresponding cumulative histogram is given by whose lth element is defined by
for and recursively computed by for with . Histogram equalization converts a pixel value into
where , and the ‘round’ operator rounds a given argument toward the nearest integer, and denotes the function of converting pixel values in histogram equalization.
Figure 1 shows an example of histogram equalization, where an original image in Figure 1a is converted into the image in Figure 1d, and their histograms and cumulative ones are shown in Figure 1b,c and Figure 1e,f, respectively, where the horizontal axis of each graphic denotes the pixel value ranging from 0 to 255, and the vertical axis denotes the (cumulative) number of pixels for each (cumulative) histogram. As shown in Figure 1e, the resultant histogram is not equalized actually, but the cumulative one is linearized as shown in Figure 1f. That is, to be more precise, the conventional histogram equalization is a cumulative histogram linearization.
Figure 1.
Histogram equalization: (a) an original image with pixels; (b) the histogram of the original image; (c) the cumulative histogram of the original image; (d) the histogram-equalized image; (e) the histogram of the image in (d); (f) the cumulative histogram of the image in (d).
4. Histogram Specification
In this section, we summarize conventional histogram specification, which is not an exact method, and then briefly summarize the state-of-the-art method for exact histogram specification by Nikolova and Steidl [13]. After that, we propose a local contrast-based method for exact histogram specification, whose objects to be processed are extended from grayscale images to color images.
4.1. Conventional Histogram Specification
Let be a target histogram into which we want to convert the histogram of the original image F, where we assume that for convenience. Then, we can compute the cumulative histogram from in the same manner as above. Theoretically, we can describe the relationship between the target histogram and the original one as
where denotes the output pixel value of histogram specification corresponding to an input pixel value , and denotes the inverse function of which equalizes the target histogram . However, in the digital condition, the functions and become staircase functions, which are not bijective. Therefore, they have no inverse functions.
A prescription for this situation may be the use of linear interpolation as follows: Assume that for , where we define that . Then, we can determine the output pixel value of histogram specification by
corresponding to an input pixel value .
Figure 2 shows an example of histogram specification, where the resultant image in Figure 2a is obtained with a Gaussian target histogram with mean and standard deviation 50 from the original image in Figure 1a. Figure 2b shows the obtained histogram, which is not Gaussian, but the cumulative one fits into the target cumulative histogram as shown in Figure 2c, where a blue solid line denotes the target one, and the yellow dashed line denotes the obtained one. That is, to be more precise, the conventional histogram specification is a cumulative histogram specification.
Figure 2.
Histogram specification: (a) histogram-specified image computed from the original image in Figure 1a with a Gaussian target histogram; (b) the histogram of the image (a); (c) the target (blue solid line) and obtained (yellow dashed line) cumulative histograms.
4.2. Nikolova and Steidl’s Method
In this subsection, we briefly summarize Nikolova and Steidl’s fast ordering algorithm for exact histogram specification [13]. They proposed a fixed point algorithm that attains the minimizer of fully smoothed -TV (total variation) functional as follows:
where , is the vectorization [25] of F where the superscript T denotes the matrix transpose [26], denotes the th component of with , where denotes the set of real numbers, and G is a forward difference operator given by
where ⊗ denotes the Kronecker product, is the identity matrix, denotes the forward difference matrix defined by
and the function is defined by
with a constant , which is a smooth approximation of norm, and has the derivative . The inverse function of is defined by , whose derivative is given by . These functions are illustrated in Figure 3, where blue lines denote the functions for norm, and orange lines denote their smooth approximations.
Figure 3.
Nikolova and Steidl’s smooth approximation of norm: (a) norm denoted by a blue line is smoothly approximated by denoted by an orange line; (b) the derivatives of norm and ; (c) the inverse functions of norm and , which is denoted by ; (d) the derivatives of the inverse functions.
From where means the th element of G, we have for , which are combined into a vector equation as , where the functions and are applied to each element of their arguments. This is a fixed point equation for which gives rise to a fixed point algorithm for minimizing as described in Algorithm 1.
| Algorithm 1 Fully smoothed -TV minimization algorithm [13] |
|
In this algorithm, we set and according to Nikolova and Steidl [13]. The obtained image from with the input image in Figure 1a is shown in Figure 4a. This procedure for computing from can be viewed as a nonlinear filter which reduces the quantization noise in slightly. Therefore, the image in Figure 4a is very close to that in Figure 1a. The pixel values in can be ordered in a strict way with a high probability [8].
Figure 4.
Nikolova and Steidl’s exact histogram specification: (a) the output of Algorithm 1 is visualized as an 8-bit grayscale image; (b) the output image; (c) Gaussian target (blue solid line) and obtained (yellow dashed line) histograms.
Assume that the pixel values in are ordered in ascending order: where for denote the ordered indices, and the cumulative histogram is computed from a given target histogram . Then, if with for an index and a pixel value l, then the corresponding output pixel value is given by , where denotes the pixel position corresponding to the ordered index , i.e., with is satisfied. This procedure is repeated for to obtain Nikolova and Steidl’s output image . Figure 4b shows the output image with the same Gaussian target histogram as Figure 2, and Figure 4c shows the target and obtained histograms, where we can see that they have the same Gaussian shape, which demonstrates the exactness of Nikolova and Steidl’s method.
5. Proposed Method
In this section, we propose a local contrast-based pixel ordering method for exact histogram specification. We first describe the method for grayscale images, and then it is extended to that for color images. We also give a complexity analysis of the proposed method. The main idea of our approach is that the problem of pixel ordering can be divided into 256 subproblems for an 8-bit grayscale image. We solve the downsized subproblems separately to have 256 groups of ordered pixels, and then concatenate them to have a sequence of all ordered pixels.
5.1. Local Contrast-Based Exact Histogram Specification for Grayscale Images
As demonstrated above, we can transform the histogram of a digital image into the specified one, when all pixels in the image are ordered in a strict and faithful way [13]. In most cases, pixels in a digital image take a limited number of discrete values, e.g., 256 values are available for 8-bit grayscale images, which is smaller than the number of pixels in the image, e.g., for the above image in Figure 1a. Therefore, many pixels share the same pixel value with each other in the image, and the ordering of the pixels with the same values becomes an ill-posed problem [8]. However, it is fortunate for us that we have a rough ordering of 256 groups of pixels in the image, which means that the entire pixel ordering problem can be divided into 256 subproblems that can be solved separately. In this subsection, we propose a method for ordering pixels in each group on the basis of the local contrast of each pixel, and then the separately ordered subgroups are finally merged into an entire pixel ordering.
The first step of the proposed method is Gaussian filtering without approximation, which means that the weighted mean of all pixels is outputted at each pixel, where the weights are given by a Gaussian function as follows:
for and , where denotes the standard deviation positive constant. Let be an matrix which expresses the Gaussian-filtered image of F. Then, we can compute by the following matrix operations. The numerator of (10) is computed by
where the left matrix is given by with
where ⊙ denotes the Hadamard product or elementwise product of matrices, and denotes the m-dimensional column vector of ones. Similarly, the right matrix in (11) is given by with
On the other hand, the denominator of (10) is computed by
where E denotes the matrix of ones. Then, we have the Gaussian-filtered image by , where ⊘ denotes the Hadamard division or elementwise division of matrices.
Next, we define the local contrast (LC) of each pixel by which is added to the corresponding pixel as an attribute, and divide the pixels in F into groups as , where we have that for , i.e., is the cardinality of . Then, we sort the elements of in the ascending order of for , and concatenate them to have a sequence. As a result, we expect to have the entire pixel ordering for , from which the corresponding pixel position is given as the integer part and remainder of the division , i.e., , and is ordered as follows:
For exact histogram specification, we would like to have a strict ordering as described in (15). That is, for different pixels with the same pixel value as with or , it is expected that or . For conventional Gaussian filters with finite kernel sizes such as and pixels, the lower bounds of the probability of are . However, some symmetric patterns may result in the case of accidentally. To reduce the probability of such cases, we adopt the Gaussian filter with sufficiently large kernel size as described in (10).
For an input image F with a target histogram and its cumulative version , the proposed method outputs a histogram-specified image , where each pixel value is given by for the index satisfying with as well as Nikolova and Steidl’s method summarized in Section 4.2. The proposed method is summarized in Algorithm 2.
| Algorithm 2 Local contrast-based exact histogram specification |
|
Additionally, we can make an image whose pixel values indicate ordered numbers as , where each pixel value is given by for . For histogram equalization, the number of pixels to which the same pixel value is assigned is given by , where denotes the floor function that gives the largest integer less than or equal to x [27]. That is, we make a target histogram as for . However, the truncation by the floor function may cause the shortage of total amount in the histogram: . To cover the shortage, if , then we add 1 to to have . This modified histogram can be inputted to Algorithm 2 as a target histogram for exact histogram equalization.
Figure 5 shows the results of the proposed method, where Figure 5a,b show the results of the histogram equalization and specification with for the original image in Figure 1a, respectively, and Figure 5c shows their histograms, where we can see that both exact histogram equalization and specification are achieved.
Figure 5.
Exact histogram equalization and specification: (a) histogram-equalized image of the original image in Figure 1a; (b) the histogram-specified image with a Gaussian target histogram; (c) equalized (blue line) and specified (orange line) histograms.
5.2. Extension to Color Images
In this subsection, we extend the above proposed method for grayscale images to color images. Let be an RGB color image, where denotes the RGB color vector of the th pixel in C, and for and 3. Then, we make a histogram into which all RGB values in C are united as follows:
Figure 6.
Color image and its histogram: (a) an RGB color image with pixels; (b) the histogram of the color image (a).
The first step of our exact histogram specification is Gaussian filtering applied to each color channel in C. Let be the resultant image, where denotes the RGB color vector of each pixel in . Then, we compute the LC as where , each element of which is added to the corresponding element of the corresponding pixel as an attribute: for and , and divide them into groups as , where we have that for . Then, we sort the elements of in the ascending order of for , and concatenate them to have a sequence. As a result, we expect to have the entire element ordering for , each of which is connected with the corresponding pixel position and channel number by satisfying
Let be a target histogram with the cumulative one . Then, the histogram-specified image is given by with for the index satisfying with . This procedure for color images is summarized in Algorithm 3.
| Algorithm 3 Local contrast-based exact histogram specification for color images |
|
Figure 7 shows the results of the proposed method for color images, where Figure 7a,b show the results of the histogram equalization and specification with for the original color image in Figure 6a, respectively, and Figure 7c shows their histograms, where we can also see that both exact histogram equalization and specification are achieved.
Figure 7.
Exact histogram equalization and specification for a color image: (a) histogram-equalized image of the original color image in Figure 6a; (b) the histogram-specified image with a Gaussian target histogram; (c) equalized (blue line) and specified (orange line) histograms.
5.3. Complexity Analysis
In this subsection, we analyze the complexity of the proposed method in Algorithm 2. Let be the input size. The computation of Gaussian filtering in line 1 is described as matrix calculations. The time complexity of the numerator (11) is estimated as , which is the same as that of the denominator (14). The Hadamard division requires N elementwise divisions. Then, the order of time complexity of Gaussian filtering is . The next main procedure is sort in line 6, which is repeated times. Assume that the cardinality is on average. Then, the time complexity of the sorting procedure is estimated as from which we have . The time complexity of the remaining procedures is bounded by . Consequently, the time complexity of the proposed method is given by .
The space complexities of images , and are , and that of groups for in line 3 is also . Histogram arrays and require . Selecting the largest one, we can see that the space complexity of the proposed method is .
6. Experimental Results
In this section, we show experimental results in comparison with Nikolova and Steidl’s method [13]. First, we show the results with a synthetic input image shown in Figure 8a. Nikolova and Steidl’s method summarized in Section 4.2 outputs the image in Figure 8b, where we can see that vertical stripes appear in the flat areas in the original image. As a result, Nikolova and Steidl’s method achieves the equalized histogram shown in Figure 8c. Figure 8d shows the horizontal profile of the output image in Figure 8b, where the vertical and horizontal axes denote the pixel value and the column index j, respectively. Although the pixel values fluctuate with small steps, the pixel values on the left side are larger than that on the right side as well as the original image.
Figure 8.
Nikolova and Steidl’s exact histogram equalization: (a) input image with pixels, where the dark and bright areas have pixel values 100 and 200, respectively. (b) vertical stripes are generated in the output image; (c) the obtained histogram confirms that Nikolova and Steidl’s method exactly equalizes the histogram; (d) horizontal profile in (b) shows the fluctuation of pixel values, but it preserves the original ordering in (a).
Figure 9 shows the results of the proposed method described in Section 5, where Figure 9a,b show the output images of exact histogram equalization and specification with the Gaussian target histogram used in the previous section. Their histograms are shown in Figure 9c. The proposed method enhances the edge in the center of the input image in Figure 8a, and does not produce the pseudo-stripes observed in Figure 8b that are graphically confirmed by the horizontal profiles in Figure 9d.
Figure 9.
Exact histogram equalization and specification by the proposed method: (a) histogram-equalized image has the enhanced central edge; (b) histogram-specified image also has the enhanced edge; (c) histograms of the output images in (a,b) are equalized and specified to be Gaussian, respectively; (d) horizontal profiles in (a,b) have no fluctuation observed in Figure 8d.
Next, we compare the ability in strict ordering by Nikolova and Steidl’s and the proposed methods. Figure 10 compares the filter outputs used in the two methods with the input image in Figure 1a. Nikolova and Steidl’s filter in Algorithm 1 outputs , the values in which are sorted in ascending order in Figure 10a where the vertical and horizontal axes denote the pixel value and index, respectively. The differences between the neighboring pixel values in Figure 10a are very small, and therefore, we take the logarithm of them as shown in Figure 10b. Similarly, we sort the values of the output of the Gaussian filter in (10) as shown in Figure 10c, and take the logarithm of the difference values in Figure 10c as shown in Figure 10d, where we can see that the minimum value is greater than that in Figure 10c, which is preferable for strict ordering because the larger the difference is, the clearer the ordering is. The minimum values of the differences without taking logarithm are and for Figure 10b,d, respectively.
Figure 10.
Comparison of filter outputs and : (a) The values in the output in Algorithm 1 visualized in Figure 4a are sorted in ascending order. (b) The values of for are plotted. (c) The values of the output of the Gaussian filter in (10) with are sorted in ascending order. (d) The logarithm of the difference of the sorted values in (c) are plotted.
The proposed method has a parameter in (10), the effect of which is investigated in Figure 11a, where the vertical and horizontal axes denote the minimum difference in the sorted output values of the Gaussian filter and the parameter , respectively, for the input image in Figure 1a. In this figure, although we cannot find clear tendency of the minimum difference as a function of , the obtained difference values are larger than that of given by Algorithm 1 that exemplifies the insensitivity of the proposed method to . Figure 11b,c show the results of histogram equalization with and 70, respectively. These images demonstrate that the proposed method is insensitive to the values of parameter .
Figure 11.
Insensitivity to parameter : (a) the minimum difference in the sorted values of as a function of . The positive values mean that there are no pixels with the same pixel value in Gaussian-filtered image , from which we have a strict ordering; (b) histogram equalization with ; (c) histogram equalization with .
We investigate the limitation of the proposed method on the value of . Figure 12 shows the results of histogram equalization for the input image in Figure 8a, where Figure 12a,b correspond to and , respectively. Figure 12a is similar to Figure 9a. However, in Figure 12b, we observe an artifact. As a result, we estimate that the limitation of the value of exists between and , and recommend using the value of smaller than .
Figure 12.
Histogram equalization by the proposed method with relatively large values of : (a) No artifact is generated with . (b) An artifact is generated with .
Figure 13 shows twelve grayscale images in the Standard Image Data-BAse (SIDBA) [28], which are enhanced by Nikolova and Steidl’s exact histogram equalization as shown in Figure 14, where the contrast of all images is enhanced well because the histogram of each image is exactly equalized.
Figure 13.
Grayscale images in the SIDBA image dataset [28]: (a) Airplane, (b) Barbara, (c) Boat, (d) Bridge, (e) Building, (f) Cameraman, (g) Girl, (h) Lax, (i) Lenna, (j) Lighthouse, (k) Text, (l) Woman.
Figure 14.
Nikolova and Steidl’s exact histogram equalization: (a) Airplane, (b) Barbara, (c) Boat, (d) Bridge, (e) Building, (f) Cameraman, (g) Girl, (h) Lax, (i) Lenna, (j) Lighthouse, (k) Text, (l) Woman.
Similarly, Figure 15 shows the results by the proposed method, which also equalizes the histogram of each image exactly. Therefore, the output images of both methods are similar to each other.
Figure 15.
The proposed exact histogram equalization: (a) Airplane, (b) Barbara, (c) Boat, (d) Bridge, (e) Building, (f) Cameraman, (g) Girl, (h) Lax, (i) Lenna, (j) Lighthouse, (k) Text, (l) Woman.
Figure 16a shows the root mean squared error (RMSE) between Nikolova and Steidl’s output image and the corresponding output image by the proposed method, where “Text” image shown in (b) get the largest RMSE value, but the difference is small as visualized in (c), where error-free pixels have the neutral gray value 127.
Figure 16.
Comparison between Figure 14 and Figure 15: (a) RMSEs of twelve grayscale images; (b) The “Text” image obtains the largest RMSE value in (a); (c) Difference from the neutral gray indicates the difference between Nikolova and Steidl’s and the proposed methods. (a) Root mean squared error; (b) Text (identical to Figure 13k); (c) Difference image.
We also compare the results of exact histogram specification with the Gaussian target histogram, which are shown in Figure 17 and Figure 18 for Nikolova and Steidl’s and the proposed methods, respectively. In Figure 17, we observe that the obtained contrast is not so high as that of Figure 14 because the Gaussian target histogram suppresses the numbers of extremely dark and bright pixels, and assigns many pixel values to middle-range gray pixels. As a result, the dynamic range of gray pixels is boosted relatively. The output images in Figure 18 have a similar tendency to that in Figure 17 because the proposed method also obtains an exact Gaussian target histogram as well as Nikolova and Steidl’s method.
Figure 17.
Nikolova and Steidl’s exact histogram specification: (a) Airplane, (b) Barbara, (c) Boat, (d) Bridge, (e) Building, (f) Cameraman, (g) Girl, (h) Lax, (i) Lenna, (j) Lighthouse, (k) Text, (l) Woman.
Figure 18.
The proposed exact histogram specification: (a) Airplane, (b) Barbara, (c) Boat, (d) Bridge, (e) Building, (f) Cameraman, (g) Girl, (h) Lax, (i) Lenna, (j) Lighthouse, (k) Text, (l) Woman.
Figure 19a shows the RMSE between the corresponding output images in Figure 17 and Figure 18, where three images “Bui.”, “Lig.” and “Tex.” have relatively large RMSE values. We can find the differences at the bottom of those images as shown in Figure 19b, where the bottom areas of “Bui.”, “Lig.” and “Tex.” are arranged from top to bottom. The corresponding results by Nikolova and Steidl’s and the proposed methods are shown in Figure 19c and Figure 19d, respectively, where we can see artifacts in (c) similar to that in Figure 8b. On the other hand, Figure 19d has no such artifacts.
Figure 19.
Comparison between Figure 17 and Figure 18: (a) RMSEs of twelve grayscale images; (b) The bottom areas of the original “Bui.”, “Lig.” and “Tex.” images are arranged from top to bottom; (c) the same parts of the results by Nikolova and Steidl’s method; (d) the same parts of the results by the proposed methods.
Figure 20 shows twelve color images in the SIDBA image dataset [28], which are enhanced by a separable histogram equalization that applies Nikolova and Steidl’s exact histogram equalization algorithm to each color channel separately as shown in Figure 21, where we can see that the contrast of every image is enhanced, but the hue has changed from the original images in Figure 20.
Figure 20.
Color images in the SIDBA image dataset [28]: (a) Aerial, (b) Airplane, (c) Balloon, (d) Couple, (e) Earth, (f) Girl, (g) Lenna, (h) Mandrill, (i) Milkdrop, (j) Parrots, (k) Peppers, (l) Sailboat.
Figure 21.
Results of separable histogram equalization with Nikolova and Steidl’s exact histogram equalization algorithm.
Figure 22 shows the results from the proposed histogram equalization method described in Section 5.2, where we can see that the hue of each image is closer to the original one than that in Figure 21.
Figure 22.
Results of the proposed exact histogram equalization.
Figure 23 shows the RMSE of hue of each output image from the corresponding original image, where the vertical and horizontal axes denote the RMSE value and the images, respectively, and the blue and orange bars denote the separable and proposed methods, from which we observe that the proposed method preserves the original hue better than the separable method.
Figure 24 shows the results of a separable histogram specification that applies Nikolova and Steidl’s exact histogram specification algorithm to each color channel separately. Similarly to the above results of histogram equalization in Figure 21, here we can see the hue change from the original images.
Figure 24.
Results of the separable histogram specification with Nikolova and Steidl’s exact histogram specification algorithm.
On the other hand, Figure 25 shows the results by the proposed histogram specification method, where we can also see that the hue of each image is closer to the original one than that in Figure 24.
Figure 25.
Results of the proposed exact histogram specification.
Figure 26 shows the RMSE of hue of each output image from the corresponding original image, from which we also observe that the proposed method preserves the original hue better than the separable method.
The above experimental results demonstrate the effectiveness of the proposed local contrast-based pixel ordering method for exact histogram equalization and specification compared with the state-of-the-art method by Nikolova and Steidl [13]. A drawback of Nikolova and Steidl’s algorithm observed in Figure 8b, where a stripe pattern occurred on flat areas, may be a newfound phenomenon. The proposed method can avoid the occurrence of such false patterns.
In the above experiments, although we used a Gaussian target histogram for histogram specification constantly, we can choose other candidates such as multimodal distributions without any problems.
For the implementation of Nikolova and Steidl’s algorithm described in Algorithm 1, we need to use sparse matrices even if the input image is not so large, e.g., the original image in Figure 1a with pixels because the difference operator G in (7) becomes a very large matrix with elements. On the other hand, the proposed method can be implemented without sparse matrices.
Additionally, we implemented Ramos’s recent algorithm for histogram specification [16]. Figure 27 shows the result of Ramos’s histogram specification, where Figure 27a shows the output image computed from the input image in Figure 1a with the Gaussian target histogram with mean 127.5 and standard deviation 50. Figure 27b shows the obtained histogram of the output image in Figure 27a in a blue line with the target histogram in the orange line. This figure shows that Ramos’s algorithm is not an exact histogram specification method, and the obtained histogram is similar to that of the conventional histogram specification shown in Figure 2b. On the other hand, the proposed method gives exactly the same histogram as a prescribed target histogram as shown in Figure 2c. In Ramos’s formulation of norm minimization, we set . For details, please refer to Ramos’s original paper [16]. For the implementation of Ramos’s algorithm, we need to use sparse matrices with about elements as well as Nikolova and Steidl’s one.
Figure 27.
Histogram specification by Ramos’s algorithm [16]: (a) histogram specified image; (b) obtained and target histograms.
A limitation of the proposed method is that users need to prepare a target histogram for histogram specification. However, it may be difficult to know the optimal shape of the histogram for a given image in advance. The estimation of suitable target histograms for given images will be a subject to be considered in the future.
7. Conclusions
In this paper, we proposed a method for ordering pixels in an image for exact histogram specification, and compared it with the state-of-the-art algorithm by Nikolova and Steidl [13]. We divided the problem of pixel ordering into small subproblems which can be solved memory-efficiently. This idea makes the problem of exact histogram specification more tractable than ever. The proposed method uses the Gaussian filter without approximation instead of the nonlinear filter used in Nikolova and Steidl’s algorithm. We use the local contrast defined with the Gaussian-filtered image as a key to ordering pixels. As a result, it was experimentally demonstrated that we could avoid the occurrence of false patterns that were observed in the results obtained by Nikolova and Steidl’s algorithm.
We also extended the proposed method for grayscale images to that for color images. Experimental results showed that the proposed method keeps the hue of the original images better than conventional separable methods of histogram equalization and specification for color images.
Our future work will include the development of a method for making a preferable target histogram for histogram specification depending on a given input image.
Author Contributions
Conceptualization, K.I.; methodology, K.I.; software, K.I.; validation, N.O. and K.H.; formal analysis, K.I.; investigation, K.I.; resources, K.I.; data curation, K.I.; writing—original draft preparation, K.I.; writing—review and editing, N.O. and K.H.; visualization, K.I.; supervision, K.H.; project administration, K.I.; funding acquisition, K.I. All authors have read and agreed to the published version of the manuscript.
Funding
This work was supported by JSPS KAKENHI Grant No. JP21K11964.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
SIDBA, the Standard Image Data-BAse can be downloaded from http://www.ess.ic.kanagawa-it.ac.jp/app_images_j.html (accessed on 21 June 2022).
Conflicts of Interest
The authors declare no conflict of interest.
Abbreviations
The following abbreviations are used in this manuscript:
| LM | Local mean method |
| WA | Wavelet-based exact pixel ordering algorithm |
| TV | Total variation |
| SIDBA | The Standard Image Data-BAse |
| RMSE | Root mean squared error |
References
- Pouli, T.; Reinhard, E.; Cunningham, D.W. Image Statistics in Visual Computing, 1st ed.; A. K. Peters, Ltd.: Natick, MA, USA, 2013. [Google Scholar]
- Naik, S.K.; Murthy, C.A. Hue-preserving color image enhancement without gamut problem. IEEE Trans. Image Process. 2003, 12, 1591–1598. [Google Scholar] [CrossRef] [PubMed]
- Rahman, M.A.; Fazle Rabbi, M.M.; Rahman, M.M.; Islam, M.M.; Islam, M.R. Histogram modification based lossy image compression scheme using Huffman coding. In Proceedings of the 2018 4th International Conference on Electrical Engineering and Information & Communication Technology (iCEEiCT), Dhaka, Bangladesh, 13–15 September 2018; pp. 279–284. [Google Scholar] [CrossRef]
- Qin, K.; Xu, K.; Liu, F.; Li, D. Image segmentation based on histogram analysis utilizing the cloud model. Comput. Math. Appl. 2011, 62, 2824–2833. [Google Scholar] [CrossRef]
- Gonzalez, R.C.; Woods, R.E. Digital Image Processing; Prentice Hall: Upper Saddle River, NJ, USA, 2008; pp. 150–161. [Google Scholar]
- Gonzalez, R.C.; Fittes, B.A. Gray-level transformations for interactive image enhancement. Mech. Mach. Theory 1977, 12, 111–122. [Google Scholar] [CrossRef]
- Raheja, A.; Chawla, R.; Gupta, S.; Vashist, A. Controlling Over Enhancement of Images Using Histogram Equalization Technique. IOP Conf. Ser. Mater. Sci. Eng. 2020, 804, 012055. Available online: https://iopscience.iop.org/article/10.1088/1757-899X/804/1/012055 (accessed on 28 June 2022). [CrossRef]
- Nikolova, M.; Wen, Y.W.; Chan, R. Exact Histogram Specification for Digital Images Using a Variational Approach. J. Math. Imaging Vis. 2013, 46, 309–325. [Google Scholar] [CrossRef]
- Hall, E.L. Almost Uniform Distributions for Computer Image Enhancement. IEEE Trans. Comput. 1974, C-23, 207–208. [Google Scholar] [CrossRef]
- Rosenfeld, A.; Kak, A.C. Digital Picture Processing: Volume 1 and 2; Academic Press: Orlando, FL, USA, 1982; ISBN 0-12-597301-2/0-12-597302-0. [Google Scholar]
- Coltuc, D.; Bolon, P.; Chassery, J.-M. Exact histogram specification. IEEE Trans. Image Process. 2006, 15, 1143–1152. [Google Scholar] [CrossRef] [PubMed]
- Wan, Y.; Shi, D. Joint Exact Histogram Specification and Image Enhancement Through the Wavelet Transform. IEEE Trans. Image Process. 2007, 16, 2245–2250. [Google Scholar] [CrossRef] [PubMed]
- Nikolova, M.; Steidl, G. Fast Ordering Algorithm for Exact Histogram Specification. IEEE Trans. Image Process. 2014, 23, 5274–5283. [Google Scholar] [CrossRef] [Green Version]
- Nikolova, M.; Steidl, G. Fast Hue and Range Preserving Histogram Specification: Theory and New Algorithms for Color Image Enhancement. IEEE Trans. Image Process. 2014, 23, 4087–4100. [Google Scholar] [CrossRef]
- Lindeberg, T. Scale-space for discrete signals. IEEE Trans. Pattern Anal. Mach. Intell. 1990, 12, 234–254. [Google Scholar] [CrossRef]
- Ramos, V.S.; Silveira, L.F.d.Q.; Silveira Júnior, L.G.d.Q. Histogram Specification by Assignment of Optimal Unique Values. arXiv 2021, arXiv:2102.02378. [Google Scholar]
- Pallavi, S.; Sannidhan, M.S.; Abhir Bhandary. A Comprehensive Review on Various State-of-the-Art Techniques for Image Enhancement. Int. J. Eng. Technol. 2018, 7, 86–864. Available online: https://www.sciencepubco.com/index.php/ijet/article/view/19576 (accessed on 28 June 2022).
- Yadav, G.; Maheshwari, S.; Agarwal, A. Contrast limited adaptive histogram equalization based enhancement for real time video system. In Proceedings of the 2014 International Conference on Advances in Computing, Communications and Informatics (ICACCI), Delhi, India, 24–27 September 2014; pp. 2392–2397. [Google Scholar] [CrossRef]
- Kim, Y.-T. Contrast enhancement using brightness preserving bi-histogram equalization. IEEE Trans. Consum. Electron. 1997, 43, 1–8. [Google Scholar] [CrossRef]
- Trongtirakul, T.; Agaian, S. Weighted Histogram Equalization Using Entropy of Probability Density Function. In Proceedings of the 44th Electrical Engineering Conference (EECON 44), Nan, Thailand, 17–19 November 2021; Volume 1, pp. 461–464. Available online: https://arxiv.org/ftp/arxiv/papers/2111/2111.08578.pdf (accessed on 28 June 2022).
- Ren, X.; Yang, W.; Cheng, W.-H.; Liu, J. LR3M: Robust Low-Light Enhancement via Low-Rank Regularized Retinex Model. IEEE Trans. Image Process. 2020, 29, 5862–5876. [Google Scholar] [CrossRef] [PubMed]
- Zhang, F.; Shao, Y.; Sun, Y.; Zhu, K.; Gao, C.; Sang, N. Unsupervised Low-Light Image Enhancement via Histogram Equalization Prior. arXiv 2021, arXiv:2112.01766. [Google Scholar]
- Hussain, K.; Rahman, S.; Rahman, M.; Khaled, S.M.; Wadud, A.A.; Hossain Khan, M.A.; Shoyaib, M. A histogram specification technique for dark image enhancement using a local transformation method. IPSJ Trans. Comput. Vis. Appl. 2018, 10, 3. [Google Scholar] [CrossRef]
- Balado, F. Optimum Exact Histogram Specification. In Proceedings of the 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Calgary, AB, Canada, 15–20 April 2018; pp. 1413–1417. [Google Scholar] [CrossRef] [Green Version]
- Vectorization (Mathematics) From Wikipedia, the Free Encyclopedia. Available online: https://en.wikipedia.org/wiki/Vectorization_(mathematics) (accessed on 28 June 2022).
- Weisstein, E.W. “Transpose.” From MathWorld—A Wolfram Web Resource. Available online: https://mathworld.wolfram.com/Transpose.html (accessed on 29 May 2022).
- Weisstein, E.W. “Floor Function.” From MathWorld—A Wolfram Web Resource. Available online: https://mathworld.wolfram.com/FloorFunction.html (accessed on 13 June 2022).
- The Standard Image Data-BAse (SIDBA). Available online: http://www.ess.ic.kanagawa-it.ac.jp/app_images_j.html (accessed on 21 June 2022).
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).