Image Enhancement Using Local Histogram Matching with Normal Distribution

: Image enhancement aims at improving the quality of an image for better visualization. Histogram equalization (HE) is an image enhancement technique based on image histogram modification and this algorithm flats the given image histogram and produces better result on the global scale but the HE technique shifts the mean brightness of original image. Rather than flattening the given histogram, matching the given image with some specified distribution might help to resolve the issue. However, when the goal is to extract information on the local scale, local enhancement techniques, e.g. local HE (LHE), contrast limited adaptive HE (CLAHE), are required. Although the local histogram modification techniques manage to extract local information, however, compromises the visual quality (e.g. over enhancement, shifts in mean brightness, etc.) of the image. In this paper, a novel technique called Local Histogram Matching with Normal Distribution (LHMND), is proposed to extract local information and enhance the image quality by taking advantage of the Normal histogram matching on the local scale. Experiment shows that our proposed method performs better in terms of preserving the mean brightness and contrast enhancement to some extent, in comparison with the relevant HE techniques, e.g. HE, LHE, and CLAHE.


Introduction
Due to some environmental reasons (extreme light or dark situation), image quality can vary and many times this dark or bright area can not be exposed properly and many details remain hidden. Image enhancement is a commonly used approach which seeks to improve the visual appearance of an image and process the given image to a form better suited for analysis by a human or a machine [1]. Among the various image enhancement techniques that are proposed in literature, histogram based modification techniques are widely used. The histogram based modification techniques can be categorized into two: histogram equalization and histogram matching. The simplest form of histogram equalization (HE) technique is global HE (GHE) [2] that transforms the given image (on global scale) in such a way so that the histogram of the output image is close to the uniform distribution. The rationale behind this technique is that the images with good contrast have more varieties in the pixel levels. So, equalizing with the uniform distribution, this technique flats the original image histogram and as a result, the output image shows more variety compared to original image resulting in a good quality image. Although the GHE technique enhances the contrast of a given image, it shifts the mean brightness of the image. In particular, for bright and dark images, this shift in brightness often produces unusual artifacts in the processed image [3]. Also, this technique allows for areas of lower contrast to gain a higher contrast and vice versa for higher contrast areas [4]. There are many GHE based algorithms are available in the literature such as Bi-Histogram equalization (BBHE) [5], Exposure based Sub Image Histogram Equalization (ESIHE) [6], Plateaus Histogram Equalization [7], Mean-Separate Histogram Equalization [8], etc. These methods have both their benefits and drawbacks but all of these methods provide a single histogram without considering variation in the gray level.
Although for certain types of image (e.g. forensics) information extraction is preferred, even if compromising the naturalism of the image, for many lively images addition of unusual artifacts dominates over the improvement in visual perception of an image. In this regard, rather than equalizing the original histogram or by flattening it, matching with specified histogram is required. Histogram matching (HM) transforms the original histogram of an image into a reference or specified histogram and the problem of shift in brightness could be resolved eventually [9]. Although both the GHE and HM techniques have subtle differences in the approach of operating the transformation algorithm, both have similarities upon focusing on the global window (whole image). As a result, both GHE and HM techniques fail to extract the local information of an image. When the goal is to extract the local information of an image, histogram processing techniques that work on local window is preferred.
Local information of an image can be extracted by applying the histogram equalization on local window rather than on the global image, which is known as local histogram equalization (LHE) [10]. This method divides the whole image into several windows (of equal size) and then applies the transformation function of HE on every windows, which extracts both local and global information, and adds more clarity to the output image. However, processing an image using LHE technique often produces over-amplified noise deteriorates the visual quality of the image. To trade-off between visual quality and local information extraction, contrast limited adaptive histogram equalization (CLAHE) [11] has been developed. Although setting an appropriate clip, CLAHE solves the problem of over-amplification, however, this method is fails to preserve the mean brightness and enhance the contrast of the given image. Another important drawback of CLAHE is that it does not consider the whole grayscale as it sets a clip limit and for this reason, it fails to provide all local gray-scale information. Taking advantage of the histogram matching on global scale, the mechanism of histogram matching could be utilized on the local scale. The local histogram matching (LHM) has been getting popular now-a-days and is broadly applied in face detection, underwater image, medical image such as, x-ray, MRI, etc. [12].
Local histogram could be matched with different distributions e.g. Normal, Exponential, Rayleigh, etc., to meet the goal. Particularly, matching with normal distribution got some interesting and advantageous features. Particularly, matching with Normal distribution preserve the mean brightness and also provide more structural details. Also, normal matching improves the contrast [13], and especially, for low contrast or dark image normal matching works well [14]. To incorporate the features of normal matching in local scale, in this paper, we propose a novel algorithm, named local histogram matching with normal distribution (LHMND). Our method is an extension of LHE technique, which performs local normal matching on the windows with low brightness and low contrast, and LHE technique otherwise. An extensive simulation study has been conducted on several test images to understand the performance of the proposed algorithm. Also, the efficacy of the proposed method is compared with the existing histogram based image enhancement techniques (GHE, LHE, CLAHE). The performance of these methods has been measured by using traditional metrics (e.g. mean brightness, entropy, peak signal to noise ratio (PSNR), and also by using more sophisticated metric, structural similarity index (SSIM) [15]).
The remainder of the paper is organized as follows. In Section1, the theoretical details of the proposed algorithm are discussed. The simulation results and the visual assessments are presented in Section2. Finally, a short conclusion is presented after section 2.

1.
Local Histogram Matching with Normal Distribution In this method, the image is first divided into several local windows of equal size and the local measures (mean and standard deviation) are calculated. By setting up a rule, this method determines the local windows, which require special attention for enhancement. The enhancement of image quality locally by specifying the candidate window for local enhancement, our proposed methodology combine the traditional local histogram equalization (LHE) [10] and local histogram matching with normal distribution (LHMND) to a single frame. Rather than enhancing the entire image by LHE or LHMND, the proposed method is flexible enough to perform local equalization and local technique considering the eligibility of a local window for enhancement.
Suppose an image with M×N size is divided into several blocks with m×n size. The total number of blocks will be W=M×N. For an input image which is composed of discrete gray levels in the range of [0, L-1], let us consider continuous gray levels and , and let ( ) and ( ) denote their corresponding continuous probability density functions. Here and denote the gray levels of the input and output (processed) sub-blocks respectively, where = 1, 2, . . . , . We can estimate ( ) from the given input image sub-block, while ( ) is the specified probability density function that we wish the output image to have. Let be a random variable with property.
Where is a dummy variable of integration. We recognize this expression as the continuous version of histogram equalization. Let is a random variable with the property, where is a dummy variable of integration. It then follows, The transformation ( ) can be obtained because ( ) has been estimated from the input image. Similarly, the transformation function ( ) can be obtained because ( ) is given.
Assuming inverse exists and that it follows all the conditions (single valued and monotonically increasing in the interval 0 ≤ ( ) ≤ 1). Now from the normal distribution, Where is mean of variable , 2 is the variance of variable . By replacing original local window mean brightness ( ) and contrast 2 by and 2 in equation (7) From the above CDF defined in (7), we get the following transformation function and the corresponding inverse transformation function is, Now, local normal matching transformation function will be applied on some specified area, which satisfies our defined decision rule. We will consider the pixel at a point ( , ) for processing with LHMND technique if ≤ 0 , where is the mean of that local windows in which the pixel point ( , )exists, is the global mean and 0 is a positive constant. We will also consider the pixel point ( , )for processing LHMND technique if 1 ≤ ≤ 2 , where 1 , 2 are positive constants and is the global standard deviation and is the local standard deviation. Failure to meet the eligibility rule for a local window centering the pixel considered local histogram equalization technique for that local window.

2.
Experimental Result In this section, we present the simulation results of our proposed method-LHMND and, compare it with the relevant algorithms (GHE, LHE and CLAHE). The comparisons of the performance of the methods are carried out by using the standard metrics (average intensity, entropy, peak signal to noise ratio, Similarity Image Matric). Average intensity corresponds to the mean brightness of the image, and entropy is a measure of variability in the pixel levels of an image. Entropy is closely related with contrast and higher entropy value indicates better quality [13]. Peak Signal to Noise Ratio (PSNR) is an expression for the ratio between the maximum possible value of a signal and the value of distorting noise. Structural Similarity Image Matric (SSIM) compares brightness, contrast and similarity between two images, and SSIM value close to 1 indicates better image quality [15]. In our experimental work, we considered 75 × 75 local window size for every image.
The comparative measures of the ``Rocket" image ( Figure 1) are presented in Table 1. The result shows that proposed algorithm has mean brightness that is close to the original image of the rocket. Both the PSNR and SSIM for LHMND processed image are higher compared to all other methods, which indicates that the processed image is less distorting and have the best structural similarity. Visual assessments also speculate that our proposed method produces better quality image compared to others. For instance, the original image (Figure 1a) is of medium brightness and of low contrast with little exposure to the background details. Processed image using HE ( Figure 1b) extract a little more information compared to the original image with the cost of shifting the mean brightness. As a result, the HE processed image looks so bright as if the image is of sunny day light. Also, the smokes from the sparks at the bottom have become blurry in HE processed image. Although for both LHE ( Figure  1c) and CLAHE (Figure 1d) processed images, PSNR and SSIM values are higher than LHMND processed image, however, the formers compromises the visual quality. Finally, the LHMND (Figure 1e) processed image preserves the mean, in addition to, extracting local information (e.g. shades, smokes, slices in the rocket body, etc.). The enhancement in contrast is also balanced keeping the naturalism of the image intact.  Table 2 presents the objective measures for the image of ``Barbara" (Figure 2a), which portrays a young lady sitting on the floor. The objective measures show that our proposed method preserves mean brightness and enhances the contrast. Highest PSNR value also confirms that LHMND processed image introduces less noise compared to other methods. The LHMND processed image got the SSIM value close to one, which also indicates the good quality image. The visual assessments also support the decision from the objective measures. The original image is of medium contrast and has very limited visibility in the structural detail of the image. The HE processed image flats the image histogram as such the shifts the mean brightness. Although HE processed image (Figure 2b) have the highest SSIM value, in comparison with the visual quality HE fails to produce better result. Both LHE (Figure 2c) and CLAHE (Figure 2d) processed images show greater detail, however, produce unnatural and visually worse images compared to others. The image processed using LHMND (Figure 2e) is of good contrast that shows nice structural details of her eyes, face, elbows, and also the floor looks more natural in this processed image. Moreover, LHMND preserves the mean brightness that also contributes to better visual quality of the image.   Figure 3 we can see that HE has shifted the mean brightness of the 'Girl' image. LHE and CLAHE both methods have produced noise in the background and girl's face. LHMND method has provided more details on the girl's hat, shoulder, hair, face and background and this image looks more natural than others. From Table 3 it is clearly evident that the proposed method gives mean brightness close to the original image than any other method and LHMND also gives the highest entropy and PSNR value. Here SSIM value is close to 1 which ensures image quality.   Table 4 it is clear that LHMND method has given comparatively better result than any other method.

Conclusion
The histogram modification techniques matched with normal distribution (on global scale) produces better results in terms of brightness preservation and contrast enhancement, and have been routinely used in diversified fields. Although this algorithm produces better results in the global scale, however, fails to draw out the local information of the image, which demands further modification of this technique for local enhancement. The local enhancement techniques (LHE, CLAHE) that are developed in literature, suffer mostly from over enhancement and unnatural artifacts. In this paper, a novel methodology, local histogram matching with normal distribution (LHMND), is proposed that is intended to extract local information of an image without compromising the natural features (e.g. brightness, contrast). The parameters for the specified normal distribution in the local window are computed by combining the local and global statistics, which preserves the mean brightness of the processed image. Our simulation results prove that the proposed algorithm preserves the mean brightness and contributes to contrast enhancement to some extent compared to the conventional techniques (GHE, LHE, CLAHE).

4.
Conflict of Interest In this project we have used only normal distribution for specification but there are many continuous distributions which can also be used. Based on the image area two or more distributions can be applied in an image. This study on colour images can also be conducted.