Skip to main content

Fast two-phase image segmentation based on diffusion equations and gray level sets

Abstract

In this paper we propose a new scheme for image segmentation composed of two stages: in the first phase, we smooth the original image by some filters associated with noise types, such as Gaussian filters for Gaussian white noise and so on. Indeed, we propose a novel diffusion equations scheme derived from a non-convex functional for Gaussian noise removal in this paper. In the second phase, we apply a variational method for segmentation in the smoothed image domain obtained in the first phase, where we directly calculate the minimizer on the discrete gray level sets. In contrast to other image segmentation methods, there is no need for us to re-initialize parameters, which deduces the complexity of our algorithm to O(N) (N is the number of pixels) and provides significant efficiency improvement when dealing with large-scale images. The obtained numerical results of segmentation on synthetic images and real world images both clearly outperform the main alternative methods especially for images contaminated by noise.

1 Introduction

Images are the proper 2-D projections of the 3-D world containing various objects. To reconstruct the 3-D world perfectly, 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 as image segmentation which has broad applications in a variety of important fields such as computer vision and medical image processing.

Image segmentation has been studied extensively in the past decades. A well-established class of methods consists of active contour models, which have been widely used in image segmentation with promising results. In general, these models apply variational methods where they minimize some energy functionals depending on the features of the image. Classical ways to solve such problems are to solve the corresponding Euler-Lagrange equations. The existing active contour models can be roughly categorized into two classes: region-based models [1–9] and edges-based models [10–14]. A literature review of major active contour models can be found in [15–17].

Based on image gradient information, edges-based models drive one or more initial curve(s) to the boundaries of objects in the image. However, edges-based models are usually sensitive to noise and weak edges information [2]. Instead of utilizing image gradient information, region-based models typically aim to identify each region of interest by using a certain region descriptor, such as intensity, color, texture, to guide the motion of the contour [17]. Therefore region-based models tend to rely on global information to steer contour evolution, which increase the chance to have better performance in the presence of image noise and weak object boundaries. In addition, region-based models are less sensitive to the initial contour locations than edge-based models. For instance, Chan and Vese [1] developed an active contour without edge model to deal with image segmentation by using the level-set framework introduced by Osher and Sethian [15], which is similar to the segmentation method independently proposed by Tsai et al. [3]. The active contour methods based on level-set framework have several following advantages. Firstly, they can deal with topological changes such as breaking and merging. Secondly, intrinsic geometric elements such as the normal vector and the curvature can be easily interpreted with respect to the level-set function. Finally, this level-set framework can be extended and applied in any dimension.

However, these active contour methods based on level-set framework have some drawbacks. Firstly, most of these methods have initialization problems: different initial curves produce different segmentations because of the non-convexity of Chan-Vese models [4]. Secondly, these methods are usually implemented by solving corresponding evolution equations that suffer from severe numerical stability constrains which render them inefficient. For instance, Chan-Vese models become severely inefficient due to the signed distance re-initialization procedure for stability reason. Recently, some researchers developed fast algorithms [18–23] to the Chan-Vese image segmentation model to avoid these drawbacks above. In [18–21], the authors developed fast algorithms based on calculating the variational energy of the Chan-Vese model directly without the length term. In [18], the authors proposed a fast method for image segmentation without solving the Euler-Lagrange equation of the underlying variational problem proposed by Chan and Vese, therefore they calculated the energy directly and checked if the energy is decreased when they change a point inside the level set to outside or vice versa.

In this paper we develop a two-phase image segmentation model. In the first phase, we propose a new non-convex functional to get the smoothing image of the original image for noise removal, resulting in the sharpened edge. We also prove the nonexistence of the minimizer of the non-convex functional above. Noted that this purpose may be accomplished by other smoothing filters, for example, the Gaussian low-pass filter in the general case. In the second phase, a new functional based on gray level sets is firstly proposed, and then the associated discrete model based on the discrete gray level sets is discussed, which educes the new segmentation algorithm to obtain the segmentation results. Each stage is independent and thus the method at each stage is flexible. Although the new methods share some similarities to those in [18–20], it is a new framework that we calculate the energy directly on discrete gray level sets. Furthermore, we discuss other complicated issues which are not considered in [18], such as sensitivity to noise. Last but not least, our segmentation method can also deal with large-scale images because of the following reasons. Firstly, we do not need the initial conditions and the procedure of re-initiation as we directly calculate the minimizer on the discrete gray level sets rather than solving the Euler-Lagrange equation of the underlying variational problem. Secondly, in the second stage of our algorithm, the main computation process, which is adding operators and logical operators which cost little CPU time, deduces the complexity of the algorithm to O(N).

This paper is organized as follows. In Section 2, we propose two-phase segmentation model. Experimental results are given in Section 3, and the final section is our conclusion.

2 Two-phase segmentation model

In this section, we show a two-stage scheme for implementation of the piecewise constant segmentation model. More precisely, the smoother version of the original image is first obtained by some smooth filter, and then, minimizing the Chan-Vese minimal variance criterion on the gray level sets, the image is divided into two subregions. Based on the idea above, we deal with the problem in two phases, respectively. Firstly, we propose a new denoising functional to obtain smoothing images. Secondly, we consider the continuous model of the new two-phase segmentation model based on gray level sets to propose the associated discrete model and then obtain a new algorithm.

2.1 The non-convex functional for Gaussian noise removal

In our two-phase algorithm, the second phase is fixed and can be easily performed and the new method depends in a large part on the smooth version u of the original image. So it is better to use different edge-preserving denoising models for various types of noise.

According to conclusions in [24], the non-convex functional may provide better or sharper edges than the convex functional does. In the smoothing phase of our method, the following edge-preserving denoising model is considered

min { E ( u ) = 1 α ∫ Ω | ∇ u | α d x + λ ∫ Ω | u − f | 2 d x } ,
(2.1)

where 0<α<1. Note that for 0<α<1, the model is non-convex, so the edges will be protected and even enhanced. However, the model above is an ill-posed problem. According to the proof given by Chipot et al. [25], we have the following theorem.

Theorem 2.1 If f(x) is not a constant and f∈ L ∞ (Ω), the function E(u) has no minimizer in W 1 , 2 (Ω) and inf u ∈ W 1 , 2 ( Ω ) E(u)=0.

Proof We only prove the one-dimensional case Ω=(a,b), and the same proof goes for N≥2.

By density, we may always find a sequence of step functions u ˜ n such that

| u ˜ n |≤ | f | L ∞ , lim n → + ∞ | u ˜ n − f | L 2 ( Ω ) =0.

In fact, we can find a partition a= x 0 < x 1 <⋯< x n =b such that u ˜ n is the constant u ˜ n , i on each interval ( x i , x i ), h n = max i ( x i − x i − 1 )<1 with lim n → + ∞ h n =0. Let us set σ i = x i − x i − 1 . Next, we define a sequence of continuous functions u n by

u n (x)= { u Ëœ n if  x ∈ [ x i − 1 , x i − σ i 2 / ( 1 − α ) ] , u Ëœ n , i + 1 − u Ëœ n , i σ i 2 / ( 1 − α ) ( x − x i ) + u Ëœ n , i + 1 if  x ∈ [ x i − σ i 2 / ( 1 − α ) , x i ] .

Note that

| u ˜ n − u n | L 2 ( Ω ) 2 = ∑ i = 1 n ∫ x i − σ i 2 / ( 1 − α ) x i ( u ˜ n , i + 1 − u ˜ n , i ) 2 ( x − x i σ i 2 / ( 1 − α ) + 1 ) 2 d x ≤ 4 3 | f | L ∞ ( Ω ) 2 ∑ i = 1 n σ i 2 / ( 1 − α ) ≤ 4 3 | f | L ∞ ( Ω ) 2 h n ( 1 + α ) / ( 1 − α ) ∑ i = 1 n σ i = 4 3 | f | L ∞ ( Ω ) 2 ( b − a ) h n ( 1 + α ) / ( 1 − α ) ,

and therefore,

lim n → + ∞ | u ˜ n − u n | L 2 ( Ω ) =0.

Since

| u n − f | L 2 ( Ω ) ≤ | u ˜ n − u n | L 2 ( Ω ) + | u ˜ n − f | L 2 ( Ω ) ,

and then taking the limit on both sides yields

lim n → + ∞ | u n − f | L 2 ( Ω ) =0.

Moreover,

1 α ∫ a b | ∇ u | α d x = 1 α ∑ i = 1 n ∫ x i − σ i 2 / ( 1 − α ) x i ( u ˜ n , i + 1 − u ˜ n , i ) α σ i 2 α / ( 1 − α ) d x ≤ 1 α 2 α | f | L ∞ ( Ω ) α ∑ i = 1 n σ i 2 ≤ 1 α 2 α | f | L ∞ ( Ω ) α h n ∑ i = 1 n σ i = 1 α 2 α | f | L ∞ ( Ω ) α h n ( b − a ) .

Thus

lim n → + ∞ 1 α ∫ a b | ∇ u | α dx=0,

and finally,

0≤ inf u ∈ W 1 , 2 ( Ω ) E(u)≤ lim n → + ∞ E( u n )=0,

i.e.,

inf u ∈ W 1 , 2 ( Ω ) E(u)=0.

Now, if there exists a minimizer u∈ W 1 , 2 (Ω), then necessarily E(u)=0, which implies

∫ a b | u − f | 2 d x = 0 ⇔ u = f a.e. , 1 α ∫ a b | ∇ u | 2 d x = 0 ⇔ u ′ = 0 a.e.

The first equality is possible only if f∈ W 1 , 2 (Ω), and in this case the second equality implies f ′ =0, which is possible only if f is a constant. Therefore, excluding this trivial case, E(u) has no minimizer in W 1 , 2 (Ω). □

Remark 2.1 As we all know, if the region Ω is bounded,

W 1 , 2 (Ω)⊂ W 1 , 1 (Ω)⊂BV(Ω),

then

inf u ∈ W 1 , 2 ( Ω ) E(u)≥ inf u ∈ W 1 , 1 ( Ω ) E(u)≥ inf u ∈ B V ( Ω ) E(u).

Note that E(u)≥0, and therefore

inf u ∈ B V ( Ω ) E(u)=0.

However, we cannot obtain any information about the minimizer of E(u) in BV(Ω).

From the Euler-Lagrange equation for (2.1), we can obtain the following diffusion equation:

∂ u ∂ t =div ( | ∇ u | α − 2 ∇ u ) −λ(u−f),(x,t)∈Ω×T,
(2.2)
u(x,0)=f,x∈Ω,
(2.3)
∂ u ∂ n → | ∂ Ω =0,(x,t)∈∂Ω×T.
(2.4)

Remark 2.2 (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.

  • If the type of noise is ‘salt and pepper’, for example, the AMF (adaptive median filter) can be selected;

  • If the noise is ‘addition Gaussian noise’, for example, the Gaussian lower-pass filter, the new non-convex functional (2.1), the TV method (total variation model) [26], the PM method (Perona-Malik model) [27], and other anisotropic diffusion [28] methods can be used to smooth the original image;

  • If the noise is ‘multiplication noise’, for example, the SO method (Shi-Osher Model), which is an effective multiplicative noise removal model [29], can be used to denoise the original image.

2.2 Chan-Vese minimal variance criterion based on gray level sets

First let us review the following Chan-Vese minimal variance criterion

F( c 1 , c 2 ,ϕ)= ∫ Ω ( u − c 1 ) 2 H(ϕ)dxdy+ ∫ Ω ( u − c 2 ) 2 ( 1 − H ( ϕ ) ) dxdy.
(2.5)

Assume that the smooth image u is the solution from diffusion equations (2.2)-(2.4). Let χ K ={(x,y);u(x,y)<K} be the K-level set of u. It is clear that for the noise image, ∂ χ K is disorderly and irregular; while for the smooth image, ∂ χ K is smooth and regular. These basic facts are illustrated in Figure 1, where some ∂ χ K are very close to the real edges of the original image.

Figure 1
figure 1

The level lines at different gray levels. (a) The noise image with Gaussian white noise of mean 0 and variance 0.2. (b) The smooth image by Gaussian low-pass filter with σ=1.5. (c)-(g) The level lines of the noise image at the gray level 60, 80, 120, 180, and 200. (h)-(l) The level lines of the smooth image at the gray level 60, 80, 120, 180, and 200.

Hence, the level-set function can be replaced by the image gray function u in the Chan-Vese minimal variance criterion [2], and the new model is as follows:

F(K)= ∫ Ω ( u − c 1 ) 2 H(u−K)dxdy+ ∫ Ω ( u − c 2 ) 2 ( 1 − H ( u − K ) ) dxdy,
(2.6)

where

c 1 = ∫ Ω u H ( u − K ) d x ∫ Ω H ( u − K ) d x , c 2 = ∫ Ω u ( 1 − H ( u − K ) ) d x ∫ Ω ( 1 − H ( u − K ) ) d x ,
(2.7)

and the Heaviside function H

H(z)={ 1 if  z ≥ 0 , 0 if  z < 0 .

Minimizing the function above, the best threshold is obtained, and then the image is segmented into two subregions {(x,y);u≥K} and {(x,y);u(x,y)<K}.

Notice that

F(K)= ∫ Ω u 2 dx− c 1 2 ∫ Ω H(u−K)dx− c 2 2 ∫ Ω ( 1 − H ( u − K ) ) dx,
(2.8)
c 1 ∫ Ω H(u−K)dx+ c 2 ∫ Ω ( 1 − H ( u − K ) ) dx= ∫ Ω fdx,
(2.9)

for K m = min x ∈ Ω u,

F( K m )= ∫ Ω ( u − c 1 ) 2 dx, c 1 = u ¯ = 1 | Ω | ∫ Ω udx,

and for K M = max x ∈ Ω u,

F( K M )= ∫ Ω ( u − c 2 ) 2 dx, c 2 = u ¯ = 1 | Ω | ∫ Ω udx.

Theorem 2.2 Assume f∈ L 2 (Ω), and then there exists the minimizer K∈[ K m , K M ] of F(K). Furthermore, if f is not a constant function, then the minimizer is the minimum point with F ′ (K)=0.

Proof If f∈ L 2 (Ω), u∈ C 1 (Ω) and F(K)∈C[ K m , K M ], there exists the minimizer K ∗ ∈[ K m , K M ] of F(K). Noted that g(α)= ∫ Ω ( u − α ) 2 dx get the minimal at α= u ¯ , and then

∫ Ω ( u − c 1 ) 2 H ( u − K ) d x ≤ ∫ Ω ( u − u ¯ ) 2 H ( u − K ) d x , ∫ Ω ( u − c 2 ) 2 ( 1 − H ( u − K ) ) d x ≤ ∫ Ω ( u − u ¯ ) 2 ( 1 − H ( u − K ) ) d x .

Hence

F(K)≤F( K M )=F( K m )for K∈[ K m , K M ],

which implies that the minimizer is the minimum point. By the Fermat theorem, we obtain that there exists K∈( K m , K M ) such that F ′ (K)=0. □

For any images we can always obtain the function F(K). Figure 2(d) shows the function F(K) for the image in Figure 2(a). From the figure, we can see that F(K) has the global minimizer and has several local minimizers.

Figure 2
figure 2

Segmentation results by Algorithm 2.1. (a) The noise image. (b) The smooth image by Gaussian low-pass filter with σ=0.1. (c) The segmentation result (K=169). (d) The function F(K).

Based on the new model (2.6), the two-phase algorithm is sketched below.

Algorithm 2.1

  1. 1.

    (Smoothing) By (2.2)-(2.4) obtain some appropriate smooth version u of the noise image f.

  2. 2.

    (Minimal variance) Calculate the new model (2.6) for each K∈[ max x ∈ Ω u, min x ∈ Ω u], and then obtain the minimizer K with E(K)= min K ∈ [ K m , K M ] E(K). The segmentation results are {u(i,j)≥K} and {u(i,j)>K}.

2.3 Discrete version of model (2.6)

Let u i , j , for (i,j)∈D≡{1,…,M}×{1,…,N}, be the gray level of a true M-by-N image u at pixel location (i,j), and let [ K m , K M ] be the range of the smooth image u, i.e., K m ≤ u i , j ≤ K M . Let D 1 ⊂D and D 2 =D∖ D 1 , and then the image u is divided into two regions. Instead H(ϕ) by D 1 , and (1−H(ϕ)) by D 2 , respectively. Then minimizing the energy (2.5) is changed into minimize

F( c 1 , c 2 , D 1 , D 2 )= ∑ ( i , j ) ∈ D 1 ( u i , j − c 1 ) 2 + ∑ ( i , j ) ∈ D 2 ( u i , j − c 2 ) 2 ,
(2.10)

with

c 1 = ∑ ( i , j ) ∈ D 1 u i , j | D 1 | , c 2 = ∑ ( i , j ) ∈ D 2 u i , j | D 2 | ,
(2.11)

where | D 1 |= ∑ ( i , j ) ∈ D 1 1 is the number of pixels in D 1 , and | D 2 |= ∑ ( i , j ) ∈ D 2 1 is the number of pixels in D 2 . If the energy F reaches a minimum, the best segmentation results are obtained, i.e., the subregion D 1 and subregion D 2 .

It is noticed that since the selection of D 1 and D 2 is arbitrary, there are lots of pairs ( D 1 , D 2 ), so minimizing the energy F is difficult. Now, we introduce the following definition, which contains a limited number of elements.

Definition 2.1 (Discrete gray level set)

The K-discrete gray level set D K , which is the set of pixel location (i,j), is defined as follows

D K ≜ { ( i , j ) : u i , j < K } ,

where u i , j is the gray level of the image u at pixel location (i,j).

For any K∈[ K m , K M ], the image u is divided into two subregions, i.e., D 1 K ≜{(k,l): u k , l <K} and D 2 K ≜{(k,l): u k , l ≥K}. Then D 2 K =D∖ D 1 K . Let A≜{( D 1 K , D 2 K ),K∈[ K m , K M ]}, and then the element number N A of the set A is N A = K M − K m +1 which is less than 256 in general. Then minimizing the energy (2.6) is changed into minimize

F(K)= ∑ ( i , j ) ∈ D 1 K ( u i , j − c 1 ) 2 + ∑ ( i , j ) ∈ D 2 K ( u i , j − c 2 ) 2 ,for  ( D 1 K , D 2 K ) ∈A
(2.12)

with

c 1 = ∑ ( i , j ) ∈ D 1 K u i , j | D 1 K | , c 2 = ∑ ( i , j ) ∈ D 2 K u i , j | D 2 K | .
(2.13)

Theorem 2.3

min ( D 1 , D 2 ) , D 1 ⊂ D F( c 1 , c 2 , D 1 , D 2 )= min ( D 1 K , D 2 K ) ∈ A F(K).
(2.14)

Proof It is clear that min ( D 1 , D 2 ) , D 1 ⊂ D F≤ min ( D 1 K , D 2 K ) ∈ A F. We only need to prove min ( D 1 , D 2 ) , D 1 ⊂ D F≥ min ( D 1 K , D 2 K ) ∈ A F.

From Theorem 2.2, there exist two subdomains D 1 ∗ and D 2 ∗ such that

F ( c 1 ∗ , c 2 ∗ , D 1 ∗ , D 2 ∗ ) = min ( D 1 , D 2 ) , D 1 ⊂ D F( c 1 , c 2 , D 1 , D 2 ).

Without loss of generality, assume c 1 ≤ c 2 and there exist ( i 1 , j 1 )∈ D 1 ∗ and ( i 2 , j 2 )∈ D 2 ∗ such that u i 1 , j 1 > u i 2 , j 2 . Denote D 1 ′ = D 1 ∗ −( i 1 , j 1 )+( i 2 , j 2 ) and D 2 ′ = D 2 ∗ −( i 2 , j 2 )+( i 1 , j 1 ). Note that | D 1 ∗ |=| D 1 ′ |, | D 2 ∗ |=| D 2 ′ |, c 1 ∗ > c 1 ′ and c 2 ∗ < c 2 ′ .

Having compared the energy F( c 1 ∗ , c 2 ∗ , D 1 ∗ , D 2 ∗ ) and F( c 1 ′ , c 2 ′ , D 1 ′ , D 2 ′ ), we get

F ( c 1 ∗ , c 2 ∗ , D 1 ∗ , D 2 ∗ ) − F ( c 1 ′ , c 2 ′ , D 1 ′ , D 2 ′ ) = ∑ ( i , j ) ∈ D 1 ∗ ( u i , j − c 1 ∗ ) 2 + ∑ ( i , j ) ∈ D 2 ∗ ( u i , j − c 2 ∗ ) 2 − ∑ ( i , j ) ∈ D 1 ′ ( u i , j − c 1 ′ ) 2 − ∑ ( i , j ) ∈ D 2 ′ ( u i , j − c 2 ′ ) 2 = − | D 1 ∗ | c 1 ∗ 2 − | D 2 ∗ | c 2 ∗ 2 + | D 1 ′ | c ′ 1 2 + | D 2 ′ | c ′ 2 2 = | D 1 ∗ | ( c 1 ′ + c 1 ∗ ) ( c 1 ′ − c 1 ∗ ) + | D 2 ∗ | ( c 2 ′ + c 2 ∗ ) ( c 2 ′ − c 2 ∗ ) = ( c 1 ′ + c 1 ∗ ) ( u i 2 , j 2 − u i 1 , j 1 ) + ( c 2 ′ + c 2 ∗ ) ( u i 1 , j 1 − u i 2 , j 2 ) = ( c 1 ′ + c 1 ∗ − c 2 ′ − c 2 ∗ ) ( u i 2 , j 2 − u i 1 , j 1 ) .

Since c 1 ≤ c 2 , we have

c 1 ′ + c 1 − c 2 ′ − c 2 =2 c 1 − u i 1 , j 1 − u i 2 , j 2 | D 1 | −2 c 2 + u i 2 , j 2 − u i 1 , j 1 | D 2 | <0.

So we get

F( c 1 , c 2 , D 1 , D 2 )>F ( c 1 ′ , c 2 ′ , D 1 ′ , D 2 ′ ) .

Since F( c 1 , c 2 , D 1 , D 2 )= min ( D 1 , D 2 ) , D 1 ⊂ D F( c 1 , c 2 , D 1 , D 2 ), it is a contradiction. Therefore, for any (i,j)∈ D 1 , ( i ′ , j ′ )∈ D 2 , we have u i , j < u i ′ , j ′ . Hence there exists K∈[ K m , K M ] such that u i , j <K≤ u i ′ , j ′ , i.e., ( D 1 , D 2 )∈A. We complete the proof of the theorem. □

From (2.8) and (2.9), we can easily see that

F ( c 1 , c 2 , D 1 , D 2 ) = ∑ ( i , j ) ∈ D 1 ( u i , j − c 1 ) 2 + ∑ ( i , j ) ∈ D 2 ( u i , j − c 2 ) 2 = ∑ ( i , j ) ∈ D u i , j 2 − | D 1 | c 1 2 − | D 2 | c 2 2 .
(2.15)

Hence we have the following.

Theorem 2.4 min ( D 1 K , D 2 K ) ∈ A F(K) is equivalent to

max ( D 1 K , D 2 K ) ∈ A { E ( K ) ≜ | D 1 K | c 1 2 + | D 2 K | c 2 2 } ,
(2.16)

where K∈[ K m , K M ], c 1 and c 2 is defined as (2.11).

Now, if the energy functional E reaches a maximum, the best segmentation results are obtained, i.e., the subregion D 1 K and subregion D 2 K . Since K= K m , K m +1,…, K M , the energy functional E has K M − K m +1 cases, and then the maximum of E is easily found. The algorithm in the second phase is sketched below.

Algorithm 2.2 The method of maximizing the following functional E

  1. 1.

    Sweep the image u once, record the number of all pixels at every gray level of the image u which range from K m to K M .

  2. 2.

    Calculate the energy E(K) by (2.16) for K∈[ K m , K M ], and find the maximizer K.

  3. 3.

    The image u is divided into two subregions, i.e., D 1 K ={(i,j):u<K} and D 2 K ={(i,j):u≥K}.

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

Algorithm 2.3

  • (Smoothing) For the input noise image f, use the Gaussian smooth filter or diffusion equations (2.2)-(2.4) to obtain the smooth image u (if the input image is noiseless, this step is optional).

  • (Minimal variance) Use Algorithm 2.2 to obtain the segmentation results for the smooth image u.

3 Simulations

In this section, numerical examples on some synthetic and real world images are presented to illustrate the efficiency and effectiveness of our new two-phase scheme. The simulations are performed in Matlab R2007b on a 2.8 GHz Pentium 4 processor. For comparison purpose, the Chan-Vese method (CVM) [2] is also tested. We utilize a locally one-dimensional (LOD) scheme adopted for CVM, which is an unconditional scheme [8].

3.1 Configuration of smoothing filter

In the new algorithm, the first stage is smoothing the original image. The low-pass filtering is generally made by convolution with Gaussian of an increasing variance. Koenderink [30] noticed that the convolution of signal with Gaussian at each scale was equivalent to the solution of the heat equation with the signal as initial datum f, i.e.,

∂ u ∂ t =△u,
(3.1)
u(x,0)= u 0 .
(3.2)

FFT (fast Fourier transform algorithm), the classical five-point explicit numerical schemes and the additive operator splitting (AOS) schemes can be used for the heat equation. In our experiment, we will use the Gaussian low-pass filter as one smoothing method in the first phase. For simplicity, we refer to the method as GLF-GLS (Gaussian low-pass filter-gray level set).

On the other hand, using the scheme in [31], problems (2.2)-(2.4) can be discretized as

λ 0 = 0 , u n + 1 = 1 m ∑ l = 1 m [ I − m τ A l ( u k ) ] − 1 [ u n + λ τ ( f − u n ) ] , div n = ( u n + 1 − u n ) / τ , λ n = 1 σ 2 M N ( u − f ) div n , u i , j 0 = f i , j = f ( i h , j h ) , u i , 0 n = u i , 1 n , u 0 , j n = u 1 , j n , u I , i n = u I − 1 , i n , u i , J n = u i , J − 1 n ,

where A l ( u n )=[ a i , j ( u n )],

a i , j ( u n ) := { C i n + C j n 2 h 2 [ j ∈ N ( i ) ] , − ∑ n ∈ N ( i ) C i n + C N n 2 h 2 ( j = i ) , 0 ( e l s e ) ,

and

C i n := 1 ε + | ∇ u i , j n | 2 − α ,

where

| ∇ u i , j n | = 1 2 ∑ p , q ∈ N ( i ) | u p n − u q n | 2 h ,

where N(i) is the set of the two neighbors of pixel i (boundary pixels have only one neighbor). AOS schemes with large time steps still reveal average grey value invariance, stability based on extremum principle, Lyapunov functionals, and convergence to a constant steady-state [31]. The AOS scheme is less than twice the typical effort needed for the PM scheme, a rather low price for gaining absolute stability [31]. Hence, in our numerical experiments, the AOS scheme is considered as the other smoothing method in the first phase. For simplicity, we refer to the two-phase method with the smoothing method as DE-GLS (diffusion equation-gray level set).

3.2 Segmentation performance

In Figure 3, we illustrate the performance of CVM, GLF-GLS and DE-GLS on the synthetic noise Test01 image (size: 512×512). Among the segmentations, all algorithms give similar and good performances. For CVM (the Chan-Vese method), utilizing the unconditional LOD scheme, the time step size can be sufficiently large to reduce the iteration steps (only 5/12 steps in Table 1). However, re-initializing the level-set function costs a lot of CPU time (Table 1). In the new method, GLF-GLS cost very little time (Table 1) and for DE-GLS, it not only costs little time, but also has a very good segmentation result, especially for some singular information, such as corners and edges of the image.

Figure 3
figure 3

Segmentations for the noise Test01 image (size: 512×512). (a) The original image. (b) Corrupted Test01 image with Gaussian noise (σ=40). (c) Smoothed Test01 image with the AOS scheme (Ï„=70, α=0.7, twice iterations). (d) Algorithm DE-GLS. (e) Algorithm GLF-GLS. (f) CVM. (g)-(i) The segmentation counter of Algorithm DE-GLS, Algorithm GLF-GLS and CVM, respectively.

Table 1 Comparison of CPU time in seconds and iterate step

In Figures 4 and 5, we illustrate the results of GLF-GLS and DE-GLS about the real brain and ultrasound image. Few differences between the segmented images are observed, but our method works much faster than CVM (Table 1).

Figure 4
figure 4

Segmentations for the noise ultrasound image (size: 481×403). (a) The original image. (b) The smooth image by Gaussian low-pass filter with σ=1.5. (c) Smoothed ultrasound image with the AOS scheme (τ=6, α=0.9, twice iterations). (d) Algorithm DE-GLS. (e) Algorithm GLF-GLS. (f) CVM. (g)-(i) The segmentation counter of Algorithm DE-GLS, Algorithm GLF-GLS and CVM, respectively.

Figure 5
figure 5

Segmentations for the noise brain image (size: 630×630). (a) The original image. (b) The smooth image by Gaussian low-pass filter with σ=1.0. (c) Smoothed brain image with the AOS scheme (τ=20, α=0.6, twice iterations). (d) Algorithm DE-GLS. (e) Algorithm GLF-GLS. (f) CVM. (g)-(i) The segmentation counter of Algorithm DE-GLS, Algorithm GLF-GLS and CVM, respectively.

3.3 Computational complexity

We end this section by considering the complexity of our algorithm. Our algorithm requires two phases: smoothing the original image and segmentation. Smoothing the original image is done by the AOS scheme, which is very efficient, and the complexity of this stage is O(N), where N is the number of pixels in the image [31] and so is the Gaussian low-pass filter. In the second segmentation stage, our algorithm only sweeps the image once, so the complexity of the stage is no more than O(N). In Table 1, we compare the CPU time needed for all three algorithms. Especially, we see that our algorithm GLF-GLS is about 0.01-0.08 seconds and is the fastest out of the three algorithms.

4 Summary

In this paper, we have proposed and implemented a novel 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, we first smooth the noisy image by using the heat equation filter method, and then we utilize the new discrete gray level-set method to segment the region of the original image. The proposed new segmentation algorithm does not require the initialization of the level-set functions, which is a difficult problem in the Chan-Vese segmentation algorithm. Each step of the proposed new segmentation algorithm is simple and easily implemented. In the first step, there are a lot of algorithms to get the smoothing version of the original image, and in the second step, we only sweep the image once and calculate (2.16) at every gray level (in fact, only 256 gray level sets) and 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 much more efficient than the Chan-Vese method.

References

  1. Mumford D, Shah J: Optimal approximation by piecewise smooth functions and associated variational problems. Commun. Pure Appl. Math. 1989, 42: 577-685. 10.1002/cpa.3160420503

    Article  MathSciNet  Google Scholar 

  2. Chan TF, Vese LA: Active contours without edges. IEEE Trans. Image Process. 2001, 10(2):266-277. 10.1109/83.902291

    Article  Google Scholar 

  3. Tsai A, Yezzi A, Willsky AS: Curve evolution implementation of the Mumford-Shah functional for image segmentation, denoising, interpolation, and magnification. IEEE Trans. Image Process. 2001, 10(8):1169-1186. 10.1109/83.935033

    Article  Google Scholar 

  4. Gao S, Bui T: Image segmentation and selective smoothing by using Mumford-Shah model. IEEE Trans. Image Process. 2005, 14(10):1537-1549.

    Article  Google Scholar 

  5. Vese L, Chan TF: A multiphase level set framework for image segmentation using the Mumford and Shah model. Int. J. Comput. Vis. 2002, 50(3):271-293. 10.1023/A:1020874308076

    Article  Google Scholar 

  6. Chan TF, Yezrielev Sandberg B, Vese LA: Active contours without edges for vector-valued images. J. Vis. Commun. Image Represent. 2000, 2(11):130-141.

    Article  Google Scholar 

  7. Paragios N, Deriche R: Geodesic active regions and level set methods for supervised texture segmentation. Int. J. Comput. Vis. 2002, 46(3):223-247. 10.1023/A:1014080923068

    Article  Google Scholar 

  8. Kimmel R: Fast edge integration. In Level Set Methods and Their Applications in Computer Vision. Springer, New York; 2003. Chapter 3

    Google Scholar 

  9. Li C, Huang R, Ding Z, Gatenby C, Metaxas D, Gore J: A variational level set approach to segmentation and bias correction of medical images with intensity inhomogeneity. Lecture Notes in Computer Science 5242. In Proceedings of Medical Image Computing and Computer Aided Intervention (MICCAI). Part II. Springer, Berlin; 2008:1083-1091.

    Google Scholar 

  10. Kass M, Witkin A, Terzopoulos D: Snakes: active contour models. Int. J. Comput. Vis. 1987, 1(4):321-331.

    Article  Google Scholar 

  11. Caselles V, Catte F, Coll T, Dibos F: A geometric model for active contours. Numer. Math. 1993, 66: 1-31. 10.1007/BF01385685

    Article  MathSciNet  Google Scholar 

  12. Malladi R, Sethian JA, Vemuri BC: Shape modeling with front propagation: a level set approach. IEEE Trans. Pattern Anal. Mach. Intell. 1995, 17(2):158-175. 10.1109/34.368173

    Article  Google Scholar 

  13. Xu C, Prince J: Generalized gradient vector flow external forces for active contours. Signal Process. 1998, 71(2):131-139. 10.1016/S0165-1684(98)00140-6

    Article  Google Scholar 

  14. Li C, Xu C, Gui C, Fox MD: Level set evolution without reinitialization: a new variational formulation. 1. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR) 2005, 430-436.

    Google Scholar 

  15. Osher S, Paragios N: Geometric Level Set Methods in Imaging, Vision, and Graphics. Springer, New York; 2003.

    Google Scholar 

  16. Jain AK, Zhong Y, Dubuisson-Jolly M: Deformable template models: a review. Signal Process. 1998, 71(2):109-129. 10.1016/S0165-1684(98)00139-X

    Article  Google Scholar 

  17. Cremers D, Rousson M, Deriche R: A review of statistical approaches to level set segmentation: integrating color, texture, motion and shape. Int. J. Comput. Vis. 2007, 72(2):195-215. 10.1007/s11263-006-8711-1

    Article  Google Scholar 

  18. Shi Y, Karl W: A fast level set method without solving pdes. II. Proceedings of ICASSP 2005 2005, 97-100. Philadelphia, PA, USA, March 2005

    Google Scholar 

  19. Song, B, Chan, T: A fast algorithm for level set based optimization. Tech. Rep. CAM02-68, UCLA Dept. Math. (2002)

  20. Pan Y, Birdwell JD, Djouadi SM: Efficient implementation of the Chan-Vese models without solving PDEs. Proceedings of International Workshop on Multimedia Signal Processing 2006, 350-353. Victoria, BC, Canada, Oct. 03-06

    Google Scholar 

  21. He L, Osher SJ: Solving the Chan-Vese model by a multiphase level set algorithm based on the topological derivative. Proceedings of the 1st International Conference on ScaleSpace Variational Methods in Computer Vision 2007.

    Google Scholar 

  22. Pan Y, Birdwell DJ, Seddik DM: An efficient bottom-up image segmentation method based on region growing, region competition and the Mumford Shah functional. Proceedings of International Workshop on Multimedia Signal Processing 2006, 344-348. Victoria, BC, Canada, Oct. 03-06

    Google Scholar 

  23. Wang X, Huang D, Xu H: An efficient local Chan-Vese model for image segmentation. Pattern Recognit. 2010, 43: 603-618. 10.1016/j.patcog.2009.08.002

    Article  Google Scholar 

  24. Aubert G, Kornprobst P App. Mathem. Sciences 147. In Mathematical Problems in Image Processing: PDE’s and the Calculus of Variations. Springer, Berlin; 2002.

    Google Scholar 

  25. Chipot M, March R, Rosati M, Vergara Caffarelli G: Analysis of a nonconvex problem related to signal selective smoothing. Math. Models Methods Appl. Sci. 1997, 7(3):313-328. 10.1142/S0218202597000189

    Article  MathSciNet  Google Scholar 

  26. Rudin L, Osher S, Fatemi E: Nonlinear total variation based noise removal algorithms. Physica D 1992, 60: 259-268. 10.1016/0167-2789(92)90242-F

    Article  Google Scholar 

  27. Perona P, Malik J: Scale-space and edge detection using anisotropic diffusion. IEEE Trans. Pattern Anal. Mach. Intell. 1990, 12(7):629-639. 10.1109/34.56205

    Article  Google Scholar 

  28. Weickert J: Applications of nonlinear diffusion in image processing and computer vision. Acta Math. Univ. Comen. 2000, 70(1):33-50.

    MathSciNet  Google Scholar 

  29. Shi J, Osher S: A nonlinear inverse scale space method for a convex multiplicative noise model. SIAM J. Imaging Sci. 2008, 1(3):294-321. 10.1137/070689954

    Article  MathSciNet  Google Scholar 

  30. Koenderink JJ: The structure of image. Biol. Cybern. 1984, 50: 363-370. 10.1007/BF00336961

    Article  MathSciNet  Google Scholar 

  31. Weickert J, Romeny B, Viergever M: Efficient and reliable scheme for nonlinear diffusion filtering. IEEE Trans. Image Process. 1998, 7(3):398-410. 10.1109/83.661190

    Article  Google Scholar 

Download references

Acknowledgements

This work is partially supported by the National Science Foundation of China (11271100, 11301113, 71303067), China Postdoctoral Science Foundation funded project (Grant No. 2012M510933, Grant No. 2013M541400).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Dazhi Zhang.

Additional information

Competing interests

The authors declare that they have no competing interests.

Authors’ contributions

XJ and BW carried out the proof of the main part of this article, DZ corrected the manuscript, and participated in its design and coordination. All authors have read and approved the final manuscript.

Authors’ original submitted files for images

Rights and permissions

Open Access This article is distributed under the terms of the Creative Commons Attribution 2.0 International License ( https://creativecommons.org/licenses/by/2.0 ), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Reprints and permissions

About this article

Cite this article

Wu, B., Ji, X. & Zhang, D. Fast two-phase image segmentation based on diffusion equations and gray level sets. Bound Value Probl 2014, 11 (2014). https://doi.org/10.1186/1687-2770-2014-11

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/1687-2770-2014-11

Keywords