A New Fuzzy Rule Based Contrast Enhancement Method using The Two-Steps Automatic Clustering Algorithm

The contrast is a major factor in uencing the image quality; therefore, image contrast enhancement technique is more and more widely applied in the eld of image processing. In this paper, a new fuzzy rule-based contrast enhancement method using the two-steps automatic clustering algorithm is proposed. Specifically, based on the Automatic clustering algorithm, a state-of-art method in cluster analysis and data mining, this paper proposes a two-steps Automatic clustering method to determine the number of fuzzy sets and locate the critical point in membership functions so that they are suitable for the distribution of pixel intensity values. The experiments on the Lena image and other natural images demonstrate that the new method can e ectively enhance the contrast of the images and meet the demands of human eyes perception


Introduction
The contrast of an image is the dierence in luminance or intensity and is a very important characteristic which decides the quality of image [1]. The contrast enhancement (CE) technology is an indispensable and essential technique to improve the image quality and visual eect so that the processed image can be better than the original image. It is applied in medical image processing, remote sensing and digital image processing and so forth.   • If gray then gray.
• If bright then white.
The purpose of modication step is making a dark pixel become darker, a gray pixel become mid-gray and a bright pixel become brighter.
For this purpose, [1] presented a simple and eective method to modify the critical points: are the critical points of the three fuzzy sets. In general, let c be the number of fuzzy sets in an image, the following rule is utilized for modication step: where i = 1, ..., c and the intensity value is nor-

Defuzzication
The aim of this step is to generate new intensity values. Let g is the original intensity value in the image, the output intensity value g can be calculated as follows.
where µ i (g) denotes the membership function value for assigning g to fuzzy set i in the fuzzication step and V i denotes the modied critical point of fuzzy set i in the modication step.

Contrast enhancement evaluation metrics
Some criteria often used for measuring the enhanced image quality are presented as follows.

Weber contrast
The Weber contrast (W c ) is dened as: where I and I b are respectively the object and the background intensities.

Michelson contrast
The Michelson contrast (M c ) is dened as: where I max and I min are respectively the maximum and minimum intensity values in the image.

Root mean square
The Root mean square (RMS) contrast is dened as: where r, c are the number of rows and columns of the image, I ij is the intensity of pixel at position (i, j), µ(I) is the mean of all the intensity values in the entire image.

Measure of Enhancement
The Measure of Enhancement (EME) contrast is dened as: The EME, which gets inspired from the Weber and the Michelson contrast, computes the intensity variation for each block to see the contrast of the local area and then computes the average of them. Therefore, the EME can be considered as a measure of global contrast. As numerous studies before [19,2931], in this paper, the quality of the enhanced image is evaluated by the RMS and the EME, where the higher RMS and EME indicate the higher image contrast.
Update the centroids using the average of all pairwise distance.; end 3.2. The proposed algorithm As mentioned above, the AC is an algorithm with complexity O(n 2 ). In the case of image contrast enhancement, n represents for the number of pixels which can be up to hundred thousands.
Consequently, the AC algorithm is not computationally ecient and even is unfeasible due to the limitation of personal computer's memory.
Therefore, to improve speed and quality of CE, we propose a two-steps Automatic clustering de- . It can be implied that the possible maximum value of n 2 is less than n due to the fact that the value of λ is ds/10 and not equal to 0. Hence, in the worst scenario assumption, the whole complexity of the 2-AC is T (n) = T 1 (n) + T 2 (n) = O max(n 2 /n 1 , n 2 2 ) < O(n 2 ), that is, the 2-AC complexity is less than the original AC. In the best scenario assumption, n 2 = n 1 , the complexity of the 2-AC is T (n) = T 1 (n)+T 2 (n) = O max(n 2 /n 1 , n 2 1 ) and it depends on the number as well as the size of the sliding windows. In order to better understand that how the complexity depends on the number of sliding windows, Figure 2 illustrates the complexity of the 2-AC in a specic case. It can be implied from Figure 2 that some of the typical choices of the sliding window's resolution like 3 × 3, 5 × 5 will lead to a large value of n 1 and a high complexity T 2 (n) in the second step as well as a high complexity T (n) in the whole 2-AC algorithm.
Also, it can be implied that we can nd optimal value of n 1 that can minimize the value of T (n) by solving the equation T 1 (n) = T 2 (n). In this case, the optimal choice of n 1 is n 2/3 , that is, the number of sliding window is n 2/3 , the number of pixels in each sliding window is n 1/3 and the whole complexity of the 2-AC is now O(n 4/3 ), which can reduce the computational cost, signicantly. In practice, the value Tab. 1: Some of common standard digital image sizes and the approximate optimal window sizes Photo image size Sliding window size 1024 × 768 10 × 10 800 × 600 9 × 9 512 × 512 8 × 8 460 × 308 7 × 7 320 × 240 6 × 6 256 × 240 6 × 6 240 × 160 6 × 6 220 × 148 6 × 6 of n 1/3 , the optimal number of pixels in each sliding window, is usually not an integer, and therefore this choice is unfeasible. Consequently, for the convenience of computation, the window size of N × N should be chosen by minimizing the value of |n 1/3 − N 2 |, where N is a positive integer number. For example, a window size of 6 × 6 should be congured for an image of size 220 × 148 because n = 220 * 148 = 32560 and |n 1/3 − N 2 | = |32560 1/3 − 6 2 | 4.07, which is the minimum of |n 1/3 − N 2 | (the corresponding values of |n 1/3 − N 2 | for N = 5 and N = 7 are 6.93 and 17.07, respectively). Some of the common standard digital image sizes and the approximate optimal window sizes are given in Table 1. Evaluation Database (CEED2016) [29,32,33].
In each experiment, the proposed method is compared with other conventional methods of [1,17,20]. This paper uses both global measure as the Root mean squared (RMS) contrast and local measure as the measure of enhancement (EME) to assess the eectiveness of the comparative methods, where higher values of the RMS and EME indicate that better quality the image has. The results are presented as follows.

Experiment 1
In this experiment, the 2-ACCE is applied to the well-known image Lena of size 256 × 240 (see Figure 3a). Based on Table 1, the image is divided into non-overlapping windows of size 6 × 6. Using the 2-AC algorithm, we obtain three nal centroids: v 1 = 0.381, v 2 = 0.467, v 3 = 0.553. Therefore, in the Fuzzication step, we can establish three membership functions as Figure 3c and transform the image data from gray level domain to the fuzzy membership domain using membership functions. According to [1], in the Modication step, the critical points In defuzzication step, using Formula (1), we transform the the membership values back into the gray level intensities to achieve the enhanced image as Figure 3b. can be seen that the enhanced image by [17] is better than that by [1], which is overall not clear.
The Yun's method [20] produces largest RMS and EME as compared to the others whereas the 2-ACCE ranks second. However, the enhanced image by the Yun's method is excessively enhanced; as a result, it omits color, and the de- Compared with the other enhanced images in

Conclusion
This paper proposes a fuzzy rule-based con-