1 Introduction

Improving medical imaging has revolutionized the medical field by improving image quality, and thus, helping doctors diagnose patients’ diseases [11, 23]. Indeed, the processing of these images allows doctors to see fine details of the images that are difficult to detect or distinguish just by using the naked eyes. There are different medical imaging modalities such as computed tomography (CT), magnetic resonance imaging (MRI), positron emission tomography (PET), X-ray, PET-CT, and biomarkers. Among these, digital X-rays have been widely used for image acquisition in the field of medical imaging because they are reliable and affordable [13, 23]. X-ray imaging has been accepted as a diagnosis tool to facilitate fast checkup for the doctors. It displays a wide range of potential information and details regarding the patient’s health. The output scan pictures are examined by practitioners where the symptoms can be analyzed just by looking at these images. In other words, X-rays are essential for the management of various diseases associated with high mortality since they are used to guide the diagnosis and then to plan the therapeutic intervention.

The appropriate visual characteristics that determine the quality of radiological images are density and contrast. A specific medical test should never influence a correct diagnosis. Although these images contain large amount of information, the details could be unclear and the contrast is low in most cases [34]; the main causes of the poor quality of such images come from the limitation of acquisition devices, transmission via a noisy channel and defective memory locations in equipments, and insufficient lighting during image capture or adverse external conditions during image acquisition [42]. Thus, the image may be affected by contrast, noise, loss of information, insufficient illumination, blur, and incorrect color balance [36].

Improving contrast of images and sharpness of details while suppressing noise is therefore considered a necessity in the medical field [34]. Image enhancement involves manipulating an image by modifying its attributes to produce more appropriate and meaningful result for a specific task and human viewer. Also, image optimization aims to improve the interpretability of the information contained in images for viewers and provide better information for other automatic image processing approaches, such as segmentation, detection, and recognition. The images, after improvement, are transformed into an appropriate representation of the subtle details and without undesirable deterioration [36].

1.1 Related works

Image enhancement has become an innovation issue that covers wide topics and can be applied to different domains. It can be classified into two categories: spatial domain methods which directly deal with image pixels to achieve desired enhancement and frequency domain methods that utilize Fourier transform technique [5, 13, 15, 22]. Here, this study reviews current approaches for brightness and contrast adjustment–related works invariant for image and X-ray enhancement.

1.1.1 Enhancement via conventional approaches

Among the works that have focused on image enhancement using conventional approaches, [16] overcame the problem of the typical histogram equalization (HE) by proposing a novel extension referred to as the mean preserving bi-histogram equalization (BBHE). The main objective of the proposed algorithm is to preserve the mean brightness of the input image while enhancing its contrast.

The authors in [40] have proposed histogram-modified contrast limited adaptive histogram equalization (HMCLAHE) which incorporates histogram modifications as an optimization technique and contrast limited adaptive histogram equalization (CLAHE) [45] to adjust and enhance the level of contrast giving the output image a strong contrast and bringing the local details for more relevant interpretation.

The dynamic histogram equalization (DHE) method [1] was developed to take control over traditional HE for appropriate contrast enhancement of images without introducing any severe side effects. The work presented in [39] proposed a scheme based on a generalization of histogram equalization for adaptive image contrast enhancement.

Other works focused on using filtering techniques for image enhancement. The authors in [9] developed a contrast enhancement method using adaptive high-pass (HP) filter combined with low-pass (LP) filter to obtain an adaptive image enhancement filter. A combination of wiener [19] and median [20] filters along with HE and gamma correction (GC) was proposed in [41] to remove salt and pepper noise, enhance the image contrast, and maintain the brightness level.

In [12], a method that modifies histograms and enhances contrast in digital images, referred to as AGCWD (adaptive gamma correction with weighting distribution), was proposed. This automatic transformation uses adaptive gamma correction to increase the low intensity and avoid decrement of the high intensity. Then, the weighting distribution function is applied to modify the statistical histogram and lessen the generation of adverse effects and probability distribution of luminance pixels.

1.1.2 Enhancement using fuzzy logic

Fuzzy logic is a technique that has proved its effectiveness in image enhancement and has yielded advantageous results. The authors in [35] proposed a combination of fuzzy models for nonlinear filtering and edge detection to enhance and address low-contrast and nonuniform illumination in images.

The authors in [31] proposed an algorithm for contrast enhancement and natural characteristic preservation of images. To this end, the fuzzy similarity index (FSI) and fuzzy contrast factor (FCF) were used to develop fuzzy measures of dissimilarity of pixels. Based on FCF, a fuzzy dissimilarity histogram is developed for global contrast enhancement and incorporation of contextual information of the image. FSI and coefficient of the covariance are used to develop a new fuzzy membership function. Then, a new contextual intensity transfer function using contextual information along with intensity is introduced.

The work cited in [10] dealt with low-contrast and nonuniform brightness grayscale images. The proposed fuzzy enhancement technique introduced a contrast factor used to divide the degraded image into bright and dark regions. The enhancement process is then performed separately according to the image’s respective regions in order to preserve brightness and details without amplifying existing noises.

In [14], a fuzzy-based adaptive contrast enhancement (FACE) method is proposed. It is capable of treating each pixel differently based on its neighborhood characteristics by computing contrast gain values using a fuzzy inference system. FACE has advantages in dealing with noise amplification and increasing image sharpness. It has a limited level of contrast enhancement and a deficient improvement of image brightness.

The authors in [21] focused on image brightness preservation while improving local contrast of the original image. Their fuzzy logic–based histogram equalization (FHE) method uses fuzzy set theory to compute fuzzy histogram. Then, the fuzzy histogram is separated into two based on the median value of the original image. Finally, the contrast is improved by applying HE independently on each subhistogram.

In [30], a new method of contrast enhancement is proposed using fuzzy logic interpolation. This method defines pixel intensity level transformation function from a set of locally stretched pixel intensity.

A brightness preserving dynamic fuzzy histogram equalization (BPDFHE) method [38] was introduced as an enhanced version of brightness preserving dynamic histogram equalization (BPDHE) [17] to improve its brightness preserving and contrast enhancement abilities while reducing its computational complexity. Fuzzy statistics of digital images are used for their representation and processing in order for the technique to handle the inexactness of gray level values in a better way.

1.1.3 X-ray brightness adjustment methods

X-ray images are mainly used for diagnosis purpose; although they have a major impact in the medical field, limited works have focused on their enhancement. Among these, the work cited in [23] aims to develop a system that automates the image enhancement process by implementing HE, GC, and log transformation (LT) using image statistics.

In [18], the authors have proposed adaptive contrast enhancement algorithms, which are based on the segmentation of the image area with a relatively high density of dark elements.

The paper [34] proposes a new type of homomorphic filter using a total variation model as a transfer function offering balance between brightness adjustment and detail improvement.

The authors in [11] presented an algorithm that includes two-step filtering and contrast enhancement for radiological images. They proposed a method using an adaptive median filter and a bilateral filter. This method removes the mixed noise that contains Gaussian and impulsive noises, while preserving important structures (e.g., edges) in images. Then, the contrast of the image is improved using grayscale morphology and CLAHE.

The AFELCE method, short for adaptive fuzzy exposure local contrast enhancement, proposed in [36], is specifically designed to improve the contrast by using specific algorithms for different regions. The AFELCE technique successfully enhanced the contrast of 300 low-contrast and nonuniform lighting images taken from three databases, namely standard, underwater, and microscopic human sperm (MHS) images.

The work cited in [25] focused on spine X-ray enhancement by employing GC as a nonlinear contrast adjustment scheme for noise reduction. This was achieved by investigating the GC filter with variable gain factor value; then, a new algorithm for adaptive gain factor detection was developed based on statistical pixel-level features extraction and traditional artificial neural networks model as a classifier to find the best gain factor.

1.2 Contribution

State-of-the-art X-ray screening systems for medical applications offer a variety of “image enhancement” functions as color inversion, edge-enhancement, and indirect contrast enhancement techniques. They are often encouraged because they bring details that are obscured or highlight certain features, but still face various problems and challenges in improving computer radiography [25, 26]. Thus, this work presents an additional effort that was made to study the effect of the modeling approach for adjusting the contrast of radiographic images and is compared with the previous studies. The aim of this work is to establish a framework that adaptively enhances contrast and quality of X-rays for a better diagnosis procedure in medical usage, with the primary goal of distinguishing between regions of interest and background-based contrast adjustments. The main objective of this work is to design a new FGRM approach based on GC filter and fuzzy logic model that is effective for nonuniform brightness and contrast adjustment in cervical, lumbar, and hand X-rays. Various advanced methods such as BPDFHE, GC, LT, mean filter, median filter, contrast stretch (CS), CLAHE, HE, and AGCWD are examined to evaluate the FGRM approach. Blind references based on two modes including statistical measure and DL descriptor are examined to validate the proposed approach.

The main contribution here can be considered as follows: (1) the FGRM shows robust results with all examined databases that suffer from low contrast, compared with the previous studies, and (2) the FGRM reflects good results in both subjective and objective measurements, contrary to other methods where both measurements are not correlated in most cases.

The paper organization is as follows: Section 2 focuses on the conceptual framework and methodology of the proposed approach. The experimental results are presented in Section 3, overall performance is discussed in Section 4, and concise conclusions are presented in Section 5.

2 Methodology

2.1 X-ray databases

Two types of X-ray images were examined in this study. The first type refers to the human spine containing 242 cervical and lumbar digital radiographs obtained from the second National Health and Nutrition Survey (NHANES II) - National Institutes of Health (NIH) [25]. Figure 1a, b shows type 1 samples comprising cervical (C1 to C7 vertebrae) and lumbar (L1 to L5 vertebrae), respectively. This collection of data is useful for analyzing and assessing (a) the irregularity of a bone fracture [4], (b) disk space narrowing degradation [24], (c) identify congenital abnormalities and spinal curvatures such as kyphosis or scoliosis, and (d) can also be performed to diagnose causes of back or neck pain, dislocation of vertebrae, or more importantly, bone injuries and tumors.

Fig. 1
figure 1

A sample of X-ray images for different subjects. a Cervical. b Lumbar. c Hand

The second type concerns 180 samples of human’s left hand taken from Children Hospital Los Angeles, consisting of 19 categories of age (newborn, age 1 to 18) coupled with eight categories of race and gender including Caucasian, African-American, Hispanic, and Asian for both man and woman. This type of data is useful for assessing and predicting bone age through the phalangeal and carpal bones [6], as shown in Fig. 1c [32, 44]. In addition, these predictions and assessments are crucial for the diagnosis and assessment of growth and endocrine disorders, the prediction of adult size for small patients, or when hormone therapy is used.

Unfortunately, the datasets collected are of low contrast and quality; they do not provide correct information on pathologies that interest medical researchers. Thus, the proposed solution increases the contrast and enhances the quality of X-ray images to provide sufficient visual information to the radiologist.

2.2 Proposed solution

The basic concept of the proposed solution, based on fuzzy gamma reasoning model (FGRM) for improving X-ray image quality for medical purposes, is presented in Fig. 2. Three steps were used to construct the proposed FGRM algorithm: (1) pre-processing, (2) fuzzy model to predict adaptive GC gain, and (3) image quality evaluation using the adaptive GC.

Fig. 2
figure 2

The proposed approach based on FGRM

2.2.1 Preprocessing

The idea behind the proposed algorithm began with the visual inspection of the three datasets used, of poor quality due to the uneven distribution of brightness and illumination. Thus, it is possible to improve the quality of these images by using filtering processes that work adaptively according to local characteristics [26]. To do this, the first step can be performed by applying adaptive equalization of the histogram with limited contrast (CLAHE) to the input image. Second, the resulting image is then processed by extracting two similar blocks, defined as foreground (FG) and background (BG), as shown in Fig. 2 (subdivision block). FG is considered as the block size of the windows (1/n × 1/m, n and m are the height and the width of the image, respectively) located in the center of the image, representing the highest possible brightness density of the bone. While BG is considered, with the same block size, as the upper-right corner, representing the background brightness density of the image. The average intensities of both blocks were examined as inputs to the fuzzy model.

2.2.2 Fuzzy model

Fuzzy logic is a computational paradigm that allows manipulating information and reasons in a very similar way to human reasoning [4]. Fuzzy image processing is a form of information processing for which both input and output are images. The proposed system for low-contrast X-ray image enhancement can be partitioned into 3 stages: fuzzification, inference system, and de-fuzzification.

3 Fuzzification: fuzzy sets

At this stage, the average intensities (δFG) and (δBG) measured from both of the blocks (FG) and (BG), respectively, identified earlier are fuzzy sets used as inputs to the fuzzy model. Due to the importance of the average intensity (δFG), representing the foreground of the image, seven fuzzy sets in total, abbreviated HD, D, LD, U, LB, B, and HB, are used to represent it. Whereas, the second average intensity (δBG), expressing the background of the image, is represented with two fuzzy sets: DB and LB. Tables 1 and 2 summarize the linguistic terms of the first and second input variables, respectively, and the membership functions of the foreground and background variables are shown in Figs. 3 and 4, respectively.

Fig. 3
figure 3

Membership functions of the foreground input variables

Fig. 4
figure 4

Membership functions of the background input variables

Table 1 Linguistic variables of foreground and their ranges
Table 2 Linguistic terms of the background variable with ranges

The purpose of the FGRM model is to predict the gamma value and feed it to the GC function for adaptive noise reduction and contrast enhancement. The expected gamma value is the minimum value from the pair (g1, g2) produced using FGRM. Figures 5 and 6 show the membership functions of output variables g1 and g2.

Fig. 5
figure 5

Membership functions of g1 output bvariables

Fig. 6
figure 6

Membership functions of g2 output bvariables

Figure 7 illustrates the investigation to optimize the G value prior to the fuzzy modeling. It is very clear from the obtained infograph of investigation that G = f(δ) (with G and δ representing the gamma value and δFG of the preprocessed image, respectively) has an almost linear representation (due to the uniform brightness distribution after using the CLAHE filter) with the nonlinearity constraints as follows:

$$\left\{ \begin{array}{l} \text{Case} 1: \text{Non-linear functionality appear when }\delta_{\text{FG}} > 0.9 \\ \text{Case} 2: \text{Non-linear functionality appear when }G > 0.9 \end{array} \right. $$

On the basis of the above constraints, the degree of membership of cases 1 and 2 tends to be zero. Therefore, Gaussian representation as a membership function is an appropriate choice for these two cases. The other membership functions are selected to be triangular, and they provide a sufficient representation of knowledge. Aouache and Oulefki [4, 29].

Fig. 7
figure 7

Investigation of the gamma value

4 Inference system: fuzzy rules

To obtain the fuzzy rules of the proposed FGRM approach, each input and output were considered with two variables to implement the “Mamdani” inference engine. Fuzzy rules simplified as a matrix to obtain the 2 by 2 system. The first and second inputs were represented by seven and two possibilities, a total of (7 × 2 = 14) rules are defined as follows:

if a is A and b is B, then g1 is G1 and g2 is G2 (*)

Where a and b signify the two input values for the foreground (δFG) and the background (δBG) intensities, respectively; A and B denote the two input fuzzy sets for the rule, and G1 and G2 denote the two output fuzzy sets of the consequence of the rule.

The forced value (FV) membership function is used to control and adjust the final output of the fuzzy model.

5 Defuzzification: fuzzy output

To switch the fuzzy output represented by a fuzzy set into corresponding numeric values, a defuzzification process is necessary. Table 3 shows the defuzzification of linguistic variables (g1, g2) and their ranges.

Table 3 Defuzzification of g1 and g2 linguistic variables and their ranges

The fuzzy outputs (g1 and g2) are the prediction of the degree intensity, where the crisp value of the output variable is computed by finding the weighted average expressed as follows:

$$ Y=\frac{{\sum}_{i=1}^{N}{\upbeta}_{i}g_{i}}{{\sum}_{i=1}^{N}{\upbeta}_{i}} $$
(1)

With N = 14 (number of rules) and βi the output value of the i th rule, which is represented in the rule definition (*) by G1 and G2. Finally, the minimum value of the fuzzy output pair (g1, g2) was considered as the gain value (g) implemented to the GC function (2).

Gamma correction is a popular pixel-domain method, that deals with both bright and dimmed images and is cost-effective [7]. The resulting filtered image is given by:

$$ O(i,j) = C\times I(i,j)^{\frac{1}{g}} $$
(2)

where O(i, j) and I(i, j) represent the intensity value of the output and input images, respectively; C is a positive constant that is related to the device, and g is a positive constant expressing the gamma gain factor value[25].

5.1 Quality Measurement

Due to the unavailability of a reference image, the objective evaluation techniques are classified in full reference (FR), blind reference (BR), and reduced reference (RR) [28]. Thus, the proposed FGRM is examined using three X-ray databases and the QM of image is performed via the BR on the basis of statistical measurements (BR-SM), the BR on the basis of DL descriptors (BR-DL), and the visual interpretation of resulting images.

5.1.1 QM via BR-SM

The X-ray images of the three databases are of poor quality and suffer from high brightness which has led to a loss of information. The enhancement of these images requires a considerable reduction of the brightness in order to better visualize them. Quantitatively, six quantitative evaluations, which are MSE, PSNR, AMBE, E, EME, and UIQI, have been selected to objectively evaluate the proposed FGRM relative to other contemporary methods.

Mean square error (MSE) parameter evaluates the pixel-by-pixel differences between the original image and filtered one. It can be defined by the following mathematic equation [25]:

$$ \text{MSE} = \sum\limits_{i=1}^{M}\sum\limits_{j=1}^{N}\frac{{[I(i,j)-O(i,j)]}^{2}}{M\times N} $$
(3)

where I(i, j) is the original image, O(i, j) is the filtered image, and M and N are the dimensions of the images.

Peak signal to noise ratio (PSNR) is another parameter to measure the capability of the filter to reduce the noise. The mathematic formula of PSNR is given by [25]:

$$ \text{PSNR} = 20 \times \log 10 \left [ \frac{255}{\sqrt{\text{MSE}}} \right ] $$
(4)

In contrast to the case of restoration and noise reduction purposes, in the case of brightness adjustment, the pair (PSNR, MSE) is desired to have lower and higher values, respectively, as seen from the inverse relation between the two metrics.

Absolute mean brightness error (AMBE) indicates how close the mean brightness of the output image is to the input image’s one. It can be defined as follows [8, 11]:

$$ \text{AMBE} = \left | X_{O} - X_{I} \right | $$
(5)

where XO and XI are the mean brightness of output and input images, respectively. In this study, the AMBE value is considered to be higher for brightness reduction, in order to indicate a considerable image’s enhancement.

As introduced by Shannon and Weaver (1948) [37], E is utilized to evaluate the number of details in the image. E of an image is calculated as follows [36]:

$$ E = - \sum\limits_{i=0}^{L-1} p(Y_{i}) \times \text{Log}_{2} p(Y_{i}) $$
(6)

where p(Yi) represents the enhanced gray level (Yi) probability. Images with a high value of E imply that they contain further detailed information [36].

In this paper, the effective measure of enhancement EME is a quantitative measure of image enhancement. It provides an absolute value to each image by evaluating image contrast using Weber’s law and linking it to the perceived brightness based on Fisher’s law [4]. It is obtained by splitting the image into a number of blocks and using the equation,

$$ \text{EME} = \frac{1}{K1K2} \sum\limits_{L=1}^{K2} \sum\limits_{K=1}^{K1} 20\ln \left [ \frac{I_{\max}(k,l)}{I_{\min}(k,l)} \right ] $$
(7)

where, K1 and K2 are the number of horizontal and vertical blocks in the image and \(I_{\max \limits }(k,l)\) and \(I_{\min \limits }(k,l)\) are the maximum and the minimum pixel values in a given block [2].

UIQI [43] is a simple measure that counts on the first- and second-order statistic of the input and output images [3]. This index considers three factors, namely loss of correlation, luminance distortion, and contrast distortion. Its calculation is made by modeling any distortion as a combination of the three mentioned factors [43]. It is given by the following equation:

$$ \text{UIQI} = \frac{\sigma_{xy}}{\sigma_{x}\sigma_{y}} . \frac{2\bar{x}\bar{y}}{(\bar{x})^{2}+(\bar{y})^{2}} . \frac{2\sigma_{x}\sigma_{y}}{{\sigma_{x}^{2}}+{\sigma_{y}^{2}}} $$
(8)

where

$$\overline{x} = \frac{1}{N} {\sum}_{i=1}^{N} x_{i},$$
$$\overline{y} = \frac{1}{N} {\sum}_{i=1}^{N} y_{i},$$
$${{\sigma_{x}^{2}}} = \frac{1 }{N-1} {\sum}_{i=1}^{N} (x_{i} - \overline{x} )^{2},$$
$${{\sigma_{y}^{2}}} = \frac{1 }{N-1} {\sum}_{i=1}^{N} (y_{i} - \overline{y} )^{2}, \ \textup{and}$$
$${\sigma_{xy}} = \frac{1 }{N-1} {\sum}_{i=1}^{N} (x_{i} - \overline{x} ) (y_{i} - \overline{y} ).$$

The dynamic range of UIQI is [− 1, 1]. The value 1 is achieved if and only if yi = xi for all i= 1, 2...N. In our case, the lowest value of UIQI indicates a better result.

5.1.2 QM via BR-DL

As shown in Fig. 8, DL scattering is an approach used to classify the dispersion of the pixel intensity of an image into four triangles, namely A, B, C, and D, reflecting the classes, high-contrast/medium-luminance (HC/ML), low-contrast/low-luminance (LC/LL), medium-contrast/medium-luminance (MC/ML), and low-contrast/high-luminance (LC/HL), respectively.

Fig. 8
figure 8

Model of dispersion versus location (DL) scatter and its four triangles with coordinates

The DL features, with dispersion (D) measured by the range, and location (L) measured by midrange, are considered as a reasonably representative feature of the images’ intensities and deal with the relationship between local contrasts and local brightness in the image using location and dispersion estimators [4, 26, 33]. In this case, the [midrange, range] pair within the image is computed using equation 9 by employing an optimal window size of 15 × 15.

$$ \left[\begin{array}{cc}\text{Midrange}\\\text{Range} \end{array}\right]^{T} = \left[\begin{array}{cc}\min &\max \end{array}\right] \times \left[\begin{array}{cc}1 \setminus 2 &1 \setminus 2\\-1&1 \end{array}\right] $$
(9)

5.1.3 Visual inspection

The visual assessment was performed by medical experts from the Department of Radiology, Faculty of Medicine, Univeristi Kebangsaan Malaysia Medical Centre as indicated in our related work [13, 24, 27]. The experts examined the image quality subjectively by verifying the brightness and contrast changing of the displayed images before and after enhancement using both the expert eye visualization along with the distribution versus location plot, where, the DL cluster based on regions A, B, C, and D classes reflecting to (high-contrast/medium-luminance, low-contrast/low luminance, medium-contrast/medium-luminance, and low-contrast/high-luminance), respectively, were used to help in the image quality assessment (IQA) subjectively.

6 Results

As previously indicated, the performance of the FGRM filter and the measurement of X-ray quality were compared with the most recent methods using the BR-MS, BR-DL matrices, supported by a visual interpretation of the resulting images.

6.1 Assessment via BR-SM

The QM via BR-SM was calculated from the image obtained using the adaptive GC based on the FRGM approach. Tables 45, and 6 show summarized details of measurement results (mean value of MSE, PSNR, AMBE, E, EME, and UIQI metrics) with the overall datasets, (cervical, lumbar, and hand, respectively) using the FRGM along with the nine enhancement methods (BPDFHE, gamma correction, log transform, mean filter, median filter, contrast stretching, CLAHE, HE, and AGCWD) assessed in this study.

Table 4 Cervical dataset quality measurement(QM) via blind reference based on statistical measurement (BR-SM)
Table 5 Lumbar dataset quality measurement(QM) via blind reference based on statistical measurement (BR-SM)
Table 6 Hand dataset quality measurement(QM) via blind reference based on statistical measurement (BR-SM)

As shown in Table 4, the FGRM method performed better than other techniques when examining the cervical database for all quality measures. In addition, results from the lumbar and hand databases as in Tables 5 and 6, respectively, indicate that the performance of the FGRM method provides the highest average ranking. The log transformation method slightly outperformed our method in terms of PSNR and AMBE quality measures. In contrast, the filtering methods BPDFHE, mean filter, and median filter obtained the lowest rankings for measuring the overall quality of the three radiology databases.

In summary, results based on BR-SM show that the proposed FGRM effectively improves the structure of radiological images while preserving image features of interest to medical experts. In addition, FGRM showed a better performance when compared with the methods assessed in this study. The numerical results confirm that the QM via BR-SM of FGRM are proven to have relatively almost the highest average value of all metrics.

6.2 Assessment via BR-DL

The computation of the DL measurement was also applied to all images of the three databases. Figures 910, and 11 represent the distribution of the points in the regions A, B, C, and D of the cervical, lumbar, and hand databases’ X-ray images, respectively. Each chart has the concentration percentage values of a particular region with regards to all methods resulting images along with the original data.

Fig. 9
figure 9

From left to right, DL distribution of regions A, B, C, and D of original cervical database using FGRM, BPDFHE, gamma correction (GC), log transform (LT), mean filter, median filter, contrast stretching (CS), CLAHE, HE, and AGCWD

Fig. 10
figure 10

From left to right, DL distribution of regions A, B, C, and D of original lumbar database using FGRM, BPDFHE, gamma correction (GC),, log transform (LT), mean filter, median filter, contrast stretching (CS), CLAHE, HE, and AGCWD

Fig. 11
figure 11

From left to right, DL distribution of regions A, B, C, and D of original hand database using FGRM, BPDFHE, gamma correction (GC), log transform (LT), mean filter, median filter, contrast stretching (CS), CLAHE, HE, and AGCWD

This DL distribution is explained in Tables 7 (for cervical dataset) and 8 (for lumbar and hand datasets since they have the same behavior), where the underlined letter indicates lowest or missing points in that region, whereas, the bold letter indicates the presence of higher percentage of points in that region.

Table 7 DL index, description, and explanation at each region of the original cervical data compared with the ten examined techniques (UB, underwent bright; BA, brightness adjusted; UA, unsignificant adjustment; OB, over bright)
Table 8 DL index, description and explanation at each region of both original lumbar and hand data compared with the ten examined techniques (Lum, lumbar; Han, hand; QB, quasi-balanced; BA, brightness adjusted; UA, unsignificant adjustment; OD, over dark)

From Table 7, we notice that the cervical database suffered from over brightness and that our FGRM method improved the images by significantly reducing brightness and increasing the sharpness, only GC and HE methods improved the brightness by darkening the over-bright images, and only median filter, HE, and CLAHE methods enhanced images in terms of sharpness; all the other methods gave similar results to the original data. Moreover, from Table 8, we note that the lumbar and hand databases contain a mixture of dark and bright images. Although our method kept the same order of distribution of the points in regions A, B, C, and D, it adjusted the brightness by modifying the concentration percentages of points. Also, it increased the sharpness of all images, in particular, the hand database’s images. As for the state-of-the-art methods, the GC method darkened the images, the LT, HE and AGCWD methods enlightened even more the images, the HE and CLAHE methods gave small improvement regarding sharpness, and the rest of the methods’ results are similar to original data.

6.3 Visual assessment

The visual assessment was performed by inspecting the images’ quality with human eyes, X-ray images were given to experts and our biomedical researcher volunteers in the field, and they were requested to visually assess the quality of the produced image using the proposed algorithm versus the state-of-the-art methods in the order of brightness and contrast changing from the most preferable enhancement result to the worst and most undesirable one.

Figures 1214, and 16 show the visual interpretation of radiography sample images for different subject respectively in the cervical, lumbar, and hand datasets and the contrast-enhanced results with their respective DL plot, as shown in Figs. 1315, and 17, produced from the original image and the ten enhancing methods (FRGM, BPDFHE, GC, LT, MeanF, MedianF, CS, CLAHE, HE, and AGCWD). The visual results of X-ray images clearly show that the proposed FGRM is motivated with a profitable enhancement rate in providing satisfactory visual information and increases the accuracy of the correct information on pathologies for an autonomous diagnostic system.

Fig. 12
figure 12

From left to right, contrast enhancement of original cervical X-ray image using FGRM, BPDFHE, gamma correction (GC), log transform (LT), mean filter, median filter, contrast stretching (CS), CLAHE, HE, and AGCWD

Fig. 13
figure 13

From left to right, DL distribution of original cervical X-ray image using FGRM, BPDFHE, gamma correction (GC), log transform (LT), mean filter, median filter, contrast stretching (CS), CLAHE, HE, and AGCWD

7 Discussion

The results of Tables 15, and 6 indicate that measurements of the BR-SM matrix obtained from the images via all tested methods have unequal correlation values. Thus, the results reported here can be justified as follows:

  • First, the conventional metrics such as MSE and PSNR have conflicting values (with high values of MSE, and lower PSNR). Such an attitude indicates that these measurements are used more for restoration and noise reduction purposes and they do not correctly reflect the perceived visual quality of the image when it is related to non-uniform brightness and contrast adjustments. In contrast, the lower value of AMBE achieved in our case is justified by the fact that brightness preservation is not requested.

  • Second, if we neglect conventional metric measurements, the complex metrics such as E, EME, and UIQI have non-contradictory correlation values (high values of E and EME and lower UIQI); to this end, E and EME stand as the best choices. These measurements correctly reflect the perceived visual quality of the image when it is related to nonuniform brightness and contrast adjustments.

  • Third, the complex measurements in this study prove to have quite high correlation values and more dominant using the FGRM algorithm. Indeed, from Tables 45, and 6, we note that FGRM gave the best results compared with all other methods in terms of BR-SM for the cervical dataset followed by CLAHE and HE. For the lumbar and hand datasets, FGRM was slightly outperformed only in terms of PSNR and AMBE, because the brightness of these two databases is quasi-balanced (according to the DL distribution in Table 8); thus, there has not been a dramatic brightness change and the FGRM method was able to adaptively preserve that brightness.

Illustrated in Figs. 1213141516, and 17 are the the visual results with their respective measurements based on the BR-DL of the original image in relation to all tested methods. To facilitate understanding and readability, summarized details of BR-DL measurements results are discussed in Tables 7 and 8.

Fig. 14
figure 14

From left to right, contrast enhancement of original lumbar X-ray image using FGRM, BPDFHE, gamma correction (GC), log transform (LT), mean filter, median filter, contrast stretching (CS), CLAHE, HE, and AGCWD

Fig. 15
figure 15

From left to right, DL distribution of original lumbar X-ray image using FGRM, BPDFHE, gamma correction (GC), log transform (LT), mean filter, median filter, contrast stretching (CS), CLAHE, HE, and AGCWD

Fig. 16
figure 16

From left to right, contrast enhancement of original hand X-ray image using FGRM, BPDFHE, gamma correction (GC), log transform (LT), mean filter, median filter, contrast stretching (CS), CLAHE, HE, and AGCWD

Fig. 17
figure 17

From left to right, DL distribution of original hand X-ray image using FGRM, BPDFHE, gamma correction (GC), log transform (LT), mean filter, median filter, contrast stretching (CS), CLAHE, HE, and AGCWD

Case (1)—Cervical dataset as in Table 7. The results based on BR-DL show that original cervical dataset before enhancement had a DL index of DBCA (indicating that most points were concentrated in region D more than in regions B, C, and A) with an attributed quality of category underwent bright (UB). After applying the ten contrast enhancement methods (FGRM, BPDFHE, GC, LT, mean filter, median filter, CS, CLAHE, HE, and AGCWD), new DL indexes appear as (BDCA, D BCA, BDCA, DCBA, D BCA, D BCA, D BCA, D BCA, BDCA, D BCA), respectively.

  • By employing the FGRM, GC, and HE methods, a significant distributions descriptors BDCA, BDCA, and BDCA occurred. Implying that points in region B have been expanded, and points in region D have been decreased, unlike the movements of the points when using the original distributions descriptor D BCA. These movements indicate that the entire cervical dataset was enhanced with the brightness amount adjusted and contrast increased.

  • The attributed quality of category when applying the selected methods (FGRM, GC, and HE) is brightness adjusted (BA), indicating that the entire cervical dataset was generally enhanced and considered as high-contrast/medium luminance (HC/ML). For the rest of the methods, no significant adjustment was observed.

Case (2)—Lumbar and hand datasets as in Table 8. The BR-DL results show that the original lumbar and hand before improvement had a DL index of B DCA (indicating that points were concentrated in region B more than in regions D, C, and A) with an assigned category of quasi-balanced (QB). New DL indexes appear as BDCA, B DCA, BDCA, DBCA, B DCA, B DCA, B DCA, B DCA, DBCA, and DBCA, respectively, when applying FGRM, BPDFHE, GC, LT, medium filter, median filter, CS, CLAHE, HE, and AGCWD, respectively.

  • By applying the FGRM method, brightness adjusted (BA) quality category appeared, indicating that the entire lumbar and hand datasets were slightly enhanced that reflects a minor correction of brightness adjusted due to the quasi-balanced datasets. In contrast, other methods react with the same manner with different degrees of brightness adjustment.

In sum, the results based on BR-SM and BR-DL show that the proposed FGRM enhances and performs well compared with other methods in terms of contrast adjustment and the preservation of image structure using all three datasets. This achievement can be justified due to the fuzzy modeling that can manage the uncertainty and imperfection of the input images represented as a fuzzy set, and used here to process and simulate the human knowledge in the form of fuzzy if-then rules, contrary to the compared methods which process mostly using transformation process.

8 Conclusion

In this work, an adaptive filter based on the proposed FGRM approach for adjusting non-uniform brightness radiography is presented. FGRM uses the foreground and background intensity measures for G value prediction using fuzzy reasoning model, to be used for operating gamma function adaptively. The approach was tested on three different databases (cervical, lumbar, and hand). The proposed FGRM algorithm was evaluated using qualitative (BR-SM and BR-DL) and subjective (visual inspection) and compared with state-of-the-art methods such as BPDFHE, gamma correction, log transform, mean filter, median filter, contrast stretching, CLAHE, HE, and AGCWD. Simulation and the visual enhancement results demonstrated that the proposed FGRM algorithm can (1) effectively enhance X-ray contrast while offering adjusted brightness results and (2) offer higher quality compared with the nine peers methods regarding the brightness adjustment. In sum, obtained results by employing FGRM produce the best performance in both qualitative and quantitative evaluations. Thus, the proposed method can effectively and significantly improve the X-ray images’ low contrast. Future work can be considered in order to validate the FGRM approach by examining (1) a new index measure based on fuzzy DL scatter and (2) apply the proposed FGRM to different medical image modalities such as CR, MRI, and CT.