Image contrast enhancement with brightness preservation using an optimal gamma and logarithmic approach

IET Image ProcessingVolume 14, Issue 4 p. 794-805 Research ArticleFree Access Image contrast enhancement with brightness preservation using an optimal gamma and logarithmic approach Neha Singh, Neha Singh Department of Electronics and Communication Engineering, National Institute of Technology, Patna, 800005 IndiaSearch for more papers by this authorAshish Kumar Bhandari, Corresponding Author Ashish Kumar Bhandari bhandari.iiitj@gmail.com orcid.org/0000-0001-9842-8125 Department of Electronics and Communication Engineering, National Institute of Technology, Patna, 800005 IndiaSearch for more papers by this author Neha Singh, Neha Singh Department of Electronics and Communication Engineering, National Institute of Technology, Patna, 800005 IndiaSearch for more papers by this authorAshish Kumar Bhandari, Corresponding Author Ashish Kumar Bhandari bhandari.iiitj@gmail.com orcid.org/0000-0001-9842-8125 Department of Electronics and Communication Engineering, National Institute of Technology, Patna, 800005 IndiaSearch for more papers by this author First published: 19 February 2020 https://doi.org/10.1049/iet-ipr.2019.0921Citations: 5AboutSectionsPDF ToolsRequest permissionExport citationAdd to favoritesTrack citation ShareShare Give accessShare full text accessShare full-text accessPlease review our Terms and Conditions of Use and check box below to share full-text version of article.I have read and accept the Wiley Online Library Terms and Conditions of UseShareable LinkUse the link below to share a full-text version of this article with your friends and colleagues. Learn more.Copy URL Share a linkShare onFacebookTwitterLinked InRedditWechat Abstract In this study, a new enhancement framework is proposed for low contrast and dark images where traditional histogram equalisation (HE), gamma and logarithmic transformation are incorporated to achieve a visually pleasing image. Before the operation of HE on the input image, gamma and logarithmic transformation are performed in order to preserve the fine details of the image. A new gamma value of the proposed algorithm helps to restrain histogram spikes to avoid over-enhancement and noise artefacts effect. After that, a novel logarithmic transformation is used to map a narrow range of low-intensity values in the input image to a wider range of output levels. Thus, the dark input values are spread out into the higher intensity values, which improve the overall contrast and brightness of the image. The proposed method is compared with various state-of-the-art techniques. The large dataset has been used to check the feasibility of the technique. The subjective and objective analysis shows that the proposed algorithm outperforms most of the existing contrast-enhancement algorithms and the results are natural-looking, good contrast images with almost no artefacts. 1 Introduction Contrast enhancement (CE) methods are widely implemented in image processing. These techniques are fundamental pre-processing techniques to emphasise the necessary features in images and videos for automatic pattern recognition and machine vision. Furthermore, these techniques are used for many applications such as medical imaging [1], surveillance system analysing images from satellite [2]. Various CE methods have been developed to enrich the contrast of the image. These procedures can be categorised into two major groups: spatial domain-based and transformation domain-based methods. Histogram equalisation (HE) is the simplest and popular method that belongs to the first group, which explores the histogram statistics of the complete image to form its conversion function. The classical HE [1] can resourcefully employ display intensities but suffers from over enhancement. To alleviate the problem, abundant techniques have been anticipated to limit the level of enhancement. These techniques are acquired through adjustments on HE [3-7]. For example, Kim [3] proposed brightness preserving bi-histogram equalisation to conserve the illumination. In this method, the histogram of an input image is first divided into two histograms depending on its mean, and applies HE on each histogram independently. Similarly, in the year 1997 Wan [4] and in 1999 Wang et al. [5] proposed dualistic sub-image HE. This algorithm uses median intensity value for histogram partition. Singh and Kapoor [6] gave a median mean-based sub-image clipped HE method (MMSICHE). This method clipped the histogram using the plateau limit which set as the median. This method preserves the brightness along with information and controls the over-enhancement. Another HE-based called recursive mean-separate HE [7] was suggested by Chen and Ramli in 2003. This process executes the histogram separation recursively, and it parts each new histogram into two parts based on their respective mean. Lidong et al. [8] have proposed a contrast discrete wavelet transform method, which is a combination of contrast limited adaptive HE and discrete wavelet transformation. This technique eliminates the over enhancement problem by taking an average of the original and enhanced output by using the weighting factor. Newly, a CE using adaptive gamma correction with weighting distribution (AGCWD) is planned, which soothes the sharp edges by weighting scattering and heightens image repeatedly using gamma correction [9]. Wang and Chen [10] introduced a method based on bi-histogram equalisation. They modified the input histogram in such a way that output histogram which is uniformly distributed is closed to input one. This modification improved the contrast as well as preserves the features of an image. This method is represented as feature-preserving bi-histogram equalisation (FPBHE) [10] in this paper. In contrast to the above methods, Arici et al. [11] gave the weighted histogram approximation method (WAHE). WAHE does not alter the input histogram by transformation function. In this technique, those pixels are counted having enough contrast in the histogram to circumvent change of smooth areas. A new method where the histogram is divided into overexposed and underexposed sub-histogram parts (ESIHE) [12]. This technique is effective for the underexposed image. In 2016, Singh et al. [13] dominant orientation-based texture HE (DOTHE) have been introduced that divide the image into patches of rough and smooth categories. This paper has claimed that it has very poor performance on low contrast as well as dark images. In recent years, several fuzzy-based [14-16] enhancement techniques have been proposed. Fuzzy dissimilarity histogram (FDH) is generated using a fuzzy similarity index, and the HE mechanism is incorporated on normalised FDH [14]. Parihar et al. [15] have proposed a new histogram, based on a fuzzy contrast pixel. A cumulative distribution function is designed with standardised data of an FDH and used as a transfer function to get the enhanced image. The algorithm gives good CE and conserves the natural specific of the image. Deng et al. [16] introduced an enhancement approach where the intuitionistic fuzzy set is used to improve images with meager edges. Due to significant upgrading in contrast and brightness enhancement areas, a histogram-based method [17-19] continuously attracts many researchers to solve image enhancement related problems. Kansal and Tripathi [17] gave a method based on adaptive gamma correlation and discrete cosine transform (DCT) in order to enhance the contrast of the image with the maximum information. By using adaptive gamma correlation this enhances the image globally whereas DCT is applied to the high-frequency component of the image to strengthen the minute details of the image. Albu et al. [20] have proposed a new method one scan shadow compensation (OSSC) that enhances low light areas while preserving the colour and details of an image. Capra et al. [21] gave a method dynamic range optimisation by local contrast (DROLC) which is based on the local exponential correction. This technique properly enhances the dynamic range in both lowlight and highlight regions of an image while avoiding artefacts. Gupta and Tiwari [18] have introduced colour retinal CE in which the gain matrix is obtained by using an adaptive gamma correlation method. This correlation method is used to enhance all three components of the colour image. Further, HE is applied to get the visual pleasing enhanced image. Pal et al. [19] gave a method for foggy colour image based on sigmoid function. First, they have used visibility restoration algorithm to improve the visibility then after the sigmoid function is applied to get an enhanced image. Similarly, some more enhancement methods [22-25] have been developed based on the transformation and clipping process. Goyal et al. [22] have proposed an enhancement technique based on lifting wavelet transform (LWT). In this technique, LWT works on the low, as well as high-frequency components, to improving the contrast. Paul et al. [23] proposed plateau limit-based tri-histogram equalisation for image enhancement. In this method, the plateau limit was used to clip the histogram of an image to avoid over-enhancement. Joseph and Periyasamy [24] introduced a method for magnetic resonance images in order to preserve maximum contrast and very less brightness error. In this method, they have clipped histogram with respect to threshold value based on mean and maximum probability density value. A dynamic stochastic resonance (DSR) method for non-illuminating images has been proposed by Zhang et al. [25]. This method effectively enhanced the image without introducing over enhancement and detail loss. The enhanced image is obtained by fusing DSR results with the original component and illumination compensation component. Based on numerous research on enhancement techniques, this paper proposes a BPGLA algorithm, which keeps balance on CE locally and globally, details preserving, and overall quality. This new algorithm uses transformation functions to achieve the desired results. The outcomes of the proposed method are much better than each individual CE method. The remaining part of this paper is structured as follows. Section 2 explains a transitory review of HE and motivation. Section 3 epitomises the proposed BPGLA scheme and provides the illustration of the implementation procedure. Section 4 reports the investigational results figured for proposed and other methods and lastly conclusions are given in Section 5. 2 Background There is a necessity of image CE for image processing related applications. Among the numerous methods, linear HE became the most popular method because of its simplicity and ease of implementation. In the context of performance, many researchers also attracted to the non-linear methodologies such as gamma correction. The gamma correction process inflicts a non-linear operation of the image intensity while outclasses HE with regard to its ability to direct the mean brightness of the processed image to the desired value. In the following sections, we will discuss on HE and motivation. 2.1 Histogram equalisation In this section, we will deliberate on the conventional HE technique [3]. HE maps the input image pixel values in order to get resultant histogram with uniform distribution. Initially, the histogram of an input image Pin is calculated. Further, normalisation is performed on it to produce the probability density function (PDF), and after that, a cumulative density function (CDF) is calculated. Finally, an output image of enhanced contrast is obtained. Let P(i, j) represents an input grey level image and the desired output image W(i, j). There is a transformation function say f, that is used to mapping the purpose of pixel values, i.e. P to W. The size of the image is M × N. Hence, the total number of intensity values in the entire dynamic range (i.e. P0, P1, …, PL−1) is S = M × N. The PDF is written as follows: (1)where Sk represents the number of pixels at intensity level Pk and CDF can be expressed as follows: (2)The transform function T(Pk) is calculated by (3) (3)where L represents the greyscale value of an image. So, HE is a method that delineates the original image into the thorough range by using a cumulative distributive function as a transform function. 2.2 Motivation Enhancing the contrast of the image, and brightness preservation levels were the primary aim of the researchers. To overcome the drawbacks of the HE arrangement, numerous methods have been developed by various researchers. Generally, all their developed techniques were based on the modification of the histogram to achieve some wanted goals instead of a uniform distribution. However, modification of histogram does not deliver solutions to eliminate the problem that is caused by prickles of the histogram also, HE-based methods are unable to restore steadiness on enhancing the image universally and nearby. Based on various researches on CE, we propose a new CE algorithm for colour and greyscale images that combines the features of gamma transformation and logarithmic transformation. In addition to this, histogram splitting which is proportional to logarithmic as well as gamma transformation and merging of histogram transformation based on the concept of standard deviation. The gamma transform can have the ability to prevent the histogram prickles, and proportional histogram splitting can preserve mean brightness. The logarithmic transformation is exploited to preserve the fine details of an image using the remapping concept. Therefore, this new algorithm can keep balance on global CE, brightness preservation, and overall quality. 3 Proposed methodology The complete framework of the proposed method is presented in Fig. 1. The proposed approach has a feature of splitting histogram into subparts. Further, the output histogram is obtained with the help of both input histogram and histogram of HE equalised image. The proposed approach mainly consists of the following four operations: Gamma transform of an input histogram. Fig. 1Open in figure viewerPowerPoint Flowchart of the proposed BPGLA method Applying logarithmic transform of an input histogram. Splitting the histogram which is obtained after an application of a gamma transformation and histogram rearrangement based on logarithmic transform between sub-histograms. Histogram equalisation. The gamma transform is defined as (4)where k and γ are positive integers, r denotes an input histogram and R is the corresponding output histogram. Application of gamma transform on the original input histogram presses histogram prickles as well as prevents histogram from the noise artefacts effect. By the value of γ, different levels of smooth and restraining can be attained. The purpose of this transformation is to make image visual effects better by changing the image contrast. In the proposed algorithm, the factor γ is designed rendering to the image intensity exposure because different images need dissimilar stages of smooth and detaining. Thus, the intensity exposure threshold (6) is calculated by using (5) before an application of gamma transformation. (5)where t denotes the intensity level of input image ranges from 0 to L−1. The value of gamma can be calculated for the proposed algorithm as follows: (6)The values of γ map a narrow range of dark input values into a wider range of output values, with the opposite for high value of input values which leads to make image visual effects better. The splitting threshold based on the definition of exposure threshold is represented as follows: (7)The logarithmic transformation of an input histogram for the proposed algorithm can be calculated by using (8) (8)where Ths denotes the splitting threshold points, is the modified output histogram obtained by an application of logarithmic transformation, f denotes the occurrence of pixels value in the original histogram (R) and c is constant taken as 0.5. Logarithmic transformations can be used to brighten the intensities of an image. More often, it is used to enhance the detail of lower intensity values. They are especially useful for bringing out the detail features in the transform domain. If γ<1, power law transformation maps a narrow range of dark pixel values into a wider range and wider ranges of bright pixel values to a narrow range. This method signifies that the mean intensity and information content can be adjusted by assigning a proper gamma-factor. The modified histogram is split into underexposed sub-histogram ru and overexposed sub-histogram ro. Splitting image histogram into some sub-histograms so that none of them has any dominating portion may not assure a very good enhancement that will be free from domination. This is because some sub-histograms having higher values may stretch too much leaving less room for some other having lower histogram values to get significant CE. These sub-histograms are processed separately in HE later, which prevents some parts of the histogram from being dominated by others. Histogram splitting preserves the mean brightness. In contrast of the above-mentioned CE approaches [3-19, 22-25] that improve each of the sub-histogram inside the splitting thresholds, whereas the proposed BPGLA algorithm rearranges the underexposed sub-histogram ru from range [0, Ths] to output range [0, Z], and the overexposed sub-histogram ro from [Ths + 1, L−1] to output range [Z + 1, L−1] to completely achieve the dynamic series, where Z signifies output threshold point for underexposed and overexposed sub-histograms and is designed as (9)In order to solve the problem of noise artefacts features damage produced by histogram pits the two sub-histograms, i.e. underexposed ru and overexposed histogram ro have been added to further smooth the histogram . The two adding factors are their standard deviations of ru and ro, correspondingly (10) (11)where p and q imply the number of intensity in sub-histograms ru and ro, individually, respectively, and the corresponding mean of sub-histograms are and , respectively. Lastly, the sub-histograms, i.e. overexposed and underexposed histograms for smearing HE are shown in (12) (12)The exceptional consideration of the proposed algorithm is that the output image histogram for and are in the range [0, Ths], and [Ths + 1, L−1], correspondingly. Splitting image histogram into some sub-histograms implies that none of them has any dominating portion may not assure a very good enhancement that will be free from domination. This is because some sub-histograms having higher values may expanse too much leaving less room for some others having lower histogram values to get significant CE. These sub-histograms are processed separately in HE later, which prevents some parts of the histogram from being dominated by others. Histogram splitting preserves the mean brightness. The first column of Fig. 2 represents original images and their histograms and the second column denotes corresponding processed images and their histograms produced by the proposed BPGLA algorithm. It can be clearly observed from Fig. 2 the output histogram is close to the input histogram. Thus, the resultant output reflects a visually pleasing enhanced image. Fig. 2Open in figure viewerPowerPoint Visual comparison of image and histogram (a) Test input image and their histograms, (b) Output image and correspondinghistograms 4 Experimental results In order to validate the efficacy of the proposed method along with different enhancement methods are executed and equated. Further to this, subsections give a brief depiction of the images selected in this study and a number of qualitative parameters for performance analysis. To comprehensively estimate the enactment of the proposed BPGLA algorithm, qualified experimentations are performed on 200 test images, which are (i) 24 standard images from the TID2013 [26]; (ii) 176 images from the CSIQ database [27], and aerials sequence of the USC-SIPI database [28] of different sizes. As there are no large public databases of images exist which are defected from lack of illumination so in this paper investigations are limited to 200 images only. The proposed algorithm is examined with HE [3], WAHE [11], AGCWD [9], ESIHE [12], MMSICHE [6], DOTHE [13], SMIRANK [29], and FPBHE [10]. First, subjective analyses will perform which shows the robustness of the proposed method in terms of image enhancement and brightness preservation. Further to this, objective analyses will calculate the performance using the quality estimation measures, which are discussed briefly in this paper. 4.1 Image data set This set contains ten diverse feature colour images named as (a) Lady and Couple1, (b) Swarm and Fox, (c) Old lady and Statue, (d) Balls and Garden, and (e) Cactus and Lake along with two grey-scale images (Zelda and Aerial). All images are in different formats such as PNG, TIFF, JPEG, BMP, and TIF of different sizes. Colour test images are presented in Fig. 3 and grey-scale test images are represented in Fig. 4. Fig. 3Open in figure viewerPowerPoint Image dataset (a)–(e) Represent original colour test images Fig. 4Open in figure viewerPowerPoint Original grey-scale test images (a)Barbara, (b) Satellite 4.2 Subjective analysis The proposed framework is investigated with other eight state-of-the-art approaches, which include (i) Traditional histogram-based development methods (ii) Histogram adaptation system, and (iii) CE based on spatial mutual information. The traditional histogram-based CE approach offered here contains conventional HE [1], ESIHE [12], MMSICHE [6], FPBHE [10], and texture-based enhancement methods like DOTHE [13]. Whereas approaches like WAHE [11] and AGCWD [9] are associated to histogram adaptation-based approaches and CE based on spatial mutual information which includes SMIRANK [29]. For the evaluation of the proposed BPGLA method with respect to CE with brightness preservation, low contrast input-images, dark images, and aerial images are considered. The illustrations from Figs. 5 and 6 are demonstrating the outcomes of the images handled by different state-of-the-art procedures and proposed structure. The offered state-of-the-art methods are not operative and producing poor enhancement results in low contrast and dark images. Fig. 5Open in figure viewerPowerPoint Enhanced output by different methods for colour images (a) HE and WAHE, (b) AGCWD and ESIHE, (c) MMSICHE and DOTHE, (d) SMIRANK and FPBHE, (e) Proposed method Fig. 6Open in figure viewerPowerPoint Enhanced output by different methods for grey-scale images (a) HE and WAHE, (b) AGCWD and ESIHE, (c) MMSICHE and DOTHE, (d) SMIRANK and FPBHE, (e) Proposed method It is observed for the Lady image incorporated in Fig. 5, the image got distorted by HE, DOTHE and SMIRANK methods whereas over-enhanced by ESIHE, MMSICHE, FPBHE, WAHE, and AGCWD methods. However, the proposed structure offers a balanced output as shown in the last row of Fig. 5. We can clearly observe for Couple1 image, which is a dark image. The proposed way works well, whereas the cloth of man of this image (Couple1) obtained by HE, AGCWD, DOTHE and SMIRANK methods got over-enhanced. Also, the image obtained by WAHE, MMSICHE, and FPBHE got under-enhanced. As for the Swarm image, the enhanced images are shown in Fig. 5 by different methods. As we can see that the standard methods entirely flop on Swarm image except for FPBHE. FPBHE delivers the finest consequence among with respect to aforementioned methods, but do not offer better result as related to the proposed BPGLA method. The proposed method beats other methods. The proposed method conserving the features and level of enhancement. The same statements can be said for the fox image shown in Fig. 5. The enhanced images of an Old lady are shown in Fig. 5. The hair of the Old lady got over-enhanced by HE, AGCWD, ESIHE, MMSICHE, DOTHE, and SMIRANK. The fur on the neck of the Old lady got over-enhanced by WAHE and FPBHE methods. The image obtained by the proposed method eliminates all these artefacts. The enhanced Statue images, processed by different state-of-the-art techniques are shown in Fig. 5. The yellow ball and head of the statue is enhanced properly by the proposed method. Also, the cloth on the left shoulder of the statue is well-enhanced as compared to the rest of the methods. Balls input image shown in Fig. 3 and their enhanced images produced by all the techniques are shown in Fig. 5. It is clearly observed that the background of Balls image distorted by all the mentioned methods except the proposed method. Also, the object of this image enhanced properly. In Fig. 5, the Garden image, the background behind the flag pole got distorted by HE, ESICHE, MMSICHE, and DOTHE. We can see the image obtained by AGCWD smooth the flowers. Here, the proposed method provides a satisfactory result with clear identification of edges of all the objects. In Fig. 5, for the Cactus image, the output image processed by HE contains noise artefacts. The ESIHE and MMSICHE produced under the enhanced image. The background of this image obtained by WAHE, AGCWD, DOTHE, and FPBHE methods is distorted. The image obtained by the proposed method provides a balanced and enhanced output. The output image preserved the edges as well as natural enhanced colour this can be seen at the top of the object (cactus) image. The same statements can be said for the Lake image shown in Fig. 5. The reflection of the hill in water is well-enhanced without any distortion by the proposed method. Also, grass and the top portion of the image are enhanced properly. The colour of the enhanced images obtained by the proposed methodology has maintained the regular feel of the image to avoid over enhancement associated problems. For effective colour preservation, the CE methods are performed over dimly illuminated images. In Fig. 6, we have processed outputs of Zelda and Aerial grey-scale images obtained by different methods. Here it can clearly be observed that the ESIHE, MMSICHE, and FPBHE produced under-enhanced outputs. WAHE is closed to the proposed one, but it lacked to provide a balanced result whereas rest of the methods produce over-enhanced results. The enhanced aerial images obtained by AGCWD and FPBHE shown in Fig. 6 got over-enhanced. The proposed BPGLA method produces good results as compared to rest of the methods. Fig. 7 shows input and output images of Monument, Couple2,Old lady, Vegetable and Girl at a different level of contrast by the proposedBPGLA algorithm. The proposed method is performed at different levels of contrast image toproduce effective contrast, brightness preservation, white balancingperformance, sharp edge, and highest visual quality in the enhanced images. Theproposed algorithm can achieve visually pleasing images, especially in ascenario with varying colour characteristics. Fig. 7Open in figure viewerPowerPoint Visual comparison of five test images at different levels ofcontrast distortion (a) Input images of monument andcorresponding outputs, (b) Couple2‱s images and their outputs, (c) Old lady's images and theirenhanced images, (d) Vegetable's images and theiroutputs, (e) Girl's images and correspondingoutputs at different level of contrast by proposed method The highlighted portion of Fig. 8 represents the enhancedportion of Old lady and Cactus images obtained by different algorithms. In thecase of an 'Old lady' image, HE makes the overall image visible but the hair ofan old lady got over-enhanced by HE but there exists too many artefacts on thebackground. The AGCWD, ESIHE, MMSICHE, and SMIRANK also produce over-enhancedresults on the hair, and the brightness too is increased. The DOTHE producesdeteriorated output as this method introduces artificial colour on the image.Although, WAHE and FPBHE methods produce a comparatively better result (in thecontext of hair of an Old lady) but the output lacks the desired enhancement.The fur of the jacket on the neck of an Old lady got over-enhanced by WAHE andFPBHE methods. On the other side, the image obtained by the proposed methodeliminates all these artefacts. The proposed BPGLA method increases thebrightness of the input image and keeps the desired colour contrast. Fig. 8Open in figure viewerPowerPoint Enhanced output by different methods for colourimages (a) Input and HE, (b) WAHE and AGCWD, (c) ESIHE and MMSICHE, (d) DOTHE and SMIRANK, (e) FPBHE and proposed method For 'Cactus,' the main challenges are to increase the brightness keeping the background and spikes of stem clearly visible. The output image processed by HE contains noise artefacts. The ESIHE and MMSICHE produced under the enhanced image. The background of this image obtained by WAHE, AGCWD, DOTHE, and FPBHE methods are distorted. The image obtained by the proposed BPGLA algorithm provides balanced and enhanced output. The output image preserved the edges as well as natural colour casts. 4.3 Objective analysis The image fidelity parameters like gradient magnitude similarity deviation (GMSD) [30, 31], multiscale contrast similarity deviation MCSD [32], second derivative-like measure of image enhancement [33, 34], edge-based contrast measurement (EBCM) [35], structural similarity index module (SSIM) [36], entropy [37], and peak signal-to-noise ratio (PSNR) [38] values are taken to test the proficiency of the proposed scheme. These parameters are used to represent the quality of the output image. GMSD measures the image quality with the highest accuracy. This index measures the perceptual quality of a distorted image with respect to a reference. It calculates the excellence of the image by conjoining pixel-wise gradient magnitud