{'fraction_non_alphanumeric': 0.028619293592070362, 'fraction_numerical': 0.00865559123272372, 'mean_word_length': 4.82970498474059, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Importance of Image Enhancement Techniques in Color Image Segmentation: A Comprehensive and Comparative Study

Color image segmentation is a very emerging research topic in the area of color image analysis and pattern recognition. Many state-of-the-art algorithms have been developed for this purpose. But, often the segmentation results of these algorithms seem to be suffering from miss-classifications and over-segmentation. The reasons behind these are the degradation of image quality during the acquisition, transmission and color space conversion. So, here arises the need of an efficient image enhancement technique which can remove the redundant pixels or noises from the color image before proceeding for final segmentation. In this paper, an effort has been made to study and analyze different image enhancement techniques and thereby finding out the better one for color image segmentation. Also, this comparative study is done on two well-known color spaces HSV and LAB separately to find out which color space supports segmentation task more efficiently with respect to those enhancement techniques.


I. INTRODUCTION
Color images carry a vast amount of information with them. But this information is somewhat hidden, so human eyes tend to fail in analyzing them. Most importantly, small changes in characteristics of information such as intensity, color, texture etc are really difficult to get realized. So, we need an efficient color image segmentation technique to analyze them. But the result of any color image segmentation technique totally depends on the quality of the image concerned. Especially, in the case of the satellite image, image quality is degraded because of noises that generally involved during capturing, transmission and acquisition process of the image.
So, segmenting such noisy images does not produce an effective analysis result. Hence, we need some preprocessing techniques to remove artifacts, outliers or we can say noises from the images before going for further analysis stage. Image enhancement is such a preprocessing technique where our goal is to suppress the noise while preserving the integrity of edges and the other detailed information (Gonzalez et al.,2014;Malik et al.,2014 ). Actually, noises can be removed completely only when the real causes of their formation are studied and investigated. But in real fact, we cannot completely investigate them. So, the only thing we can do is to introduce some mathematical equation based techniques to partially remove the noises as much as possible (Koschan et al, 2008).
Color image enhancement techniques involve more efforts than gray image enhancement techniques due to the following two reasons (Koschan et al, 2008): (1)In the case of color images, we need to consider vectors instead of scalars.
(2) Also, for color images, the complexity of image perception is again a considerable fact.
Vector based techniques are computationally very hard to implement. So, monochromatic based techniques are always given preference where separate channels of a color image are undergone enhancement. Color space always matters a lot when it comes to color image processing. RGB is the common one when we talk about color image. This color space has three components Red, Green, and Blue. So, monochromatic based segmentation involves analyzing these three channels and we cannot guarantee a very good result for this color space. For this reason, next option to go for those color spaces where we have a separate channel for brightness measurement. HSV and LAB are two most popular color spaces satisfying this criterion. In this paper, we have adopted these two color spaces for our experimental study. A detail illustration on LAB color space can be found in (Bora et al, September 2014) and (Bora et al, December 2014) explains about HSV color space.
The later portion of the paper is organized as follows: In section II and its subsections, we have investigated different image enhancement techniques for color images. In section III, a brief discussion on color image segmentation is presented. In section IV, a study on color space is given where two frequently adopted color spaces HSV and LAB are explained properly with real-time examples. Section V is the experiments and results in the discussion section. Finally, the conclusion is drawn in Section VI.

II. CONTRAST ENHANCEMENT
Contrast enhancement is a process by which the pixel intensity of the image is changed to utilize the maximum possible bins (Gupta et al, 2014). Generally, the "contrast" term refers to the separation of dark and bright areas present in an image. The advantage of contrast enhancement is that it removes the ambiguity that may otherwise arise between different regions in an image. Contrast enhancement can be categorized into two categories: (1) Local contrast enhancement; and (2) Global contrast enhancement. Following table illustrates them more precisely: Local Contrast Enhancement Global Contrast Enhancement 1. In this type of contrast enhancement techniques, a small window is a slide through every pixel of the input image sequentially and only those blocks of pixels are enhanced which fall under in this window. This means local information is used intelligently in this case.
In this type of contrast enhancement techniques, the global histogram information is considered for enhancement. As the whole image is considered at once, so, local information is ignored in this case.
2. Local brightness future is considerably improved in this case. So contrast ratio can be improved in every region of the image.
As global brightness future is considered in this case, so this limits the contrast ratio in some part of the image. This results in significant contrast losses in small regions of the image, especially in the background. 3. Local contrast enhancement technique is computationally complex. Sometimes, it involves high cost due to consideration of over-lapped sub-blocks.
The main advantage of global contrast enhancement is that it is computationally simple and is suitable for overall enhancement of the image. 4. Examples of two local contrast enhancement techniques that are frequently adopted are AHE and CLAHE.
Examples of two widely adopted Global contrast enhancement techniques are Histogram Equalization and Histogram Specification.
In the following subsections, at first global contrast enhancement are discussed and then local contrast enhancement techniques with proper experiments showing their effect on satellite color images.

II (1): GLOBAL CONTRAST ENHANCEMENT (A) HISTOGRAM EQUALIZATION
The histogram is a graph which shows the frequency of occurring of data in the whole data set. It plots the number of pixels for each tonal value (Bora,2016a) ( Sutton). Consider an image with G total possible intensity levels. Then, the histogram of the image in [0, G-1] is defined as a discrete function: ( ) k k n p r n = Where, r k is the k th intensity level in the interval. n k is the number of pixels in the image whose intensity level is r k. n is the total number of pixels in the image. Histogram equalization is an image enhancement technique which enhances the contrast of an image by spreading the intensity values over the entire available dynamic range (Gonzalez et al,2014) (Bora et al, 2016a). This is achieved through a transformation function T(r), which can be defined by the Cumulative Distribution Function (CDF) of a given Probability Density Function (PDF) of gray levels in an image. Let, P r (r) is the PDF of the intensity levels. Then, the required transformation on the input levels to obtain the output level S is: where w is a dummy variable of integration. Then, it can be shown that (Gonzalez et al, 2014), the PDF of the output levels is uniform, i.e., 1, 0 1 0, s for s P otherwise ≤ ≤  =   The above transformation generates an image whose intensity levels are equally likely and also, it covers the entire range [0, 1]. This intensity level equalization process results in an image with increased dynamic range with a tendency to have higher contrast. , for k =1, 2, 3,…, L where S k is the intensity value of the output image corresponding to value r k in the input image. For our study, we have first converted the RGB image into HSV one, this is because HSV color space is more suitable for color image segmentation. This is due to the property that HSV color space represents the color in the same way that human eyes can perceive. Also, as we need the luminance channel, so we have extracted the V-channel from the HSV converted image and perform the histogram equalization operation on it. Finally, replacing the original V-channel with the histogram equalized one; we get the enhanced version of the image in HSV color space. So, with one more step (i.e., converting the HSV image back to RGB), we get the required histogram equalized version of the original satellite color image. Experimental results are shown below:

(B) HISTOGRAM SPECIFICATION
This is a technique by which the shape of the histogram of an image is changed into a specific one that we wish (Gonzalez et al, 2014) (Rajamani et al, 2013). Histogram specification is also known as Histogram Matching. Unlike the equally spaced ideal spaced histogram equalization, here the histogram is specified explicitly. If we consider continuous gray levels are normalized to the intervals [0,1] and say, r and z be the intensity levels of input and output image. Say, ( ) r p r is the input image's probability density function and ( ) z p z is the output ones (Gonzalez et al, 2014) Now, first apply the transformation: Above equation (1) will give an image with a uniform probability density. Then, if the desired output image were available, the following transformation would generate an image with uniform density: Where z denotes the intensity levels for an image that we are looking after. So, from equation (1) and equation (2), we have: So, a histogram specification technique consists of the following three main steps (Shaukat): Step1. Equalize the levels of the original image.
Step2. Specify the desired pdf and obtain the required transformation function (CDF).
Step3. Apply the inverse transformation function to the levels obtained in step 1.
But, there exist a few drawbacks of histogram specification: (1) Here, we do not have any definite rule for specifying an optimal histogram.
(2) Here, each given enhancement task needs to be analyzed on a case by case basis.
(3) Overall, this is a kind of trial-and-error process.
For experiment we have considered the same image used in the histogram equalization:

II (2): LOCAL CONTRAST MANAGEMENT (A)AHE
AHE stands for Adaptive Histogram Equalization. But it is different from ordinary histogram equalization in the sense that it is not global and it computes many histograms corresponding to different sections of an image (Gupta et al,2014). So, it is possible to enhance the local contrast of an image through AHE. With AHE, the information of all intensity ranges of an image can be viewed simultaneously and thereby solving the problem of many ordinary devices which are unable to depict the full dynamic intensity range. Here, first, a contextual region is defined for every pixel in the image. The contextual region is the region centered about that particular pixel. Then, the intensity values for this region are used to find the histogram equalization mapping function. The mapping function thereby obtained is applied to the pixel being processed in the region and hence, the resultant image produced after each pixel in the image is mapping differently. This results in the local distribution of intensities and final enhancing are based on local area rather than the entire global area of the image. This is the main advantage of AHE. But, sometimes, AHE tends to over enhance the noise content that may exist in some homogeneous local block of the image by mapping a short range of pixels to a wide one.

(B) CLAHE:
CLAHE stands for Contrast Limited Adaptive Histogram Equalization. This is a local contrast enhancement technique, an improved version of AHE (Gupta et al, 2014) (Pizer et al,1987) (Bora,2016b). Actually, AHE suffers from amplification of noises that may exist in some homogenous regions, so, here arises the need of putting a limit to contrast enhancement. Through CLAHE, the input image is partitioned into some non-overlapping regions of equal size (approximate) and histogram equalization is applied on each of them (Gupta et al, 2014). Then every histogram is clipped by a clip limit which is based on the desired contrast expansion and the size of the neighboring region. After that, bilinear interpolation is applied to eliminate the region boundaries making them look smoother like as if no boundaries are there. CLAHE is based on the concept that if we put a limit or clip the height of the histogram of the concerned bin to a certain level then the slope of the CDF function can be limited automatically. This results in a limit on the local contrast enhancement to the desired extent. So, an efficient mechanism is needed to determine the points at which the clipping should be done and redistribute the clipped pixels. For this we have introduced a Binary Search Based CLAHE (BSB-CLAHE) (Bora et al, 2016b) whose algorithm is described below: Step1. Say T is the top and B is the bottom of the concerned ClipLevel.
Step2 After applying the BSB-CLAHE, we got the following results:

III. COLOR IMAGE SEGMENTATION:
Image segmentation can be defined as dividing an image into different groups or partitions based on some homogeneity criteria like color, intensity, or texture etc. ( Gonzalez et al, 2014) )(Bora et al, 2016b)(Gupta et al, 2016) (Ho,2011). This is a very important step in any image analysis process as it helps to identify the ROIs (Region of Interest) present in an image and hence catalyzes the further analysis process. Image segmentation is of two types: gray image segmentation and color image segmentation. Color image segmentation currently becomes a very emerging research area in image processing area. This is because of the reason that it has a better capability of isolating objects more distinctly than gray image segmentation. A gray image has only one channel associated with it, i.e. the intensity channel. While a color image has at least three channels associated with every image. As for example, in an RGB image, we have three channels R(Red), G(Green) and B(Blue) each carrying different information. So, a color image can bring much more information than a gray image. Also, it's also a fact that our human eyes are more adjustable to brightness, so, can identify thousands of color at any point of a complex image, while only a dozens of gray scale are possible to be identified at the same time (Bora et al, 2014a). This implies that color image segmentation has the ability to bring more information than gray image segmentation. For a better color image segmentation task, the first important issue is to decide which color space to be chosen for distribution of color attributes values of the concerned image. In many cases, it is found that HSV and L*A*B* are the two frequently adopted color spaces (Bora et al, 2014a) (Bora et al, 2014b) (Bora et al, 2016b). In the following figure 6(b) the gray segmentation of the image 6(a) is shown and in figure 6(c), the color image segmentation is shown.
In both cases, we have adopted K-Means algorithm for the clustering task with Euclidean distance measure. Clustering is an unsupervised study commonly used for color image segmentation task. K-Means algorithm is a famous hard clustering algorithm popular for its low complexity (Bora et al, 2014c).
(a) (b) (c) Fig 6: (a) Original Image; (b) Gray Image Segmentation; and (c) Color Image Segmentation. From, the above figures it is clear we can recognize the ROI (Region of Interest) s more clearly in the image (c) than in (b), this is because of the reason that homogeneity in terms of color is more distinct and meaningful than the same in gray. Hence, color image segmentation can bring more valuable information than gray image segmentation.

IV. COLOR SPACE:
A color space is an abstract mathematical model for which represents colors in terms of intensity values (Singha et al, 2011). It specifies how color information can be represented in combination with physical device profiling, thereby allowing us to understand the color capabilities of a particular device or digital file (2017). Color space can also be thought of just like a digital palette because it relates numbers to actual colors in three-dimensional coordinate system which contains all realizable color combinations ("Color Management: Understanding Color Spaces", 2017) Color space is the most important factor that needs to be considered first while going for any color image analysis process. There exist different types color spaces with respect to different types of applications and devices. Maximum times RGB is taken as a default color space in common sense. RGB defines a color as the percentage of red, green and blue hues mixed together (Poynton, 1995) ("Color Management: Understanding Color Spaces",2017).A color space can be either device dependent or device independent. Device dependent color space is somehow restricted to the parameters and device used for display. It may give a different display of colors in different devices. While in the case of device independent color spaces, we will get the same color regardless of whatever the device used. So, it is better to switch for device independent color spaces for color image analysis tasks like color image enhancement, color image segmentation. RGB is a device dependent color space. So, it is recommended that the enhancement process should not be done in this color space. HSV and LAB are two mostly preferred device independent color spaces. These two color spaces have a very strong and useful characteristic of separating 'luma' from 'chroma'. Here, luma refers to image intensity and chroma refers to color information. This characteristic is very important in image enhancement process as any enhancement needs to be done is on the luma channel only so that it will not has any adverse effect on the chroma channel otherwise it will result in the formation of strange irrelevant colors. A brief discussion on these two color spaces is given below.

HSV Color Space:
In HSV color space, we have three channels: Hue (H), Saturation(S) and Value (V).Here, Hue is an angle in the range [0,2π] and is directly related to color. With respect to different hue angles, different colors will be presented. While saturation describes how pure the hue is with respect to a white reference and is measured as a radial distance from the central axis with values between 0 at the center to 1 at the outer surface. The V channel or value represents a percentage value goes from 0 to 100, expressing the amount of light illuminating a color. A diagrammatic view of the HSV color space is: The distribution of different colors with respect to Hue values (ranges 0 to 2π) is shown in the following color wheel diagram. Here, the color first started with red, as the Hue value changes, then it changes in the following pattern: red →yellow→green→cyan→blue→magenta→red.

LAB Color Space:
LAB color space (L*A*B*) is a device independent color space defined by CAE and specified by the International Commission on Illumination (Bora et al,2014a) ( Hunter et al, 1948) ( Hunter et al, 1958). Here, L channel is for luminance or light, and the other layers a and b are chromaticity layers. The a* layer shows where the color falls along the red-green axis, and b* layer will indicate where the color will fall along the blue-yellow axis. A clear illustration of the coordinate system of lab color space can be presented with the following diagram(2017): For, our study we will perform all the enhancement techniques on both of these two two color spaces.

V. EXPERIMENTS AND DISCUSSION:
For the experimental analysis, we have chosen Matlab to implement the enhancement techniques. The system where experiments are done has i5 processor with 64 bit Windows 10 operating system. Color Images required for the experiments are collected from different sources like Berkeley Image Segmentation Dataset, Sun Database, Earth Science World Image Bank. For this comparative study, we will first enhance the images with global contrast enhancement techniques and then with local contrast enhancement techniques. Then the resultant image will be undergone color image segmentation with an efficient clustering-based technique (Bora et al,2016b). Then we will compare the results and thereby come to the conclusion that which enhancement technique will be more suitable for color image segmentation.    For the above experiments, we have selected five different images: Lena(regarded as standard test image), beer image(with over brightness), underwater image, satellite image(blurred one) and a noisy face image(with salt & pepper noise of density 0.2 added). These images are undergone enhancement with each technique discussed in this paper. The enhancements are done on two color spaces separately: HSV and LAB. Here, we are using two metrics for quality for quality measurement: first visual perspective and then entropy. As per enhancement is concerned visual perspective should be given first preference. Then the minute differences are brought into light through the entropy value calculation. A high value of entropy implies a large amount of information stored in the image (Iyad et al,2007) ( Pal et al, 1991). So, a higher value of entropy means a better enhancement is carried out. Entropy, E can be calculated by using the following equation:

ENHANCEMENT IN LAB COLOR SPACE
(1) where p is the histogram counts involved in the histogram of the concerned image. As we have a color image, so, for entropy calculation, it is taken as a multidimensional gray image. Now, from the above experimental results, it is seen that enhancement on HSV color space is better for every enhancement techniques than the same in LAB color space. Also, as per visual perspective is concerned, BSB-CLAHE is showing best performance on both the color spaces and for all the images. After that, on average histogram matching is showing good performance. While, we have seen that although AHE is showing better performance than histogram equalization (global), but sometimes it fails to produce desired output. Histogram equalization is found often suffered from over enhancement issue-producing unwanted dark regions or artifacts. So, it is not recommended to use histogram equalization as a pre-processing step in any image analysis process. But, if we talk about computational complexity, the histogram equalization is less complex, while BSB-CLAHE is highly complex. While for histogram specification, the complexity will totally dependent on the specified histogram. Histogram specification is better only if we have depth background knowledge of the concerned image data. Now, in the next stage of our experimental, we will analyze the performance of the discussed  (Bora et al,2016b) is adopted as its performance is better than the traditional algorithms. The segmentation is done on both the color spaces for several test images collected from the above-mentioned sources. Following is the output for peppers image which is frequently selected for analyzing the performance of segmentation algorithms as in this image from visual perspective there is distinct ROI s present in different colors. Segmentation is done on both HSV and LAB color spaces. Following flowchart shows the steps involved in the whole process: Original Peppers Image The 'peppers' image is now added a Gaussian noise of mean 0 and variance 0.01 to find the robustness of the segmentation with respect to noise.  Now, from the above results we can come to the following conclusions by considering the visual perspective point of view: 1. Without Gaussian Noise: it is clear that segmentation after preprocessing with BSB-CLAHE is giving the best performance in both the color spaces. After that, histogram specification is giving better performance than AHE and Histogram Equalization. It is seen that the segmentation algorithm is producing better segmentation with respect to AHE than histogram equalization. 2. With Gaussian Noise: When the segmentation algorithm is applied to segment the Gaussian noise added peppers image after preprocessing with the discussed enhanced techniques on both the color spaces separately, it is found that LAB color space fails to deal with the noisy color image even after the enhancement is done. So, it draws the fact that LAB is not good for noisy image enhancement and segmentation. Only HSV color space survives to the noise and succeeds to produce considerable segmentation when the preprocessing is done with the discussed enhancement techniques. In this case, also BSB-CLAHE is able to give the best performance. While Histogram Specification and AHE are showing the average performance, histogram equalization is the one with the worst performance. Now, after the analysis with respect to visual perspective, we go for quantitative evaluation of the results for mathematical proof of quality. For that task, we have adopted SSIM index proposed by Zhou Wang et al. (Wang et al, 2004). Usually, researchers use to take MSE for quality analysis but there are several cases, it does not give an accurate analysis of the results (Wang et al, 2009). SSIM has the ability to automatically predict perceived image quality. A detail on this structural Structural-Similarity-Based Image Quality Assessment can be found in (Wang et al, 2004). We have used mean SSIM (MSSIM) index to estimate the overall image quality: where IMG1 is the original image and IMG2 is its segmented version.; img1 i and img2 i are the image contents in the ith local window and N is the total number of the local windows of the image. The MSSIM values are shown in the above So, from the above table 2, it is seen that BSB-CLAHE based color image segmentation results in higher mssim values than the same of other enhancement techniques based segmentation. A higher value of mssim implies a better quality of segmentation. Also, the segmentation results are better in HSV color space than the LAB color space. Now, if we arrange the enhancement technique on the basis of their performance then it follows the following order (here '>' means better than ):

BSB-CLAHE > Histogram Specification > AHE> Histogram Equalization.
So, CLAHE based local image enhancement technique is the best option for color image enhancement as it is robust to noise as we have seen in the experiments that it succeeds to produce better results even in the presence of frequently found noises: Salt and Pepper and Gaussian. As a result, it overall increases the performance of color image segmentation.

VI. CONCLUSION
Image pre-processing is utmost required for a better image analysis. In the case of color image processing, color image enhancement is the mostly concerned topic as distortion in the color image will impact the later analysis process like segmentation very negatively and hence this distortion should be removed through enhancement techniques as much as possible. Contrast enhancement is one of such preprocessing techniques that are frequently adopted. Various contrast enhancement techniques exist which are classified mainly into two types: local and global. In this paper, a comprehensive and comparative study is done on such contrast enhancement techniques and their impact on color image segmentation. Four techniques histogram equalization, histogram specification, AHE and BSB-CLAHE are discussed in details. Here color space is also given major concern. All the experiments are done HSV and LAB color space separately. It is found that HSV color space is showing better performance than LAB color space even in presence of noises for color image enhancement as well as color image segmentation. After analyzing all the experimental results, we come to the conclusion that BSB-CLAHE as a preprocessing technique will bring better color image segmentation if the task is performed in HSV color space. So, any CLAHE based local contrast enhancement technique (where clip limit is determined properly) on HSV color space should be preferred than other global enhancement techniques like histogram equalization if we want to achieve an optimal color image segmentation result.