Keywords

1 Introduction

Medical images contrast plays extremely important role during visual inspection of the internal structure of the human body for issuing correct diagnosis and further treatment of patients. Over the years there are many proposed techniques for contrast enhancement [1,2,3].

One of the more recent studies related to the CT image analysis, using deep learning, also include an aspect of predicting the contrast enhancement [4]. A number of maps, such as class activation, its gradient-weighted variant, saliency and backpropagation modifications are combined in a new type of a map which further eases the prediction process. As a result voxel visualization is reported to be more clear and allows for more precise feature selection to improve overall accuracy. Prediction probability for some of the modifications tried goes over 90% with registering higher specificity for the saliency map in particular.

Kallel and Hamida [5] rely on more direct approach, that is the discrete wavelet transform with singular value decomposition in order to implement adaptive gamma correction. Singular values are found from the low-low frequency sub-band and then modified by a factor, followed by classification of the whole sub-band into low and average contrast types. Adaptive gamma correction is applied over the low contrast areas. All these steps take place in wavelet domain prior restoring the final enhanced image. Increased efficiency is reported over other well-known methods.

Another recent approach for CT contrast enhancement [6] employs clustering-based algorithm where the input image is at first converted through one-dimensional separation on a column basis. Then, data sorting of the elements follows prior the clustering of subsequent elements, ending with a labeling in order to get the output image. As main benefit of the approach, it is pointed out its lower processing time with regards to 5 other algorithms.

Enhancement of X-ray images also has its own development in the recent years. Irrera et al. [7] apply multiscale contrast enhancement after patch-based filtering of X-ray images. Noise presence is estimated in a parametric fashion in order to optimize the level of contrast increase without corrupting intolerably the quality of output images. Visual evaluation, as well as the signal and contrast to noise ratios, prove the proposed approach applicable. Kushol et al. [8] achieve contrast enhancement of X-ray images by morphological operators. They apply the top-hat and bottom-hat operations and the parameters of the structuring element are autonomously estimated from the intensity gradient over processed area. Visual comparison of resulting images with the contrast-limited adaptive histogram equalization (CLAHE) proves the applicability of this technique. Another autonomous algorithm [9] making use of CLAHE at the addition of noise and high-pass filters aims to adapt its performance based on few tunable parameters to the modality being registered. Around 48% of the test database involved in the study got highest evaluation score of 5 as a subjective measure, given by medical personnel and other experts.

The aim of the study presented in this paper is to evaluate the performance of the three of the most popular image contrast enhancement algorithms – histogram equalization, image adjustment and CLAHE when applied on CT and X-ray images for unsharp masking. Based on experimental results, simple general purpose algorithms for selecting the optimal parameters of all input arguments for these algorithms are proposed in Sect. 2. Their efficiency is presented in Sect. 3 where the experimental results are reported. In Sect. 4 a conclusion is made.

2 Algorithms Description

The well-known unsharp masking algorithm for general purpose images [3], especially in photography, is given in Fig. 1. In its form here, it takes a grayscale input image I(i,j), where i and j are the spatial coordinates of the pixels. In order to get a better contrast and details, a Gaussian kernel [10] blurs it to G(i,j) and by subtracting with the original a contour mask C(i,j) is found. After applying any contrast enhancement algorithm the resulting image E(i,j) is combined with I(i,j) and C(i,j) to get the final result O(i,j).

According to the purpose of the current study, three of the most popular contrast enhancement algorithms are tried within the unsharp masking scheme – the histogram equalization (histeq) [1], image intensity adjustment (imadjust) [2] and the contrast-limited adaptive histogram equalization (CLAHE, adapthisteq) [11].

Fig. 1.
figure 1

General unsharp masking scheme

Since histeq has the number of histogram bins (2n, n = 1, 2, 3,…) as input argument, the imadjust – the clipping limit cl of the intensity level in the range of low intensities and (1 − cl) – in the high, and the CLAHE – the tile size over one dimension m, again the clipping limit cl, and the number of histogram bins 2n, there is a need to select those based on certain criteria. A simple way of doing so, is to seek for the highest possible root mean square contrast RMSC [12]:

$$RMSC = \sqrt {\frac{1}{MN}\sum\nolimits_{i = 0}^{M - 1} {\sum\nolimits_{j = 0}^{N - 1} {\left( {O\left( {i,j} \right) - \overline{O}} \right)^{2} } } } ,$$
(1)

where M and N are the number of rows and columns of the resulting image O with its mean intensity \(\overline{O}\). In addition to that one would expect also as high as possible sharpness (Shrp) [13] of the image which could be found over particular direction (d), according to:

$$Shrp_{d} = \frac{1}{P}\left( {T_{1} - T_{2} } \right)\sum\nolimits_{p = 1}^{P} {S_{p}^{2} } ,$$
(2)

where T1 and T2 are the maximum and minimum densities of an area of the image over which the Shrpd is sought; P – the number of points through which the change of the intensity profile Sp (slope) is traced. More generally, the sharpness as a vector filed could be found from the gradient of the intensity in all image points. The norm of that vector is what is used as a scalar in this study.

It may turn out that both the RMSC and Shrp could rise or fall monotonically without any expressed maximum and in the same time the quality of the processed image decrease significantly, rendering it unusable. In order to avoid that, the peak signal-to-noise ratio (PSNR) [3] and the structural similarity index (SSIM) [3] are used as limiting factors into the selection of appropriate input arguments for the contrast enhancement algorithms. Optimal selection for histeq and imadjust is given in Fig. 2.

Fig. 2.
figure 2

Finding optimal parameters for histogram equalization (a) and image adjusting (b)

The three input arguments for the CLAHE algorithm could be found, following the iterative approach, presented in Fig. 3.

Fig. 3.
figure 3

Finding optimal parameters for contrast-limited adaptive histogram equalization

3 Experimental Results

The test database consists of 103 CT images with dimensions 512 × 512 pixels each, 16 bpp, part of the DeepLesion gathering [14] and 105 X-ray images, 1024 × 1024 pixels in size, with 8 bpp representation, which come from the ChestX-ray8 [15] collection. All experiments are implemented on a desktop computer with Intel Core i5 x64 processor, having 4 cores and operating at 3.1 GHz, 12 GB of RAM under the control of Linux Ubuntu LTS 14.04. The simulation environment is Matlab R2016a.

The only adjustable parameter for the histeq algorithm, being the number of bins to process from the histogram of the input image 2n, is found to be 64, that is n = 6. While the average RMSC and Shrp from all CT images are high for n = 1, around 0.5 and 0.028, respectively (Fig. 4), the PSNR and SSIM for the processed images are too low, below 10 dB and 0.3 in the same time. A saturation for the similarity from above between the original image and enhanced one is observed for n = 6 and higher, where SSIM reaches around 0.6. That bound is thought to define the optimal n. Similar results are obtained for the X-ray images.

Fig. 4.
figure 4

Finding the optimal number of bins for the histogram processed by histeq

Analogous approach is undertaken when estimating the optimal clip limit for the imadjust algorithm. Both the RMSC and Shrp parameters rise monotonically but SSIM starts to fall from almost 1 after cl = 0.01 and PSNR drops significantly below 50 dB after that value which means significant deterioration of the image structure. Hence, clopt is selected to be 0.01. This result is true for both CT and X-ray images.

CLAHE supports high RMSC and Shrp for 2 histogram bins (n = 1) – around 0.18 and 0.016, respectively, which decrease gradually to 0.02 and 0.002 for n = 8 in the case of CT enhancement. PSNR and SSIM however constantly rise close to 35 dB and 0.99, respectively. The observed change of RMSC for X-ray images is from around 0.195 up to 0.245, and Shrp changes from 0.01 up to 0.022 in the interval [1, 8] for n. SSIM is above 0.8 when n n = 8. That’s why all subsequent experiments use n n = 8. In Fig. 5 the mutual influence of the clip limit (cl – from 0 to 0.3) and tile size (m – from 2 × 2 to 64 × 64 pixels) reveals significant change in RMSC and Shrp of enhanced CT images.

Fig. 5.
figure 5

Finding the optimal clip limit and tile size for the adapthisteq

The highest RMSC is obtained for cl = 0.3 (Fig. 5a) but PSNR drops below 20 dB (Fig. 5c) and SSIM is around 0.7 (Fig. 5d). There is almost none dependency on the tile size for all four parameters at fixed cl. In order to get most of the details in the image preserved the following selection is made – clopt = 0.01 and m = 1 (2 × 2 tile).

The average RMSC, Shrp and processing time for each of the tested contrast enhancement algorithms, when applied separately outside the complete unsharp masking procedure, are presented in Table 1. It seems that histeq and adapthisteq are close one to each other and better than imadjust with regards to all 3 registered parameters. The adapthisteq leads to higher sharpness in X-ray images but is slower than histeq for both types of images. The fastest algorithm is imadjust.

Table 1. Average performance for histeq, imadjust and adapthisteq alone.

Table 2 contains the final average RMSC, Shrp and processing time, which represents the period needed for the Gaussian blurring, finding the contour mask and the fusion of it with the original and the contrast enhanced image (Fig. 1). The optimal parameters of the Gaussian kernel, found empirically based on highest RMSC and Shrp in a separate experiment carrying out test unsharp masking, are σ = 10 for the CT and σ = 0.8 for the X-ray images. Naturally, the Time is higher for the X-ray images due to their higher resolution. The histeq algorithm has the peak values of RMSC but comparable to those for adapthiseq and for the X-ray photos Shrp is higher for the adapthisteq. Both parameters are considerably lower for the imadjust algorithm.

Table 2. Unsharp masking average evaluating parameters.

The visual comparison between input and processed images (Fig. 6) show more details in the range of the low and high intensities from the human body when employing adapthisteq algorithm in the unsharp masking. Slightly lower contrast and some more difficult to distinguish areas appear in images, obtained with the histeq algorithm. The overall contrast and some of the details’ visibility are lower for the imadjust with comparison to the other two algorithms.

Fig. 6.
figure 6

Original – a (CT), e (X-ray), and processed by histeq – b, f, imadjust – c, g, and adapthisteq – d, h images

4 Conclusion

In this paper simple optimization procedures are presented for the histogram equalization, intensity adjusting and the contrast-limited adaptive histogram equalization algorithms in order to find optimal parameters for them. The root mean square contrast, the sharpness and structural similarity between the contrast enhanced and original image play the role of target parameters. Tests with CT and X-ray images confirm the plausibility of the undertaken approach and the applicability of resulting images for the unsharp masking algorithm to use them as input. The contrast-limited adaptive histogram equalization yields more detailed and contrast enhanced final images, followed by the histogram equalization and the image adjusting algorithms at the price of more computational time. The unsharp masking in this general and easy to implement form is thought to be an useful tool for medical imaging purposes.