#### Abstract

A new image segmentation based on fast implementation of the Chan-Vese model is proposed. This approach differs from previous methods in that we do not need to solve the Euler-Lagrange equation of the underlying variational problem. First, through experiments, we observe that for the smooth image segmentation, Chan-Vese model (CVM) can be simplified. Utilizing the Gaussian low pass filter, we pretreat the original image and regularize the level curves. Then, we calculate the energy directly on discrete gray level sets, find the minimizer of the energy, and obtain the segmentation results. We analyze the algorithm and prove that under discrete gray level sets, the global minimum of the energy is same as the one obtained by the previous methods. Another advantage of this method is that the reinitialization is not needed. Since there are at most 255 discrete gray level sets, the algorithm improves the computational speed dramatically. And the complexity of the algorithm is , where is the number of pixels in the image. So even for the large images, it is also very efficient. We apply our segmentation algorithm to synthetic and real world images to emphasize the performances of our model compared with other segmentation models.

#### 1. Introduction

Images are the proper 2D projections of the 3D world containing various objects. To successfully reconstruct the 3D world, at least approximately, the first crucial step is to identify the regions in images that correspond to individual objects. This is the well-known problem of image segmentation. It has broad applications in variety of important fields such as computer vision and medical image processing.

Variational methods [1–16] have been extensively used and studied in image segmentation in the past decade because of their flexibility modeling and various advantages in the numerical implementation. These methods drive one or more initial curve(s), based on gradient and/or region information in the image, to the boundaries of objects in that image. The basic idea of variational methods is to minimize an energy. This functional generally depends on the features of the image. The classical way to solve the minimization problem is to solve the corresponding Euler-Lagrange equation. For instance, relatively early, Mumford and Shah [1] introduced a celebrated segmentation model by minimizing an energy functional that penalizes smoothness within regions and the length of their discontinuity contours. Recently, Chan and Vese [4] developed an active contour without edge model to deal with the problem of image segmentation by using the level-set framework introduced by Osher and Paragios [17]. Tsai et al. [5] also independently developed a segmentation method which is similar to it. The active contour methods [4–8, 10, 13] based on level-set framework have several advantages. First, they can deal with topological changes such as break and merger. Second, intrinsic geometric elements such as the normal vector and the curvature can be easily expressed with respect to the level-set function. Third, this level-set framework can be extended and applied in any dimension.

However, the active contour methods based on level-set framework have some limitations. First, these methods are usually implemented by solving the partial differential equations (PDEs) and thus computational efficiency sharply decline because of numerical stability constraints. Particularly, the signed distance reinitialization procedure is necessary. It severely limits the efficiency of Chan-Vese model. Second, most methods have the initialization problem [6]: different initial curves produce different segmentations because of the nonconvexity of Chan-Vese model. More recently, some of the researchers develop fast algorithms [14–16, 18–20] for the Chan-Vese image segmentation model. In [14, 15, 18], the authors develop fast algorithms based on calculating the variational energy of the Chan-Vese model directly without the length term, that is, solving PDEs. In [14], the authors develop a fast method for image segmentation without solving the Euler-Lagrange equation of the underlying variational problem proposed by Chan and Vese [4]. Instead, they calculate the energy directly and check if the energy is decreased when they change a point inside the level-set to outside or vice versa. Later, various modifications of Chan-Vese model, related to different aspects of the image analysis, have been proposed, such as adaptive segmentation of vector images [7, 8, 19, 20] knowledge-based segmentation [13].

An efficient implementation method for the Chan-Vese model is proposed in this paper. Since the simplified Chan-Vese model is without the length term, the new method does not have to solve PDEs. Our method is the hybrid of the discrete simplified Chan-Vese model and the discrete gray level-set framework. First, we decouple the Chan-Vese model into two stages: in the first stage, utilizing Gaussian low pass filter to pretreat the original image and obtaining some appropriate smooth versions of the original image; in the second stage, segmenting the smooth image by Chan-Vese model without the length term. Second, we implement the previous algorithm based on the discrete gray level-set framework. Our segmentation method is also divided into two stages: in the first stage, we smooth the image into required scale; in the second stage, we calculate the energy directly on discrete gray level sets and find the minimizer of the energy. Each stage is independent and at each stage the method is flexible. The new method bears some similarities to [14, 15, 18], but we calculate the energy directly on discrete gray level sets, which is a new framework. More complicated issues which are not considered in [14], such as sensitivity to noise, are discussed. The segmentation method can also deal with complicated image, and the CPU time of large size/complicated images is not too long. First, we do not need to solve the Euler-Lagrange equation of the underlying variational problem, so the initial conditions and the procedure of reinitiation are not needed. Second, in the second stage of our algorithm, the main computation process is adding operators and logical operators, which costs little CPU time, so the complexity of the algorithm is .

This paper is organized as follows. In Section 2, we present the Chan-Vese piecewise smooth active contours model [4] (also the algorithm of Tsai et al. [5]) for image segmentation. In Section 3, we give a full account of our model. Experimental results are presented in Section 4, and the final section is our conclusion.

#### 2. The Main Idea of the Chan-Vese Active Contours Model

In this section, we present the main idea of the Chan-Vese active contours model in order to develop the idea of the new fast hybrid level-set algorithm.

The active contour model proposed by Chan and Vese [4] is a particular case of the Mumford-Shah model [1]. Consider an image with the domain . Let the segmenting closed curve (active contour) divide into two partitions and , which is corresponding to the image subdomains inside and outside the curve , respectively. It minimizes the following energy functional: where is the average value of in each region and is a positive constant.

Using the level-set method in [17], the authors replace the unknown curve by the level-set function defined by Denote the Heaviside function Then the energy functional (1) can be written in terms of the level-set formulation as The finial segmentation curve could be obtained from the minimizer of the energy functional (4) with respect to . Using a gradient descent method, minimizing (4) yields the following problem: where in the distribution sense and From the solution of the problems (5) and (6), we obtain the evolution of , defined by , which is the boundary between the sets and . Therefore, the original image is segmented into two parts.

It is noticed that (5) is a nonlinear parabolic partial differential equation. So it requires expensive computation since the solution is on a large time domain (i.e., from the initial curve location to the finally achieved steady state). In particular, we need to reinitialize the level-set function to a signed distance function in each iteration. If we do not do it, when the level-set function becomes very sharp or flat during the evolution, it makes computation highly inaccurate. Although some semi-implicit methods in [21, 22] could be used to partially alleviate the computational burden, the process of reinitialization is very important and may not be avoided by using some level-set methods. All in all, the Chan and Vese algorithm works very well for image segmentation, but solving the Euler-Lagrange equations (5) and (6) and re-initializing the level-set function cost a lot of CPU time.

In Section 3, we will propose a fast hybrid gray level-set algorithm in order to overcome the previous shortcomings of the Chan-Vese model.

#### 3. Our Method

In this section, we show a two-stage scheme for implementation of the piecewise constant segmentation model. More precisely, the smooth version of the original image is first obtained by some smooth filters, and then minimizing the modified Chan-Vese energy functional on the gray level sets, the image is divided into two subregions.

##### 3.1. Segmentation for the Smooth Image

In the Chan-Vese segmentation model, the parameter in (4) is a weight of the regularizing term, which controls the length of the zero level-set. When the noise level is high, the parameter should be large and only large objects are detected. When the noise level is low, the parameter could be small and objects of small size are detected. Because the Chan-Vese model is independent of the gradient of the image, the input image can be smooth enough [4]. So the segmentation method for the smooth image should be different from the method for the noise image. In Figure 1, we present results of the noise image and some smooth versions of the noise image by the Chan-Vese model with the same parameter , respectively. It is noticed that for the smooth image, the parameter could vanish in Chan-Vese model, and the good segmentation is also obtained.

**(a)**

**(b)**

**(c)**

**(d)**

Now, based on the previous facts, we assume that the input image is reasonably smooth, and then the parameter could vanish in (4). Hence the following simplified Chan-Vese model without the length term is considered: Using the gradient descent method, minimizing (7) can solve the following problem: where in the distribution sense and The simplified Chan-Vese algorithm is sketched in the following.

*Algorithm 1. *The simplified Chan-Vese algorithm is the following two-stage scheme. (1)By the smooth filter obtain some appropriate smooth versions of the noise image . (2)Calculate the minimum of the simplified Chan-Vese energy (7). (i)Initialize , . (ii)Compute and by (9).(iii)Solve the equation in from (8), to obtain .(iv)Reinitialize locally (this step is optional). (v)Check whether the solution is stationary. If not, and repeat (ii)–(v).

The main difference between Algorithm 1 and the original Chan-Vese model is whether the input image requires smooth pretreatment. In Algorithm 1, there are a lot of methods to smooth image, such as Gaussian low pass filter, averaging filter, Laplacian filter, and enhancing filter based on PDEs. In this paper, we choose the simplest and possibly one of the most popular ways, Gaussian low pass filter. Though all image information, such as the noise and edges, will be indistinguishably destroyed by this filter, it tampers with the segmentation result little, since the Chan-Vese model makes use of a stopping edge function based on the density of the image instead of the gradient. It is notice that if the images are noisy, we do a preprocessing step to smooth or enhance the images firstly, or else this step is needless. In Figures 2 and 3, we present the other two experiments by Algorithm 1. In the two experiments, Figure 3(a) is smoother than Figure 2(a), so Figure 3(a) needs to be smoothed more. For the level-set method, it is inevitable to reinitialize the level-set function for the stability of algorithms. However, for Algorithm 1, we need not reinitialize the level-set function to a signed distance function in each iteration, which is different from the Chan-Vese model. In Section 4, from the numerical experiments, we show the interesting phenomenon.

**(a)**

**(b)**

**(c)**

**(d)**

**(a)**

**(b)**

**(c)**

**(d)**

Now, let us observe the following facts: for the noise image, the gray level lines are disorderly and irregular, while for the smooth image, the gray level lines are smooth and regular. These basic remarks are illustrated in Figure 4. In Figure 4(j), the contour line is very approximate to the real edges of the original image. Hence, we think the best segmentation result is one of the contour lines. How can the best segmentation result, that is, the most appropriate contour line, be obtained? In the next subsection, we will answer the question and then propose the new algorithm.

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

**(g)**

**(h)**

**(i)**

**(j)**

**(k)**

**(l)**

##### 3.2. The Discrete Simplified Chan-Vese Energy Functional on the Discrete Gray Level Sets

Let , for , be the gray level of a true -by- image at pixel location , and let be the range of , that is, . Let and , and then the image is divided into two regions by the pixel location. Instead by , by , and by , respectively. Then minimizing the energy (7) is changed into minimizing with where is the number of pixels in and is the number of pixels in . When the energy reaches a minimum, the best segmentation results are obtained, that is, the subregion and subregion . It is noticed that since the selection of and is arbitrary, there are lots of combinations , so minimizing the energy is difficult. Now, we try to narrow the scope of the probable combinations. For any , the image is divided into two subregions, that is, and .

*Definition 2 (discrete gray level-set). *The -discrete gray level-set which is the set of pixel location is defined as follows:
where is the gray level of the image at pixel location .

Then , for . Let , and then the element number of the set is . For every level , the image is always divided into two disjointed subregions by and . In Figure 4, the boundary of () is displayed at the different levels , for the image .

Theorem 3. *Minimizing the energy functional is equivalent to
**
where and are defined as (11). *

*Proof. *If , then for any , , we have and , where and are defined as (11). It is obvious that . We only need to prove .

Assume there exist two subdomains and such that attains its minimizer. If there exist and such that , then we denote and .

Comparing the energy and , we get
Since , we have
So we get
Since the energy obtains its minimizer, it is a contradiction. We complete the proof of the theorem.

By the proof mentioned previously, we can easily see that Hence we have the following.

Theorem 4. *Minimizing the energy functional is equivalent to
**
where and and are defined as (11). *

Now, if the energy functional reaches a maximum, the best segmentation results are obtained, that is, the subregion and subregion . Since , the energy functional has cases, and then the maximum of is easily found. The algorithm is sketched here in the following.

*Algorithm 5. *The method of maximizing the following functional .(1)Sweep the image once, record the number of all pixels at every gray level of the image which range from to . (2)Calculate the energy by (18), for , and find the maximizer . (3)The image is divided into two subregions, that is, and .

*Remark 6. *In fact, we restrict , , since if two pixels with the same value belong to both and , it will be ambiguous to determinant. However, the pixel number of at gray level is a little and cannot influence the maximizer of the energy . The experiment result shows that our approximated method is still efficient.

##### 3.3. The Final Method

Based on Algorithm 5, the following is the new two-phase scheme for image segmentation.

*Algorithm 7. *(i) (*Smooth the original image*): For the input noise image , use the Gaussian smooth filter to obtain the smooth image (If the input image is noiseless, this step is optional).

(ii) (*Segmentation*): Use Algorithm 5 to obtain the segmentation results for the smooth image , that is. (1)Sweep the image once, record the number of all pixels at every gray level of the image which range from to . (2)Calculate the energy by (18), for , and find the maximizer . (3)The image is divided into two subregions, that is, and , and this completes a segmentation.

*Remark 8 (segmentation for various types of noisy image). *There are lots of methods to obtain the smooth image in the first phase of the new method. (i)If the type of noise is “salt and pepper,” for example, the AMF (adaptive median filter) can be selected. (ii)If the noise is “addition gauss noise,” for example, the gaussian lower-pass filter, the TV method [23], the PM method [24], and the other anisotropic diffusion method can be used to smooth the original image. (iii)If the noise is “Poisson noise,” for example, the Variational method [25] can be used to denoise the original image.

In the new algorithm, the segmentation is only dependent on the smooth image but not sensitive to the smoothing scale. In Figure 5, using the new algorithm, we deal with the image with different types of noise.

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

*Remark 9. *In the new algorithm, we select the Gauss low pass filter to obtain the smooth image. However the filter is not necessary. If the image is corrupted by the different way, we will select the different filters, such as average filter, Laplacian filter, and unsharp filter. For the addition Gaussian noise, the gaussian lower-pass filter may be the best tradeoff between time and segmentation.

#### 4. Simulations

In this section, numerical examples on some synthetic and real world images are presented to illustrate the effectiveness of the new two-phase scheme in Section 4 by comparing it with Chan-Vese model.

##### 4.1. Configuration

In the new algorithm, the first stage is smoothing the original image by low pass filter. The low pass filter is generally made by convolution with Gaussian of increasing variance, which is as follows: where and denotes the convolution operation. Koenderink [26] noticed that the convolution of signal with Gaussian at each scale is equivalent to the solution of the heat equation with the signal as initial datum ; that is, Assuming a time step size of and a space grid size of , we quantize the time and space coordinates as follows: where is the size of image support. The classical five-point explicit numerical schemes of the heat equation (20) are as follows: or equivalently where is for the stable of numerical scheme.

The simulations are performed in Matlab R2007b on a 2.8 GHz Pentium 4 processor. For comparison purpose, the Chan-Vese method (CVM) [4] is also tested. We utilize a locally one-dimensional (LOD) scheme for CVM, which is an unconditional scheme [10].

##### 4.2. Segmentation Performance

In Figures 6 and 7, we illustrate the performance of CVM, Algorithms 1 and 7 on synthetic noise *Test01* and *Test02* images. Among the segmentations, all algorithms give similar and good performances. For CVM (the Chan-Vese method), utilizing the unconditionally LOD scheme, the time step size can be sufficiently large to reduce the iteration steps (only 6/7 steps in Table 1). However, re-initializing the level-set function costs a lot of CPU time (in Table 1).

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

**(g)**

**(h)**

**(i)**

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

**(g)**

**(h)**

**(i)**

In Figure 8, on the synthetic noise *Test03* image, we illustrate the results of Algorithm 1 with reinitialization and without reinitialization, respectively. One can see that in the segmentation process, reinitializing the level-set function or not influences the results of Algorithm 1 little (Figures 8(d)–8(g)). In CVM, reinitialization lets the level-set function not be very sharp, and in mathematics. Algorithm 1 does not need , so reinitialization is not necessary.

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

**(g)**

In Figures 9 and 10, we illustrate the results of Algorithm 1 without reinitialization and Algorithm 7 about a real *CT* and *Stone* image. Few differences between the segmented images are observed, but our method works much more faster than CVM (in Table 1).

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

**(g)**

**(h)**

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

##### 4.3. Robustness with the Smooth Scale

Instead of the low pass filter, we use the scheme (23) to smooth the image. Hence, the smooth scale depends on the parameter and the iteration step. The smoother of the original image, the more regular of the optimal gray level line. But if we regularize too much, we will remove details from the image (in figures, the corner information is lost). In Figure 11, we illustrate how our model works on a real nebula image with and different iteration steps. In Figure 11, we can see that in different smooth scales , the gray level lines are different and evolved into the more regular ones. Compared with CVM, Algorithm 1 need not the initial level-set function and reinitialization. In Algorithm 1, we just adjust the parameter and the iteration step, and always obtain the global minimum of the energy functional.

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

**(g)**

**(h)**

**(i)**

**(j)**

**(k)**

**(l)**

**(m)**

**(n)**

**(o)**

##### 4.4. Computational Complexity

We end this section by considering the complexity of our algorithm. Our algorithm requires two phases: smoothing the original image and segmenting. The first phase is done by the scheme (23). Similar to other low pass filters, it is fast. It is also worth mentioning that one of the efficient implementations of the scheme (23) is FFT (Fast Fourier Transform Algorithm) and the complexity of this stage is , where is the number of pixels in the image. In the second segmentation phase, our algorithm only sweeps the image once, so the complexity of the stage is no more than . In Table 1, we compare the CPU time needed of all three algorithms. We summarize that the CPU time of our Algorithm 7 is about 0.01–0.08 seconds which is the fastest in three algorithms.

##### 4.5. Comparison with Some Other Segmentation Methods

There are some classical segmentation methods, such as the watershed algorithm [27], the Canny filter [28], and the Sobel filter. In Figure 12, the smooth versions of the images mentioned previously are processed by these algorithms. Watershed algorithm provides the advantages of stabilization and speediness, but is prone to oversegmentation in Figures 12(a)–12(c). In Figures 12(d)–12(f), the segmentation result of the Sobel operator is sensitive to the threshold: if the threshold is too small, the redundant edges will be detected; if the threshold is too big, the detected edges will be broken. The Canny filter is sensitive to noise in Figures 12(h)–12(i).

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

**(g)**

**(h)**

**(i)**

#### 5. Summary and Further Research Directions

In this paper, we have proposed and implemented a new image segmentation algorithm based on the Chan-Vese active contour model. The discrete gray level-set method is employed in our numerical implementation. This algorithm works in two steps, smoothing the noisy image by using the heat equation filter method and then using the new discrete gray level-set method to segment the region of the original image.

In the Chan-Vese segmentation algorithm, the initialization of the level-set functions is a difficult problem. In the proposed new segmentation algorithm, the initialization is not required. And each step is simple and easily achieved. In the first step, there are a lot of algorithms to get the smooth version of the original image, and in the second step, we sweep the image only once and calculate (18) at every gray level (in fact, only 256 gray level sets) and then find the optimal gray level. In Table 1, we show the CPU time of the Chan-Vese method and our proposed method. Obviously, our method is more efficient than the Chan-Vese method.

Compared with the previous simultaneous segmentation methods [4, 5, 10], the proposed method is more simple, efficient, and flexible. First, we separate the segmentation processes into smoothing the original image and segmenting the smooth image into two regions, and in the second step, the mass of the computation process is adding operators and logical operators. Therefore, the CPU time of the second step is only a little (Tables 1 and 2). Second, the first step is just to get some smooth versions of the original image, so in some sense the second step is independent of the result of the first step, and the second step must have a result (of course, it is not always good).

While we have not pursued it in this paper, one of the potential advantages of our method is that we can also use it to color image. For example, one method for the color image segmentation is that we replace (1) by the new energy function proposed by Chan et al. [8], and other processes are similar to this paper.

#### Acknowledgments

This work is supported by the Heilongjiang Postdoctoral Fund (Grant No. LBH-Z12102), the Fundamental Research Funds for the Central Universities (Grant No. HIT.HSS.201201), the National Natural Science Foundation of China (Grant No. 71173060, 70773028, and 71031003), and the Natural Science Foundation of Heilongjiang Province of China (Grant No. G201006).