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
(2.1)
where . Note that for , 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 is not a constant and , the function has no minimizer in and .
Proof We only prove the one-dimensional case , and the same proof goes for .
By density, we may always find a sequence of step functions such that
In fact, we can find a partition such that is the constant on each interval , with . Let us set . Next, we define a sequence of continuous functions by
Note that
and therefore,
Since
and then taking the limit on both sides yields
Moreover,
Thus
and finally,
i.e.,
Now, if there exists a minimizer , then necessarily , which implies
The first equality is possible only if , and in this case the second equality implies , which is possible only if f is a constant. Therefore, excluding this trivial case, has no minimizer in . □
Remark 2.1 As we all know, if the region Ω is bounded,
then
Note that , and therefore
However, we cannot obtain any information about the minimizer of in .
From the Euler-Lagrange equation for (2.1), we can obtain the following diffusion equation:
(2.2)
(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
(2.5)
Assume that the smooth image u is the solution from diffusion equations (2.2)-(2.4). Let be the K-level set of u. It is clear that for the noise image, is disorderly and irregular; while for the smooth image, is smooth and regular. These basic facts are illustrated in Figure 1, where some are very close to the real edges of the original image.
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:
(2.6)
where
(2.7)
and the Heaviside function H
Minimizing the function above, the best threshold is obtained, and then the image is segmented into two subregions and .
Notice that
(2.8)
(2.9)
for ,
and for ,
Theorem 2.2 Assume , and then there exists the minimizer of . Furthermore, if f is not a constant function, then the minimizer is the minimum point with .
Proof If , and , there exists the minimizer of . Noted that get the minimal at , and then
Hence
which implies that the minimizer is the minimum point. By the Fermat theorem, we obtain that there exists such that . □
For any images we can always obtain the function . Figure 2(d) shows the function for the image in Figure 2(a). From the figure, we can see that has the global minimizer and has several local minimizers.
Based on the new model (2.6), the two-phase algorithm is sketched below.
Algorithm 2.1
-
1.
(Smoothing) By (2.2)-(2.4) obtain some appropriate smooth version u of the noise image f.
-
2.
(Minimal variance) Calculate the new model (2.6) for each , and then obtain the minimizer with . The segmentation results are and .
2.3 Discrete version of model (2.6)
Let , for , be the gray level of a true M-by-N image u at pixel location , and let be the range of the smooth image u, i.e., . Let and , and then the image u is divided into two regions. Instead by , and by , respectively. Then minimizing the energy (2.5) is changed into minimize
(2.10)
with
(2.11)
where is the number of pixels in , and is the number of pixels in . If the energy F reaches a minimum, the best segmentation results are obtained, i.e., the subregion and subregion .
It is noticed that since the selection of and is arbitrary, there are lots of pairs , 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 , which is the set of pixel location , is defined as follows
where is the gray level of the image u at pixel location .
For any , the image u is divided into two subregions, i.e., and . Then . Let , and then the element number of the set is which is less than 256 in general. Then minimizing the energy (2.6) is changed into minimize
(2.12)
with
(2.13)
Theorem 2.3
(2.14)
Proof It is clear that . We only need to prove .
From Theorem 2.2, there exist two subdomains and such that
Without loss of generality, assume and there exist and such that . Denote and . Note that , , and .
Having compared the energy and , we get
Since , we have
So we get
Since , it is a contradiction. Therefore, for any , , we have . Hence there exists such that , i.e., . We complete the proof of the theorem. □
From (2.8) and (2.9), we can easily see that
(2.15)
Hence we have the following.
Theorem 2.4
is equivalent to
(2.16)
where , and is defined as (2.11).
Now, if the energy functional E reaches a maximum, the best segmentation results are obtained, i.e., the subregion and subregion . Since , the energy functional E has 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.
Sweep the image u once, record the number of all pixels at every gray level of the image u which range from to .
-
2.
Calculate the energy by (2.16) for , and find the maximizer .
-
3.
The image u is divided into two subregions, i.e., and .
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.