A Segmentation Method for Uneven Illumination Particle Images

To the question of particle images segmentation with uneven illumination background, a novel method is proposed based on homomorphic filtering, Top-Hat transformation and watershed algorithm in this study after discussing the characteristic of various common segmentation algorithms. Firstly, homomorphic filtering is carried out on particle image frequency region space, which weakened low frequency component and strengthened the high frequency component appropriately, to make the whole image evenly. Then, Top-Hat transformation is adopted to remove a large area of the target background and segment the target's active area. Finally, watershed algorithm is used for segmentation of adhesive particles. Experimental results show that the proposed method is simple and practical and can segment the targets form uneven illumination particle images.


INTRODUCTION
With the development of computer science and technology, digital image processing method has become an important means of particle detection. Its purpose is to obtain the accurate contour information from the granular appearance of particle image, further to measure and analyze the characteristic parameters of those particles, so as to create conditions for making proper use of them and get better understanding of their properties. The first step of particle analysis is to separate the target particles from the background and many methods for particle image segmentation are commonly used, such as the threshold-based method, the region-based method, the template-based method, the clustering-based method and a variety of other algorithms (Zheng et al., 2003). However, in the detection and analysis systems based on computer vision, because of the properties of camera, the impact of camera conditions and the different absorption and reflection properties to light sources on partial surface of detected objects, it often results in that the objects have uneven exposure to light, with some of the partial surface are bright and some are dark (Lu and Yan, 2005). It influences the precision of the detection and analysis of the results. Non-uniform light field illumination in the image generates background noise which is mixed with signals together and that always results in weak image contrast or dark spots (Wang and Cui, 2010). This not only undermines the real information of the images, but also seriously affects the visual effects of the images, with influence on the following image processing and analysis (Adelmann, 1998). Therefore, to study a fast and efficient algorithm to eliminate the impact of the uneven illumination, realize the segmentation of particles and background and accomplish counting of particles should be solved in the machine vision inspection system.
To this question, on the analysis of the common image segmentation techniques, a novel method is proposed based on a homomorphic filter, Top-Hat transformation and watershed algorithm. Which will weaken the effects of uneven illumination by homomorphic filtering firstly, then to highlight the target details based on morphological method and realize the segmentation of target and background by using the watershed method finally. In practice, this method is simple and effective and can achieve satisfactory result for uneven illumination image.

TRADITIONAL IMAGE SEGMENTATION METHODS
Image segmentation is the process to separate target from background in order to extract the target of interest and the commonly used gray-scale segmentation method is binary technology. Suppose the source image is f (x, y), finding a gray value T as the threshold with certain criteria (Zhang and Zhang, 2005). If the value in f (x, y) is larger than T, then, assigning it with 1; else assigning it with 0. After thresholding operation, then, the binary image g (x, y) will be as follows: In general industrial applications, there is obvious brightness difference between the object and the background and which performs two spikes in the gray distribution histogram, as is shown in Fig. 1.
Then, it is easy to select a gray value T between the two peaks. By performing binary operations, the target and background will be separated. The commonly used threshold algorithm including:  The average threshold method: The simplest image segmentation threshold selection method will select the average image gray value as the threshold, namely: where, T = The segmentation threshold N = The number of image pixels l (x, y) = The gray value of the image  Otsu method: This method is deduced for the best threshold based on the principle of least squares method. Suppose there exists an original threshold t, which will be used for separating the target and background. When the threshold makes the largest variance of two types, the optimal threshold t = T is determined, that is: where, L = The gray level t = The original threshold T = The optimal threshold  Iterative method: Firstly, to choose a threshold value as the initial value, then according to some strategy to improve the estimates constantly until you meet the criteria given. The threshold determined from iterative method acts on each pixel (f) Maximum entropy method of whole image, thus, it will result in the poor effect even failure to the images which are of sharp grayscale changes.  The maximum entropy method: Entropy is a characterization of the average amount of information, according to information theory, the definition of entropy is: where, p(x) = The probability density function of random variable x What the entropy threshold is to select a value t so as to make the two parts have the amount of first-order gray level information, namely the maximum entropy. Suppose threshold t can separate the object O from background B in the image, the condition need to be satisfied is: Then, the t which makes H(t) have the maximum value will be the optimal threshold T to separate the objects from background.
By adopting the above methods, the segmentation results on an uneven illumination particle image are shown in Fig. 2.
From the results, it can be seen that these methods are not ideal to uneven illumination image, and the bright or dark areas cannot be taken into account at the same time, so the wrong segmentation will appear. By analyzing the gray level histogram of the original image, it can be found that there are no peaks between the background and objects. So, it is not easy to find the right value relying on this method, and the direct threshold segmentation method cannot adapt to uneven illumination image correct separation. Thus, a series of gray-scale compensation or correction are often needed before the segmentation.

THE FRAMEWORK OF PROPOSED ALGORITHM
The homomorphic filtering which based on the lighting reflection model can take into account lighting and reflective properties, and can also consider the high-frequency details and low-frequency component of the image; Top-Hat Transformation is able to attenuate the background highlight the target; and watershed segmentation can solve the question of adhesion between the particles. Thus, the combination of these methods will be able to obtain satisfactory for uneven illumination particle image segmentation.
Homomorphic filtering: In general, an image can be regarded as a two-dimensional function of the form f(x, y), If we denote illumination as i(x, y) and reflectance as r(x, y), then an image f(x, y) can be expressed as: If we are in line with the characteristics of incident and reflected components in the images to design a suitable filter which can weaken the low-frequency components and enhance the high-frequency components. Then we can achieve the goals of overcoming the non-uniform light field, compressing dynamic range and enhancing contrast, et al., Homomorphic filtering is a frequency domain filtering process that can do it (Delac et al., 2006).
The specific steps of homomorphic filtering are as follows:  We could somehow transform the expression in (6) from multiplication to addition; the problem of high pass filtering would become trivial as we could use the multiplication or convolution property of the Fourier transformation. An obvious way to solve this problem is to take a natural logarithm of both sides of (6): It is abbreviated as:  In above equation, F(u, v), L(u, v), and R(u, v), are the Fourier transformation of Inf (x, y), Ini (x, y) and Inr (x, y), respectively, where spectrum function l(u, v) mainly centralize on low frequency and R(u, v) mainly centralize on high frequency.
 Inverse Fourier transformation is converting from frequency domain to the space domain. Supposing h(x, y) is the inverse Fourier transformation of S(u, v), then taking an inverse Fourier transformation of (10) provides: Hence, the enhanced image is stacked by illumination i(x, y) and reflection r(x, y) components.
 Finally, the desired filtered (enhanced) image g(x, y) can be obtained by the exponential operation: Its framework as shown in Fig. 3.

Top-hat transformation:
The main content of mathematical morphology is to describe the basic features or basic structure of the image by using a set of transformation (Ye and Peng, 2002). The most fundamental transformations are erosion and dilation and other transformations are defined by a combination of them. Let f(x) and b(x) are two discrete functions defined on the two-dimensional discrete space F and B, respectively, where f(x) is a grayscale image, b(x) is the structural elements. Then, the dilation and erosion of f(x) to b(x) are defined as: The opening and closing morphological operations of f(x) to b(x) are defined as: According to the difference of opening and closing operation, the Top-Hat operator is divided into opening Top-Hat and closing Top-Hat.
The opening and closing Top-Hat operators are defined as: Top-Hat operator has certain characteristics of the high-pass filter, which means that the Top-Hat operator can detect the peak of image gray values and closing Top-Hat operator can detect the valley of image gray values.

Watershed algorithm:
The watershed algorithm is a segmentation method based on the topological theory of mathematical morphology. The principle is described as follows: Firstly, taking an image as a geodesic topological landscape, the gray value of each pixel in the image corresponds to the altitude, the terrain and uniform gray value local minima region regarded as the basin and at its lowest point, the water slowly immersed in each hole, with the deepening of the flooding, a local minimum of the domain slowly outward expansion. When the water fills the basin, some dams will be built between a two or more basins, each basin will be completely submerged as the water level rising and left some un-submerged dams, each basin dam was completely surrounded, so you can get each dam (i.e., watershed) and each separated by the dam basin (i.e., the object) and ultimately achieve the purpose of division of adhesions objects (Zou et al., 2005). Obviously, if the gradient of the image is taken as an input image, the watershed will be the maximum point of the first derivative, that is, the image edge points. The simulation of watershed principle is shown in Figure 4.
The main advantage of the watershed segmentation method is to extract almost the same object from the background and it can get the edge of the region (i.e., watershed) and the number of regions.

EXPERIMENTAL RESULTS
In order to test the performance of proposed method, we use MATLAB to realize the simulation program. The working process of the algorithm is: Firstly, input uneven illumination source image and do homomorphic filtering to finish gamma correction. Then, do Top-Hat transformation to further eliminate the uneven background of the source image and generate an appropriate uniform background image. Finally, perform threshold segmentation algorithm to segment image processed and finally get the ideal image segmentation results.
Experimental results are shown in following figures. Figure 5(a) is the four balls image collected in uneven illumination environment with the size of 320×320 pixels. Figure 5(b) shows the result of homomorphic filtering, it can be seen that the overall brightness of uneven illumination has been improved to uniform background, the contrast of particles and background has been enhanced to maintain a good target information for further analysis. Figure 5(c) shows the results of the Top-Hat transformation and it weakened the particle image background and highlights the details of the particles. In Fig. 5(d), targets and background have been separated from the binary image after local thresholding processing.  Figure 5(f) is watershed segmentation image, it can be seen from the figure that the target particles are divided into four regions and to solve the problem of adhesion between the particles. Figure 5(g) shows the particle contours of various targets segmented and in Fig. 5(h), the center of each particle is marked using the '+' finally. From above, it can be seen that we can get the ideal image segmentation results from uneven illumination images.

CONCLUSION
In machine vision systems, uneven illumination had an impact on the image segmentation and subsequent particle analysis. To this question, novel method is proposed based on homomorphic filtering, Top-Hat transformation and watershed algorithm in this study. By homomorphic filtering, it can weaken low frequency component and strengthen the high frequency component appropriately in frequency space, to make the whole image evenly. Then, Top-Hat transformation is adopted to remove a large area of the target background and segment the target's active area. Finally, watershed algorithm is used for segmentation of adhesive particles. Experimental results show that the proposed method is simple and effective, which makes the uneven illumination image correction reached a satisfactory result. But to the severe adhesion particle images, the algorithm will have limit effect and how to improve the adaptability of this algorithm will be the focus of future research work.