1 Introduction

In the field of digital image processing, contrast enhancement plays an essential role in rendering an image clearly recognizable for different imaging applications [1], including computed tomography (CT). Moreover, contrast enhancement allows an easy distinction of the image components through an appropriate upsurge in its contrast [2]. As a result, it provides a better conception of murky images to enhance visual understanding and to enable precise interpretation [3]. Typical viewers refer to the contrast-enhanced images, as if a curtain of fog has been removed from the filtered image. In computed tomography (CT), captured images tend to be low contrast [4-7], which is a prevalent artifact that reduces the image quality and hampers the process of extracting its useful information. Many reasons have contributed to obtain low-contrast CT images, such as using a low-radiation dose during the examination [8], different acquisitions, transmission, storage, display devices, and varied kinds of reconstruction and enhancement algorithms [9]. Similarly, partial volume effects may lead to reduce the contrast of the CT image [10]. Moreover, noise can result in low-contrast images [11]. In addition, denoising filters degrade the contrast, while reducing the noise [12]. These factors cause the unnatural appearance of the image by concealing certain important details. Therefore, specially designed techniques should be applied to obtain a better image resolution without any information about the origin of the source degradation. These techniques are mainly classified as spatial and frequency domain techniques [13]. The most popular contrast enhancement methods are the ones that improve the gray-levels of the image in the spatial domain. These methods consist of log and power-law transformations [14,15]; low-pass, high-pass, homomorphic filtering [3]; histogram equalization [16]; contrast stretching [17]; normalization [18]; and sigmoid function [19]. Recently, histogram modification techniques have received significant attention from researchers because of their direct and instinctive application qualities and their ability to be applied either globally or locally to an image. However, such techniques frequently fail to provide acceptable results for a wide selection of low-contrast images [20]. Histogram equalization (HE) is a common contrast enhancement technique that is widely used by different imaging applications due to its easiness and rapidity [21]. Basically, equalizing the histogram is achieved through the reallocation of pixel values for a given image. However, it has performed poorly in many circumstances because of its drawbacks, such as loss of detail, over enhancement, noise amplification, and the mean shift issue, which produces a remarkable dissimilarity between the illumination of the input and the output images [22]. To overcome the aforementioned drawbacks, various histogram modifications have been proposed to provide more efficient histogram-based contrast enhancement methods, wherein such methods are fully explained in Section 2. Therefore, this study proposes a modified contrast-limited adaptive histogram equalization (CLAHE) technique which can be used to process the low-contrast CT images efficiently. The proposed technique depends on a normalized gamma correction function to improve the unbalanced contrast and reduce the increased brightness of CLAHE. The results obtained through conducting different experiments on various images show a substantial contrast improvement in the filtered images, in which they appear better than their original versions. This article is structured as follows: In Section 2, the related works are adequately explained. In Section 3, the proposed technique is discussed in details. In Section 4, the experimental results and comparisons are exhibited with their related discussions. In Section 5, a summary of important closing remarks is provided.

2 Related works

In this section, many renowned histogram-based techniques are elaborated briefly. After HE, an improved technique was proposed, known as CLAHE [23] to provide a better contrast for the processed images. However, this algorithm also has drawbacks in that it failed to process some CT images properly and produced unsatisfactory results as the images suffered from unbalanced contrast and increased brightness. Such limitations reduced the reliability of CLAHE to be used as a trustworthy enhancement technique for modern clinical routines. In addition, a brightness-preserving bi-histogram equalization (BBHE) technique was proposed [24], which separates the processed image into two sub-images depending on the average of the input image. Then, the two sub-images are equalized individually using the HE method. Related to BBHE, dualistic sub-image histogram equalization (DSIHE) technique was offered [25], which also splits the processed image into two sub-images, but instead of using the average of the input image, it uses its median to increase the entropy of the resulted image. Afterwards, minimum mean brightness error bi-histogram equalization (MMBEBHE) was suggested [26] to reach a greater level of brightness preservation without revealing the unwanted artifacts by using a minimum absolute mean brightness error (AMBE) function. This function achieves the absolute difference between the input and the output mean values to calculate the threshold that disconnect the input histogram. Due to the time-consuming feature of this algorithm, a specific estimation method was used to calculate the values of AMBE recursively to facilitate its implementation. Simultaneously, a recursive mean-separate histogram equalization (RMSHE) technique [27] was proposed by the same authors of MMBEBHE. In this method, the mean of every histogram is calculated iteratively (r) times to produce (2r) sub-histograms. As a result, the resulting image brightness will increase as the iteration number increases. Similarly, a recursive sub-image histogram equalization (RSIHE) technique was offered [28], which splits the histogram using a median split-up method rather than the mean split-up one utilized by the RMSHE. The RMSHE and RSIHE are considered to be improved versions of BBHE and DSIHE. However, they invoke two issues: firstly, the amount of sub-histograms must be to the power of two and, secondly, concerning the manner that the optimum value of (r) is chosen. Likewise, a brightness-preserving dynamic fuzzy histogram equalization (BPDFHE) [29] was proposed. This employs the image fuzzy statistics resulting in a better handling of the gray-level imprecise values to produce an improved image contrast. After that, a non-parametric modified histogram equalization (NMHE) was introduced [13], which owns an independent parameter setting for an image dynamic range. In addition, it employs an amended histogram function to produce an improved image quality. Lately, an exposure-based sub-image histogram equalization (ESIHE) technique was presented [30], which utilizes exposure thresholds to split a given image into a group of sub-images. Next, their histogram is clipped by a calculated threshold from the average number of the available gray-levels. Finally, every sub-image is equalized individually and then, these sub-images are combined together to form the complete image. All the aforementioned methods were developed to be used in many scientific applications except for CLAHE, which was developed to be used for medical applications [31,32]. The early application of CLAHE was on low-contrast CT medical images to improve their poor contrast, in which [32] clarified that it is possible to use this technique for clinical purposes. Therefore, ameliorating the performance of the standard CLAHE is highly desirable since it has a great potential to be applied with modern clinical routines including CT scans.

3 Proposed normalized gamma-corrected contrast-limited adaptive histogram equalization (NGCCLAHE)

Gamma is an essential yet rarely understood property of almost every digital imaging system. It describes the relationship between a pixel’s luminance and its numeric value. The gamma correction process is essentially a gray-level transformation function applied on images to enhance their imperfect luminance. Hence, it can be achieved through the use of a power-law transformation function [33]. The power-law is a suitable multi-purpose function for contrast manipulation in the spatial domain [34]. Usually, this transformation is used to correct the imperfect intensity levels of an image [35]. By changing the gamma γ value, the mapping nature of the input to output intensities also changes [14]. The power-law transformation is mathematically represented as:

$$ R=c{X}^{\gamma } $$
(1)

where R is the gamma-corrected image; X is the original image, in which the pixels values of X must be in the range of 0 to 1; c is a positive constant parameter which controls the brightness; and γ is a positive constant parameter that represents the gamma value [15]. However, the parameter c is removed because increasing its value can cause loss of image details and undesirable brightness, which is not recommended for CT images. Therefore, the optimized power-law P is used in this article, which is expressed as the following:

$$ P={X}^{\gamma } $$
(2)

The advantage of power-law transformation is that the transformation function can be controlled by varying the gamma γ values. Its disadvantage is increasing the γ value would overcompensate the image gamma and thereby darkening the processed image while enhancing its contrast [36]. Conversely, the low-contrast images are characterized by a low-intensity dynamic range. Therefore, it is required to expand this dynamic range to fit its full natural interval. In image processing context, dynamic range expansion which is also named (normalization) is a procedure that alters the range of pixel intensity values, wherein it is applied on images with poor gray-level dynamic range. It is named normalization because it brings the image into a range that is more familiar to the senses [37]. The following normalization equation is used to linearly scale pixels to fit its full natural range:

$$ N=\frac{\left[X- \min (X)\right]}{\left[ \max (X)- \min (X)\right]} $$
(3)

where X represents the input image, N represents the normalized image, and the min and max operators are employed to get the maximum and minimum pixel values in a given image, respectively. In this study, a newly developed function named normalized gamma correction (NGC) is introduced to exploit the disadvantage of gamma correction as a key advantage that assists in reducing brightness and enhancing the contrast while taking into consideration the full dynamic range feature of normalization. The NGC equation is written as the following:

$$ \mathrm{N}\mathrm{G}\mathrm{C}=\frac{\left[P- \min (P)\right]}{\left[ \max (P)- \min (P)\right]} $$
(4)

As a final point, adding the NGC function to CLAHE can significantly improve its performance, wherein this function helps to reduce the brightness and enhance the contrast of the degraded image. Hence, when applying the CLAHE technique, it can further improve the contrast and increase the brightness of the image. As a consequence, the increased brightness and the unbalanced contrast of CLAHE are adjusted and an adequate visual quality for the processed images is attained. The proposed NGCCLAHE improves the contrast of a given image in seven separate steps as proposed in Algorithm 1, in which steps 2–7 have been established based on [38,39].

Algorithm 1: NGCCLAHE

Step 1: Use the NGC function in Equation 4 to adjust the image contrast as an initial processing phase.

Step 2: Divide the adjusted image into a number of equal-sized and non-overlapping regions called tiles, with each having the size of M × N: This division results in three different groups of regions. The first group is called corner regions (CR), which contains the four corner regions. The second group is called border regions (BR), which contains all the border regions, except for the corner regions. The third group is called inner regions (IR), which contains the rest of the image regions. For example, if the size of a given image is 512 × 512, it can be divided into 64 regions with each having the size of 8 × 8 to attain a decent statistical estimation. An illustration of such division is displayed in Figure 1. In this study, the size of tiles is set to 8 × 8.

Figure 1
figure 1

The organization of regions in a 512 × 512 image.

Then, for each region, perform the following:

Step 3: Determine the local histogram of the region: In this step, the number of grayscales that have the same value is counted for every grayscale in the region. The process of collecting these counts for all grayscales is called histogram, which can be achieved using a cumulative distribution function (CDF). For each region, assume M and N are the number of pixels, h i,j (n) for n = 0, 1, 2,…, N − 1 is the histogram of an (i, j) region. Then, the corresponding CDF is calculated as:

$$ {f}_{i,j}(n)=\frac{\left(N-1\right)}{M}\cdot {\displaystyle \sum_{k=0}^n}{h}_{i,j}(k) $$
(5)

where h i,j (k) is the histogram of pixel k, and n = 0, 1, 2,…, N − 1.

Step 4: Calculate the clip limit value: The clip limit β can be determined using the following equation:

$$ \beta =\frac{M}{N}\left(1+\frac{\alpha }{100}\left({s}_{max}-1\right)\right) $$
(6)

where α is the clip factor, in which its value can be between 0 and 100. s max is the maximum allowable slope, in which its value can be between 1 and s max.

Step 5: Clip the histogram that exceeds its related clip limit: This step modifies the histogram based on the obtained clip limit by limiting the maximum number of counts, for every pixel to β. This can be archived by retaining the histograms that are less or equal to β, while clipping the ones that exceed β.

Step 6: Redistribute the values of the clipped histograms to all the histogram bins: In this step, a recursive uniform distribution of the extra counts that exceeded the clip limit is carried out among pixels with counts less than or equal to β. This once more shoves certain counts over the clip limit as in Figure 2b. Therefore, the resultant excess is redistributed again, and the process is repeated until the clip limit is not exceeded by any counts (histogram bins) any more. Hence, the redistribution of counts may require several iterations for each histogram. The clipping and redistribution processes are described in Algorithm 2 and shown in Figure 2.

Figure 2
figure 2

The clipping and redistribution processes. (a) Detecting the exceeded counts; (b) distributing the extra counts uniformly.

Step 7: Calculate the new pixel values using mapping functions based on the new histogram redistribution: In this step, three mapping functions are used to calculate the new pixel values depending on their locations for the contrast-limited regions. For inner regions, the mappings of four nearest neighboring regions are used to determine the mapping of every quadrant in the region. For instance, with regard to Figure 3a, a specified pixel in quadrant 1 of (i, j) region is mapped depending on its horizontal and vertical distances from the centers of (i, j), (i, j − 1), (i − 1, j), and (i − 1, j − 1) regions, in which these distances are illustrated in Figure 3b. The new value of pixel p in quadrant 1 of (i, j) region is calculated as:

Figure 3
figure 3

The neighborhood structure of inner regions. (a) A specific inner region with its bordering regions. (b) Pixel p from quadrant 1 and its relation with the centers of its four nearest regions.

$$ \begin{array}{c}\hfill {p}_{\mathrm{new}}=\frac{s}{r+s}\left(\frac{y}{x+y}{f}_{i-1,j-1}\left({p}_{\mathrm{old}}\right)\right.\left.+\frac{x}{x+y}{f}_{i,j-1}\left({p}_{\mathrm{old}}\right)\right)\hfill \\ {}\hfill +\frac{r}{r+s}\left(\frac{y}{x+y}{f}_{i-1,j}\left({p}_{\mathrm{old}}\right)\right.\left.+\frac{x}{x+y}{f}_{i,j}\left({p}_{\mathrm{old}}\right)\right)\hfill \end{array} $$
(7)

where r, s, x, and y are specified distances which are defined in Figure 3b. f i,j (·) is a cumulative distribution function. The new pixel values for quadrants 2, 3, and 4 of (i, j) region are computed in the same way. For border regions, the neighborhood organization is divergent as one such situation is shown in Figure 4a. Regarding this situation, the pixel neighborhood organization which is in quadrant 1 or 3 is similar to that of inner group regions, while it is different for quadrant 2 or 4 as one such situation of quadrant 2 is shown in Figure 4b. The new value of pixel p in quadrant 2 of (i, j) region is calculated as:

Figure 4
figure 4

The neighborhood structure of border regions. (a) A specific border region with its bordering regions. (b) Pixel p from quadrant 2 and its relation with the centers of its four nearest regions.

$$ {p}_{\mathrm{new}}=\frac{s}{r+s}{f}_{i,j-1}\left({p}_{\mathrm{old}}\right)+\frac{r}{r+s}{f}_{i,j}\left({p}_{\mathrm{old}}\right) $$
(8)

The new pixel values for quadrant 4 of (i, j) region are computed in the same way. For corner regions, different characteristics are observed for different quadrants as shown in Figure 5. From the previous figure, it can be seen that quadrant 4 has neighborhood organization like those of inner regions, while quadrants 2 and 3 have neighborhood organizations like those of border regions. However, quadrant 1 is the only one of its kind and has no contact with other regions. The new value of pixel p in quadrant 1 of (i, j) region is calculated as:

Figure 5
figure 5

The neighborhood structure of a corner region.

$$ {p}_{\mathrm{new}}={f}_{i,j}\left({p}_{\mathrm{old}}\right) $$
(9)

where the other corner regions are mapped in a similar way. Finally, the newly obtained pixel values are stored in a new array that the size of which is similar to the original image to form the new enhanced image.

Algorithm 2: The processes of pixel clipping and redistribution.

4 Results and discussion

In this section, the experimental results are demonstrated to validate the efficiency of the newly proposed form of histogram modification in comparison with different versions of renowned histogram-based techniques. The proposed NGCCLAHE is examined on a dataset of low-contrast CT images. The dataset used in this study consists of real and synthetic degraded low-contrast grayscale CT images obtained from different medical databases, such as ctisus.com, radpod.org, and MedPix. Evaluating the amount of enhancement applied to an image is a challenging task. Although it is necessary to use an impartial assessment method to compare the different contrast enhancement procedures, regrettably, there is no adequate standard that provides meaningful outcomes [40]. Although many methods exist to measure the contrast enhancement for an image, most provide faulty or unrealistic results. Human sight remains the best assessment method for the amount of contrast enhancement. However, it is preferred to use a certain assessable measure along with human vision. Therefore, the author studied various accuracy assessment techniques that are suitable to measure the improvement of contrast. Accordingly, the author decided to use the Universal Image Quality Index (UIQI) [41], Structural Similarity Index (SSIM) [42], and Feature Similarity Index (FSIM) [43]. These metrics utilize different image characteristics to measure the accuracy, wherein the UIQI uses the loss of correlation, luminance distortion, and contrast distortion, while the SSIM employs the structural information and the FSIM utilizes the low-level details. Regarding their output, it equals to 1 when the two compared images are identical. However, if the output is near 1, it indicates high-quality results, while the contrary is considered when the output is near 0. The proposed technique has been verified on various images for which some of the results are exhibited in this article. To demonstrate the efficiency of the proposed technique, an experiment using naturally degraded CT images with NGCCLAHE and CLAHE was conducted, in which the enhanced images using NGCCLAHE performed the best as the resulting images had a natural look with no visible artifacts and acceptable visual quality. Likewise, the images enhanced by CLAHE had a relatively increased brightness and unbalanced contrast. Figures 6 and 7 show the results of enhancing real-degraded CT images by the proposed NGCCLAHE and CLAHE techniques. Furthermore, another comparison was achieved using synthetically contrast-reduced images. The reason being was to measure the accuracy of the processed images using a suitable metric. Since improving the low contrast of CT images is done using nonlinear enhancement methods [44-46], the contrast of the comparable images was reduced nonlinearly by different rates. Then, it was enhanced using HE, CLAHE, BBHE, DSIHE, MMBEBHE, RMSHE, RSIHE, BPDFHE, NMHE, ESIHE, and NGCCLAHE. It is important to mention that the proposed NGCCLAHE is considered as a nonlinear enhancement technique because the gamma correction and CLAHE are considered as nonlinear enhancement methods [31]. The comparison results are shown in Figures 8, 9, and 10. Table 1 presents the recorded accuracy by UIQI, SSIM, and FSIM and the consumed time of the comparison. Figures 11 and 12 demonstrate the analytical graphical charts of the average records of UIQI, SSIM, and FSIM metrics and the consumed time, respectively. Figures 6 and 7 contain three columns organized from left to right. The first column represents naturally degraded low-contrast CT images. The second column represents enhanced images by the proposed NGCCLAHE. The third column represents enhanced images by CLAHE.

Figure 6
figure 6

Enhancing real-degraded brain CT images. (C1) naturally degraded low-contrast CT images; (C2) enhanced by NGCCLAHE; (C3) enhanced by CLAHE.

Figure 7
figure 7

Enhancing real-degraded CT images. (C1) naturally degraded low-contrast CT images; (C2) enhanced by NGCCLAHE; (C3) enhanced by CLAHE.

Figure 8
figure 8

The true CT images used in the comparison.

Figure 9
figure 9

Enhancing a synthetic-degraded CT image by the proposed and the comparative techniques. (a1) A degraded CT image (low contrast reduction); Images enhanced by (b1) HE, (c1) CLAHE, (d1) BBHE, (e1) DSIHE, (f1) RMSHE, (g1) MMBEBHE, (h1) RSIHE, (i1) BPDFHE, (j1) NMHE, (k1) ESIHE, and (l1) proposed NGCCLAHE.

Figure 10
figure 10

Enhancing a synthetic-degraded CT image by the proposed and the comparative techniques. (a2) A degraded CT image (high contrast reduction); Images enhanced by (b2) HE, (c2) CLAHE, (d2) BBHE, (e2) DSIHE, (f2) RMSHE, (g2) MMBEBHE, (h2) RSIHE, (i2) BPDFHE, (j2) NMHE, (k2) ESIHE, and (l2) proposed NGCCLAHE.

Table 1 The recorded accuracy and time of the previous comparison
Figure 11
figure 11

The analytical chart of the average accuracy achieved by UIQI, SSIM, and FSIM metrics.

Figure 12
figure 12

The analytical chart of the average time consumed by the comparable methods.

Based on the obtained results, the proposed technique performed the best in terms of UIQI, SSIM, FSIM, and image visual quality as it scored the highest accuracy values for all the used images. Likewise, the images enhanced by CLAHE had a relatively unbalanced contrast. Additionally, HE gave the worst performance as the resulting images were over-enhanced, had unrealistic contrast, and were affected by visual flaws. Moreover, the output of the BBHE method possesses a bad contrast and is somehow different to the original images. In addition, the MMBEBHE, DSIHE, RMSHE, and RSIHE methods fail to process the input CT images as the results have a comparatively low unrealistic contrast with visual errors appearing on the processed images. Besides, the BPDFHE, NMHE, and ESIHE methods provided a minor contrast improvement without generating any unwanted artifacts. However, they did not reach the desired level of enhancement. As known, the histogram-based techniques involve many calculations. Therefore, the proposed technique is compared to the other techniques in terms of consumed time, wherein all the methods were executed using a 2.3 GHz Core i5 processor and an 8 GB of memory. As seen in Table 1 and Figure 12, the proposed technique required a moderate operation time compared to the other comparative techniques as its results are obtained in an average of 0.3 second. Moreover, the performance of NGCCLAHE was extremely satisfactory as the resulting images appeared more natural and had a better contrast than the other comparative techniques.

5 Conclusions

An innovative technique for contrast enhancement is proposed in this article, which is convenient for low-contrast CT images. The novelty of the proposed technique lies in the use of a neatly designed NGC function to improve the enhancement ability of CLAHE. Therefore, the enhanced images have a natural appearance without generating the unwanted processing flaws that reduce their visual quality. The experimental results exhibit the efficiency of the proposed technique in comparison to ten well-known state-of-the-art contrast enhancement techniques by using three advanced image quality assessment metrics of UIQI, SSIM, and FSIM. The HE, BBHE, DSIHE, RMSHE, MMBEBHE, and RSIHE techniques produced visible flaws with unrealistic contrast. Moreover, the CLAHE, BPDFHE, NMHE, and ESIHE produced unbalanced contrast with less visual errors than the six aforementioned methods. Finally, the proposed technique performed the best in terms of accuracy metrics and visual quality, as it provided the highest accuracy values and adequate quality with natural appearance results.