Image Segmentation Based on a Two-Dimensional Histogram

Image segmentation refers to the partitioning of an image into non-overlapping different regions with similar attributes. For gray level images, the most basic attribute used is the luminance amplitude, and for color or multispectral images, color or information components are used. Various methods are found in the literature and are roughly classified into several categories according to the dominant features they employ. This includes edge-based methods (Zugaj & Lattuati, 1998), region growing methods (Tremeau & Borel, 1998; Schettini, 1993), neural networks methods, physics-based methods (Maxwell & Shafer, 1996; Bouda et al. 2008) and histogram thresholding methods (Sezgin & Sankur,2004). It is demonstrated that in unsupervised classification cases the histogram threshold method is a good candidate for achieving segmentation for a wide class of gray level images with low computation complexity (Cheng et. al., 2001). This method ignores the spatial relationship information of the pixels that can give improper results. Abutaleb’s work (Abutaleb, 1989) presents another type of 2D gray level histogram. It is formed by the Cartesian product of the original 1D gray level histogram and 1D local average gray level histogram generated by applying a local window to each pixel of the image and then calculating the average of the gray level within the window. Zhang and al. (Zhang & Zhang, 2006) proposed using a minimum gray value in the 4-neighbor and the maximum gray value in the 3×3 neighbor except pixels of the 4-neighbor. This method’s main advantage is that it does not require prior knowledge regarding the number of objects in the image, and classical and fast gray level image processing algorithms can be used to cluster the 2D histogram (Clement, 2002). For color or multispectral images, the one-dimensional (1D) histogram method detracts from the fact that a color cluster is not always present in each component and the combination of the different segmentations cannot catch this spatial property of colors (Clement & Vigouroux, 2001). It also does not take into account the correlation between components (Uchiyama & Arbib, 1994). Therefore multiple histogram-based thresholding is required. However, in a full multi-dimensional manner, the three-dimensional histogram (3D-histogram) method is handicapped by data sparseness, the complexity of the search algorithm (Lezoray & Cardot,2003) and a huge memory space (Clement & Vigouroux, 2001). An interesting alternative method lies with the use a partial histogram (2D-histogram)(


Introduction
Image segmentation refers to the partitioning of an image into non-overlapping different regions with similar attributes. For gray level images, the most basic attribute used is the luminance amplitude, and for color or multispectral images, color or information components are used. Various methods are found in the literature and are roughly classified into several categories according to the dominant features they employ. This includes edge-based methods (Zugaj & Lattuati, 1998), region growing methods (Tremeau & Borel, 1998;Schettini, 1993), neural networks methods, physics-based methods (Maxwell & Shafer, 1996;Bouda et al. 2008) and histogram thresholding methods (Sezgin & Sankur,2004). It is demonstrated that in unsupervised classification cases the histogram threshold method is a good candidate for achieving segmentation for a wide class of gray level images with low computation complexity (Cheng et. al., 2001). This method ignores the spatial relationship information of the pixels that can give improper results. Abutaleb's work (Abutaleb, 1989) presents another type of 2D gray level histogram. It is formed by the Cartesian product of the original 1D gray level histogram and 1D local average gray level histogram generated by applying a local window to each pixel of the image and then calculating the average of the gray level within the window. Zhang and al. (Zhang & Zhang, 2006) proposed using a minimum gray value in the 4-neighbor and the maximum gray value in the 3×3 neighbor except pixels of the 4-neighbor. This method's main advantage is that it does not require prior knowledge regarding the number of objects in the image, and classical and fast gray level image processing algorithms can be used to cluster the 2D histogram (Clement, 2002). For color or multispectral images, the one-dimensional (1D) histogram method detracts from the fact that a color cluster is not always present in each component and the combination of the different segmentations cannot catch this spatial property of colors (Clément & Vigouroux, 2001). It also does not take into account the correlation between components (Uchiyama & Arbib, 1994). Therefore multiple histogram-based thresholding is required. However, in a full multi-dimensional manner, the three-dimensional histogram (3D-histogram) method is handicapped by data sparseness, the complexity of the search algorithm (Lezoray & Cardot,2003) and a huge memory space (Clément & Vigouroux, 2001). An interesting alternative method lies with the use a partial histogram (2D-histogram)( www.intechopen.com Image Segmentation 380 Kurugollu et al.,2001), obtained by projecting a 3D-histogram onto two color planes (Clément & Vigouroux, 2003). This has several advantages, including a lack of data encountered in the 3D case, such as RGB image color, that is partially overcome and the search complexity is drastically reduced ( Lezoray & Cardot,2003). Another advantage is the fact that a 2D-histogram is nothing more than a gray level image. Therefore classical and fast gray level image processing algorithms can be used to cluster the 2D-histogram ( Clément, 2002). It is noted that the HSV color space is fundamentally different from the widely known RGB color space since it separates the intensity from the color information (chromaticity). HSV space was demonstrated to be a perceptual color space that consists of the three components H (hue), S (saturation) and V (value) and corresponds to the color attributes closely associated with the way human eyes perceive the colors. Many works related to the HSV color image have been developed and used (Qi et al., 2007;Sural et al, 2002 ;Zennouhi & Masmoudi, 2009). The organization of this chapter is as follows: in section 2, the 2D-histogram strategy is presented. Section 3 details the segmentation algorithm based on a 2D-histogram using HSV space. The experimental results are presented and discussed in section 4. Section 5 concludes the chapter.

Two-dimensional histogram
The histogram threshold method is a good candidate for gray level image segmentation (Cheng et. al., 2001). It is based on the shape of the histogram properties, such as the peaks, valleys and curvatures of the smoothed histogram (Sezgin et Sankur, 2001). Abutaleb's work ( A b ut a l e b , 19 89 ) p re s e nt s a no t h er ty p e o f 2 D gr ay l e v e l h i st o gr am . I t i s f o r m e d by t h e Cartesian product of the original 1D gray level histogram and 1D local average gray level histogram generated by applying a local window to each pixel of the image and then calculating the average of the grey levels within the window. The change in the pixel value in the horizontal or vertical directions appears slow and the gradation change continuity appears strong compared to the change in the diagonal direction. Zhang and al. (Zhang & Zhang, 2006) proposed using a minimum gray value in the 4-neighbor and the maximum gray value in the 3×3 neighbor except pixels of the 4-neighbor. This method's main advantage is that it does not require prior knowledge about the number of objects in the image. For RGB color or multispectral image, the one-dimensional (1D) histogram method detracts from the fact that a color cluster is not always present in each component and the combination of the different segmentations cannot catch this spatial property of colors (Clément & Vigouroux, 2001). It also does not take into account the correlation between components (Uchiyama & Arbib, 1994). Therefore multiple histogram-based thresholding is required. However, in a full multi-dimensional manner, the 3D-histogram method is handicapped by data sparseness, the complexity of the search algorithm (Lezoray & Cardot,2003) and a huge memory space (Clément & Vigouroux, 2001). An interesting alternative method lies with the use of 2D-histogram (Kurugollu et al.,2001), which selects two color bands together, namely RG, RB or GB in the RGB space color, obtained by projecting a 3D-histogram onto two color planes which can be constructed as follows. A 2D-histogram p n of a RGB color image I maps p(x , x ) 12 , the number of pixels in image I presenting the colorimetric components (x , x ) 12 . Since each colorimetric axis of image I is quantified on 256 levels, the 2D-histogram p n can be represented by an image J whose spatial resolution is equal to 256x256. The value p (x , x ) n 12 of the pixel of coordinates (x , x ) 12 in J is obtained by a linear dynamic contraction of the histogram between 1 and M min(p , 255) max = (Clément & Vigouroux, 2003): where p min and p max are respectively the minimum and maximum values of p.

Image segmentation algorithm
This section presents the segmentation algorithm based on 2D-dimensional histogram analysis using HSV space.

Two-dimensional histogram using HSV space
A three dimensional representation of the HSV color space is a hexacone that consists of three components: Hue, Saturation, and value. Hue is a color attribute that describes what a pure color (pure yellow, orange, or red) is. Hue refers to the perceived color (technically, the dominant wavelength). As hue varies from 0 to 1.0, the corresponding colors vary from red, through yellow, green, cyan, blue, and magenta, back to red, so that there are actually red values both at 0 and 1.0. Saturation is a measure of the degree to which a pure color is diluted by white light, giving rise to 'light purple', 'dark purple', etc. It can be loosely thought of as how pure the color is. Greater values in the saturation channel make the color appear stronger. Lower values (tending to black) make the color appear washed out. As saturation varies from 0 to 1.0, the corresponding colors (hues) vary from unsaturated ( s h a d e s o f g r a y ) t o f u l l y s a t u r a t e d . A s v a l u e , o r b r i g h t n e s s , v a r i e s f r o m 0 t o 1 .0 , t he corresponding colors become increasingly brighter (Chen & Wu, 2005). It is noted that the HSV color space is fundamentally different from the widely known RGB color space since it separates the intensity from the color information (chromaticity).
And it was demonstrated that the HSV components correspond to the color attributes closely associated with the way human eyes perceive the colors. Many works related to the color image have been developed using this color space (Qi et al., 2007;Sural et al, 2002). Sural et al. (Sural et al., 2002) analyzed the properties of the HSV color space with emphasis on the visual perception of the variation in hue, saturation and intensity values of an image pixel. For a given intensity and hue if the saturation is changed from 0 to 1, the perceived color changes from a shade of gray to the most pure form of the color represented by its hue. Looked at from a different angle, any color in the HSV space can be transformed to a shade of gray by sufficiently lowering the saturation. The saturation threshold that determines the transition, between the low and the higher values of the saturation, is once again dependent on the intensity. It is illustrated by Sural et al. (Sural et al., 2002) that for higher values of intensity, a saturation of 0.2 differentiates between hue and intensity dominance. Assuming the maximum intensity value to be 255, the threshold function to determine if a pixel should be represented by its hue or its intensity as its dominant feature is given by That can lead to a feature vector of two parts: the hue values between 0 and 2π quantized after a transformation and a quantized set of intensity values. In this way we use the HSV color space to build the histogram where each pixel contributes to either its hue or its intensity. Based on the threshold function equation (2), we determine an intermediate image (Fig. 1a): for low values of saturation, a color can be approximated by a gray value specified by the intensity level, while for higher saturation; the color can be approximated by its hue value. Where the Max is the maximum hue or intensity in the 3x3 neighbor except pixels of the fourneighbor and Min is the minimum hue or intensity in the four-neighbor  (Fig.2).

Segmentation algorithm
The segmentation algorithm is achieved in two main steps: one, building the 2D-histogram using HSV space according the approach developed before. Two, detecting the peaks representing classes using the classification a l g o r i t h m p r o p o s e d i n R e f . ( C l é m e n t & Vigouroux, 2003). A peak is labeled as significant if it represents a population greater than or equal to a threshold d 0 (expressed in per cent of the total population in image). The classification algorithm is performed by reclassification of the pixels not classified in the determined classes according to Euclidian distance. In order to evaluate the segmentation algorithm, we use the Q function (Zhang et al., 2008;Borsotti et al. , 1998) ( ) Im is the segmented image, N is the image size, R is the number of regions of the segmented image, N i is the area of the ith region, R(N i ) is the number of regions having an area equal to N i , and e i is the average color error of the ith region, which is defined as the sum of the Euclidean distances between the RGB color vectors of the pixels of the ith region and the color vector attributed to the ith region in the segmented image. The smaller the Q value, the better the image segmentation method.

Experimentation results
This section presents the experimentation results obtained on synthetic and real images. Two color images are selected: the 465x386 synthetic Squares, which is comprised of four colors, the 709x608 real Mandrill image. Figure 3 shows the original images and the results of the proposed method. It can be seen that the performance is acceptable both for synthetic and real images. In order to compare the performance of the segmentation method with other existing ones, two different images are used. First, we consider a synthetic image (Gillet et al., 2002, Macaire et al., 2006) that contains four patterns with different shapes and different colors. The circular pattern contains two shapes that differ only by the variation of the saturation component. The image contains then, if we consider the background, six classes. The difference between two regions due to the variation of saturation is still a difficult problem. Often, two distinct colors are merged together. The 2D-histogram segmentation method using RGB space fails to separate the two shapes in the circular pattern. The same problem arises when we applied the 1D-histogram method using HSV space. It can be seen from experimentation results (Fig. 4) that the proposed approach gives better clustering and the problem of missing to separate the two shapes is alleviated. From theses results, it can be deduced that RGB space is not able to separate the two shapes in the circular pattern. This is due to the high correlation among the R, G and B components and that the measurement of a color in RGB space does not represent color differences in a uniform scale; hence it is impossible to evaluate the similarity of two colors from their d i s t a n c e i n R G B s p a c e . H o w e v e r , i n t h e HSV space where the color and intensity information are separated, the segmentation of the two shapes can be achieved by the proposed method. Second, we are interested in some agricultural applications. Plants are exposed to a multitude of natural biotic and abiotic stresses (Lichtenthaler,1996). Water availability is one of the most important limitations to photosynthesis and plant productivity (Tezara et al., 1999). The proper monitoring of plant water stress is essential for the development of appropriate, sustainable irrigation programs for crop production in semiarid areas (Penuelas & Filella, 1998). The use of non-destructive imaging methods, such as fluorescence imaging, thermal imaging and imaging using near infrared, holds great promise for early, efficient and objective detection of plant responses to various stresses (Govindjee and Nedbal, 2000;Chaerle & van der Straeten, 2001 ). However, these techniques provide less human intuition, are more difficult to assess during system integration and are the most costly and time consuming. So, the use of the imaging based on the electromagnetic radiation in the visible range would be of great interest. histogram using HSV space In this study we have considered a medicinal plant. The first step in our procedure to detect early stress is to segment each image into two classes: vegetation and soil. The color RGB images of the plant are provided by a digital camera. Each color plane is quantized on 256 levels with a resolution of 640x480. It was noted that the 2D histogram method using RGB space fails to determine the color and intensity variation presented in the image plant. It can be seen from the Fig. 5b that the RGB method could not separate the plant and pot. Figure 5c shows the obtained result of 1D histogram using HSV space. It is clear that the plant and pot are separated; however, this method could not separate the variation intensity presented in soil class which can be useful information for the study of the plant environment. In contrast, it can be clearly seen from Fig. 5d that the performances of the proposed method are higher than those presented for comparison. Finally, to evaluate the proposed technique, we have used the 'Q' evaluation function equation (3). From Table 1, it can be seen that the proposed method performs better than the analysis of 2D-histogram using RGB space.

Conclusion
In this chapter, we have developed an approach of color image segmentation which is based on the analysis of 2D-histogram using HSV space. The method was applied to various synthetic and real images to prove the performance of segmentation algorithm. Additionally, the method was applied to a particular agricultural application to separate the vegetation and soil. The obtained results have been compared to the methods of others, and shown to be more satisfactory than those obtained either by 1D-histogram using HSV or by 2D-histogram using RGB space.

Image Segmentation
Edited by Dr. It was estimated that 80% of the information received by human is visual. Image processing is evolving fast and continually. During the past 10 years, there has been a significant research increase in image segmentation. To study a specific object in an image, its boundary can be highlighted by an image segmentation procedure. The objective of the image segmentation is to simplify the representation of pictures into meaningful information by partitioning into image regions. Image segmentation is a technique to locate certain objects or boundaries within an image. There are many algorithms and techniques have been developed to solve image segmentation problems, the research topics in this book such as level set, active contour, AR time series image modeling, Support Vector Machines, Pixon based image segmentations, region similarity metric based technique, statistical ANN and JSEG algorithm were written in details. This book brings together many different aspects of the current research on several fields associated to digital image segmentation. Four parts allowed gathering the 27 chapters around the following topics: Survey of Image Segmentation Algorithms, Image Segmentation methods, Image Segmentation Applications and Hardware Implementation. The readers will find the contents in this book enjoyable and get many helpful ideas and overviews on their own study.