Expeditious Contrast Enhancement for Grayscale Images Using a New Swift Algorithm

Contrast enhancement plays a significant role in many existing image-related applications. In various situations, conventional contrast enhancement techniques failed to produce acceptable results for a wide variety of low-contrast images. As a result, various innovative techniques have been proposed for the purpose of contrast enhancement. Despite that, this field is still open for research due to its indispensability in many scientific disciplines and to various unavoidable real-world limitations. Hence, this article introduces a novel swift algorithm for contrast enhancement in images of low-contrast. The processing concept of this algorithm is straightforward. Initially, a non-complex logarithmic function is applied as a preprocessing step to attenuate the immoderate pixel values. Then, a new non-linear enhancement function which is designed experimentally based on mathematical, statistical and spatial information is applied to modify the brightness and contrast. Finally, a regularization function is applied as a post-processing step to rearrange the image pixels into their natural dynamic range. Experimental results revealed the favorability of the proposed algorithm, as it provided better results than those produced by several contemporary techniques in terms of recorded accuracy and perceived quality.


Introduction
In recent decades, the value of digital images has significantly increased since they become irreplaceable in many scientific disciplines.In addition, many mutual stages exist between such disciplines including, image acquisition, storage, analysis and processing, transmission and display [1].In digital images, the low-contrast is a prevalent artifact that reduces the visual quality and hampers the observation of valuable information.In addition, images with low-contrast are deemed not useful for many current applications [2].Usually, the low-contrast artifact occurs due to various unavoidable real-world limitations.Hence, it is highly desirable to process such an artifact because of its direct influence on the analysis and interpretation of important image information [3].Contrast enhancement techniques are usually used to improve the perceived quality and recover acceptable quality images from their degraded observations [4].Contrast enhancement is one of the fastest growing fields in image processing since it can be used to improve the brightness, contrast, and colors of an image [5].Contrast is a significant aspect of visual quality estimation.Usually, images with adequate contrast show better details when compared to their low-contrast counterparts [6].
Generally, contrast enhancement techniques for grayscale and color images can be divided into two main categories namely, direct [7,8] and indirect [9,10].Direct techniques utilize a specifically defined contrast term to improve the image intensities directly, while indirect techniques redistribute the image intensities over a definite 578 EXPEDITIOUS CONTRAST ENHANCEMENT FOR GRAYSCALE IMAGES dynamic range without defining a specific contrast term [11].Accordingly, conventional contrast enhancement techniques repeatedly fail to produce acceptable results for a wide variety of low-contrast images.As a result, various research works have been introduced to provide new solutions for different image processing systems, for which a brief review of such research is addressed.In [12], the authors introduced a histogram based graylevel grouping technique for automatic enhancement, in which it initially groups the histogram components of the input image into a suitable number of bins depending on a specific criterion.Next, it reallocates those bins over the dynamic range in a uniform way.Then, it ungroups the afore-grouped gray-levels to produce the final image.In [13], the authors proposed a dynamic histogram equalization technique which overcomes the details loss of the traditional histogram equalization.This technique works by partitioning the histogram of the input image depending on local minima and assigning certain gray-level ranges for every partition prior to equalizing them independently.Then, the aforementioned partitions undergo a further repartitioning test to guarantee the absence of any dominating partitions.
In addition, the authors of [14] developed a weighted histogram equalization based technique, which starts by segmenting the histogram of the input image into many sub-histograms in a recursive way to be adjusted based on a specific weighting process that depends on a normalized power law function.Then, each weighted subhistogram is equalized separately.To produce the final result, the equalized sub-histograms are joined together.Alternatively, the authors of [15] provided another histogram equalization technique that utilizes specific penalty terms which helps in adjusting the contrast of a given image, while in [16], the authors developed a genetic-based technique that employs a new chromosome representation with the genetic operators, in which such operations can assist in remapping the gray-levels of the input image in a way that the output image has a better contrast representation.Furthermore, the authors of [17] proposed an innovative technique that starts by constructing a 2D input histogram from the input image using a joint relationship between each pixel and its neighbors.Likewise, a target 2D histogram is constructed by reducing the sum of Frobenius norms of the variances from the input histogram.The improvement is attained by mapping the diagonal elements of the input histogram to the diagonal elements of the target histogram.
Moreover, the authors of [18] proposed an adaptive technique that employs a Gaussian mixture model to shape the gray-level allocation of the image.Then, the dynamic range is partitioned into input gray-level intervals based on the detected intersection points.The enhancement is achieved by transforming the pixels' gray-levels in every input interval to the suitable output interval depending on the leading Gaussian element and the cumulative distribution function of the input interval.Besides, the authors of [19] provided a hybrid technique that combines the concepts of genetic algorithm, ant colony optimization and simulated annealing to achieve the desired enhancement, while in [20], the authors introduced a new technique that utilizes the concept of artificial bee colony to replace the input image set of gray-levels by a new set to produce results with better contrast.In addition, the authors [21] adopted a new technique that uses a non-linear gamma correction function, a weighted sum technique and a golden search algorithm to determine the optimal parameters and produce the final result.In [22], the authors presented a new technique to attain both local and global contrast enhancement by using the residual spatial entropy to allocate a weight for each gray-level that are utilized in the mapping process to attain the global enhancement.Then, a non-linear mapping process is used to change the domain coefficients of the globally enhanced image in order to achieve the local enhancement.
Moreover, the authors of [23] introduced a novel multi-scale technique that depends on directional morphological filters which are used to detect and extract the scale image features with different orientations.The resulting image is created by using a weighted mixture of features.The last technique to be reviewed uses the concept of artificial bee colony [24], in which it utilizes a new fitness function along with a new transformation function to assist in producing results with better contrast.From the previously indicated research works, it can be seen that many of the developed techniques are based on the concept of histogram equalization.Hence, innovative techniques that adopt new concepts are highly desirable due to their importance in many scientific disciplines.Moreover, new yet efficient enhancement techniques are highly required for better visual perception, since the request for high-quality images is increasing.Thus, this area is still open for research due to various existing challenges.The main motivation of this research is to provide a novel low-complexity algorithm with a simple structure to produce satisfactory results.Hence, a new swift algorithm is introduced in this article to enhance the contrast of digital images expeditiously.The processing concept of this algorithm is straightforward.Initially, a non-complex logarithmic function is applied as a pre-processing step to attenuate the immoderate pixel values.Then, a new non-linear enhancement function which is designed experimentally based on mathematical, statistical and spatial information is applied to modify the brightness and contrast.To end with, a regularization function is applied as a post-processing step to rearrange the image pixels to their natural dynamic range.Image quality is a distinctive image feature that measures the degree of degradation for observed images.Thus, two types of image quality assessment (IQA) metrics are used in this research namely, full-reference (FR) and no-reference (NR) metrics to measure the accuracy of the obtained results.For FR metrics, detail losses and additive impairments evaluation (DLAIE) [25], and multiscale contrast similarity deviation (MCSD) [26] are used, while for NR metrics, local contrast (LC) [27] and spatial frequency measure (SFM) [28] are utilized.In FR metrics, the quality of a given image is measured by comparing it with a reference (ideal) image that is supposed to have a perfect quality, while the quality of a given image is evaluated without any reference image in NR metrics [29].
As known, it is uneasy to have an ideal-quality image for various image processing systems.Hence, such an issue makes it difficult to assess the quality of the resulting images for which, the use of NR metrics is highly required in such situations.Regarding the dataset of this research, it consists of natural and synthetic-degraded images that are collected from the publicly available databases across the internet.The contrast of the synthetic-degraded images is reduced by different ratios to be used for comparison purposes, while the natural-degraded images are used for experimental purposes.Although the proposed algorithm has an uncomplicated structure, it showed a great potential in recovering good quality images from their degraded counterparts.The rest of the article is arranged as follows: In Section 2, a sufficient explanation regarding the proposed algorithm is provided.In Section 3, the experiments, results, and their related discussions are presented.Lastly, a concise conclusion is given in Section 4.

Swift Algorithm
In the field of contrast enhancement, various well-known techniques exist.However, many such techniques were unsuccessful in achieving acceptable results in different applications.In addition, various contemporary enhancement techniques can include excessive mathematical calculations to achieve satisfactory results leading to a complex and time-consuming procedure.Thus, expeditious yet low-intricacy techniques are highly demanded due to their importance in many scientific applications.The proposed algorithm can provide fast yet efficient processing with few calculations involvement.It starts by applying a non-complex logarithmic function as a pre-processing step to achieve a reasonable intensity equalization and attenuate the immoderate pixel values.Such immoderate values can lead to excessive whiteness if not handled efficiently.The used logarithmic function is calculated as follows [30]: where, g (x,y) is the input low-contrast image with intensities that falls into the range of [0-1], u (x,y) is the resulting image from the pre-processing step, (x, y) are spatial coordinates.Next, the curve adjustment parameters, which will be used later in the newly designed intensity modification function, are determined.The first adjustment parameter ς, which is the corrected sample standard deviation of image u (x,y) , is a method that is utilized to measure the extent of variation or distribution in a set of values (pixels' values).In image processing, ς is sensitive towards the contrast attribute, in which images with low-contrast have lower ς values than images with adequate contrast.The adjustment parameter ς is computed as follows [31]: where, u i is a vector version of image u (x,y) ; ū is the mean of u i ; n is the number of elements at the longest dimension of u i ; Then, the second adjustment parameter η is determined using the following equation: where, λ represents a tweaking parameter which by default is set to (λ = 3).Next, the actual processing step is applied to modify the brightness and contrast of image u (x,y) .This step includes the implementation of a new non-linear function which is designed experimentally based on mathematical, statistical and spatial information.
The employed non-linear function is computed as follows: where, tan is the tangent in radians of each pixel in image u (x,y) ; f (x,y) is an image with a modified tonality.
Γ is an adjustment parameter that controls the amount of enhancement and should fulfill Γ > 0, where a low Γ value leads to bright results with contrast enhancement, while a high Γ value leads to less-bright results with contrast enhancement.The above equation has a significant effect on the enhancement of image tonality.Accordingly, applying the tangent in radians and the element-wise exponential functions helped in providing two different curvy transformations for the processed image.However, if these two functions are used without the adjustment parameters ς and η, they tend to increase the brightness and also introduce a noticeable tonal shift in some situations.To overcome such effects, the values of the tangent and the exponential functions are reduced by two different adjustment parameters ς and η.Parameter ς is a common measure that is used in many real-world applications, while parameter η is developed experimentally, for which both parameters can provide an improved curvy transformation for the used functions.One final obstacle that must be dealt with is the contrast of image f (x,y) is limited to a certain dynamic range, and thus, it should be regularized to get acceptable quality results.Hence, a regularization function is applied as a final post-processing step to redistribute the image pixels to their natural dynamic range.The utilized regularization function can be determined as follows [3]: where, min and max represent the minimum and maximum pixel values of image f (x,y) ; t (x,y) is the final result of the proposed algorithm.To end with, the proposed algorithm owns many advantages including, few calculations, fast implementation, and effect-free results, in which it can be useful for many existing image-related applications.

Results and Discussion
In this section, the required computer experiments with their related discussions are reported to demonstrate and evaluate the performance of the proposed algorithm with various low-contrast images.Accordingly, the proposed algorithm is broadly tested by a dataset of both natural and synthetic-degraded images to provide qualitative and quantitative assessments, and to deliver an adequate understanding of its processing abilities.Thus, the naturaldegraded images are used for experimental purposes, while the synthetic-degraded images are used for comparison purposes.In addition, the proposed algorithm is compared to various prominent contrast enhancement techniques, such as brightness preserving dynamic fuzzy histogram equalization (BPDFHE) [32], non-parametric modified histogram equalization (NMHE) [33], median-mean based sub-image-clipped histogram equalization (MMSICHE) [34], recursive exposure based sub image histogram equalization (RESIHE) [35], and dominant orientation-based texture histogram equalization (DOTHE) [36].
As well, various modern and trustworthy quality assessment metrics are utilized for supplementary performance evaluation.Hence, many FR and NR metrics for contrast enhancement were studied and four of such were selected namely, DLAIE, MCSD, LC, and SFM.The LC specifies the average of local image contrast, while the SFM Stat., Optim.Inf.Comput.Vol. 6, December 2018 Z. AL-AMEEN 581 represents the quality of an image in terms of total activity levels.Furthermore, the DLAIE evaluates the similarity between two given images by correlating additive impairments with detail losses to measure the existence of useful visual information.Likewise, the MCSD evaluates the quality between two given images by using a multi-scale representation of contrast features to correlate the result with the human perception.For LC and SFM, higher values indicate a better representation of image contrast.
For DLAIE, and MCSD, the outcome is between zero and one, in which values close to one denotes high perceived quality for DLAIE and poor perceived quality for MCSD, while values close to zero denotes poor perceived quality for DLAIE and high perceived quality for MCSD.The results of applying the proposed algorithm on various natural-degraded images are shown in Figures 1 and 2. In addition, the results of the achieved comparisons are exhibited in Figures 4 and 5. Tables 1 -3 displays the recorded accuracies and the processing times of the performed comparisons and experiments, while Figures 3, 6 and 7 illustrate the analytical graphs of Tables 1 -3.To achieve this research, all practical experiments were attained using a computer with an 8GB of memory and an Intel Core i5 2410M-2.3GHz processor.From the obtained experimental results shown in Figures 1 -3 and Table 1, it is conspicuous that the proposed algorithm performed satisfyingly well in terms of brightness and contrast since such traits improved noticeably when compared to their original counterparts.Furthermore, an obvious difference can be seen in the distribution 582 EXPEDITIOUS CONTRAST ENHANCEMENT FOR GRAYSCALE IMAGES of pixels when comparing the histograms of the original and the resulting images.The histograms of the original images revealed a restricted pixels distribution, as these values are limited to a specific range.Such matter indicates that the perceived quality of the original images is somewhat low.However, the histograms of the resulting images showed a noticeable improvement in pixels distribution, since such values have become well-distributed to the natural dynamic range.Such matter reflects positively on the representation of the brightness and contrast as the recovered images have better-perceived quality.Accordingly, there is a perceptible difference regarding the recorded accuracy between the original and the processed images using LC and SFM metrics, in which the original images scored poorly, while the processed images scored better in such matter.This is significant because it supports the findings of this research and it indicates that the processed images have higher contrast and apparent features than the original ones.When it comes to implementation times, the proposed algorithm processed the provided images rapidly using a computer with moderate specs.From the obtained comparison results shown in Figures 4 -7, Tables 2 and 3, it can be seen that the proposed algorithm performed better than the comparable techniques in terms of perceived quality and recorded accuracy, for which the results of the proposed algorithm compared favorably to the results attained by more intricate techniques.Regarding the BPDFHE results, the brightness of certain areas is noticeably augmented when the input image had a major contrast reduction, while it was sustained when the input image had a minor contrast reduction.In terms

584
EXPEDITIOUS CONTRAST ENHANCEMENT FOR GRAYSCALE IMAGES of contrast, it is improved slightly when compared to the degraded images.Still, the recorded accuracies revealed that the quality of the resulting images is lower than the degraded images due to brightness amplification in some image regions.Accordingly, it gave a better performance when the input image had a minor contrast reduction.Despite that, it is the fastest among the other comparable techniques.Regarding the NMHE results, the brightness is sustained, while the contrast is barley enhanced when the input image had a minor or major contrast reduction.Thus, the recorded accuracies revealed that the quality of the resulting images is slightly higher than the degraded images.Similar to BPDFHE, it gave a better performance when the input image had a minor contrast reduction.Nevertheless, the average processing time of this technique is somewhat adequate.Regarding the MMSICHE results, the brightness is slightly increased and the contrast is noticeably improved.Still, the recorded accuracies showed that the quality of the resulting images is faintly lower than the degraded images due to minor brightness amplification in some image regions.Accordingly, it gave reasonable performances when the input image had a minor or major contrast reduction.As for the average implementation time, it scored moderately in this aspect.Regarding the RESIHE results, the brightness is sustained to some extent, while the contrast is improved adequately.Hence, the recorded accuracy revealed that the quality of the resulting images is better than the degraded images.Conversely to the comparable techniques, it gave a better performance when the input image had a major contrast reduction.As for the average implementation time, the performance of this technique is nearly similar to NMHE.Regarding the DOTHE results, the contrast is significantly improved, while the brightness of certain areas is slightly reduced.Hence, the recorded accuracies revealed that the quality of the resulting images improved tremendously.However, it gave the slowest implementation times among the comparable techniques.Regarding the proposed algorithm, it produced results with preserved brightness and improved contrast.Thus, the recorded accuracies revealed that the quality of the resulting images is way better than their degraded counterparts.Furthermore, it scored the highest IQA readings among the comparable techniques.Accordingly, it performed satisfyingly well when the input image had a major contrast reduction.As for the average implementation time, it gave moderate scores.Developing an expeditious algorithm for image contrast enhancement is an important yet challenging task.Accordingly, such a task is obviously achieved, wherein the perceived quality of the obtained results is improved tremendously.Thus, the recovered images have an acceptable brightness with a satisfactory contrast.As a result, the fine image details are unveiled with adequate quality and natural appearance.Finally, it is believed that such acceptable achievement is convenient for use with various modern image-related applications.

Conclusion
In this article, a new swift algorithm is introduced for the purpose of image contrast enhancement.The proposed algorithm comprises three distinct steps.An initial pre-processing step for attenuating the immoderate pixel values, a second processing step for brightness and contrast modification, and a final post-processing step for rearranging pixels to their natural dynamic range.The proposed algorithm was tested with natural and synthetic-degraded images, for which the obtained results were appraised by four FR and NR IQA metrics.The introduced algorithm has been revealed to perform satisfyingly well with low-contrast images, outperforming other comparative stateof-the-art techniques in terms of recorded accuracy and perceived quality.According to the performed research and analysis, the proposed algorithm can be applied to various existent real-life applications especially with those having limited resources.

Figure 1 .
Figure 1.Processing natural-degraded low-contrast images: (a) low-contrast images; (b) histograms of images in (a); (c) results of the proposed algorithm; (d) histograms of images in (c).

Figure 2 .
Figure 2. Processing natural-degraded low-contrast images: (a) low-contrast images; (b) histograms of images in (a); (c) results of the proposed algorithm; (d) histograms of images in (c).

Figure 3 .
Figure 3.The analytical graphs of the accuracy attained by the used NR metrics of LC and SFM.

Figure 6 .
Figure 6.The analytical graphs of the accuracies obtained by the used FR metrics: (a) DLAIE; (b) MCSD.

Figure 7 .
Figure 7.The analytical graph of the average processing times for the comparable techniques.

Table 1 .
The processing times, accuracies and Γ values of the attained experiments with natural-degraded images.#ImageΓvalues LC original LC result SFM original SFM result Times (sec.)

Table 2 .
The processing times and recorded accuracies of the attained comparison with a (30%) contrast-reduced test image.

Table 3 .
The processing times and recorded accuracies of the attained comparison with a (60%) contrast-reduced test image.