# A new model for segmentation of gray-scale and color images

- Dazhi Zhang
^{1}, - Jiebao Sun
^{1}Email author, - Zhichang Guo
^{1}and - Yanli Zhai
^{1}

**2013**:556

https://doi.org/10.1186/1029-242X-2013-556

© Zhang et al.; licensee Springer. 2013

**Received: **2 March 2013

**Accepted: **22 October 2013

**Published: **22 November 2013

## Abstract

In this paper, we propose a new model for segmentation of both gray-scale and color images. This model is inspired by the GAC model, the region-scalable fitting model, the weighted bounded variation model and the active contour model based on the Mumford-Shah model. Compared with other active contour models, our new model cannot only make full use of advantages of both edge-based and region-based models, but also maintain more accurate overall message of segmented objects. Moreover, we establish the existence of the global minimum of the new energy functional and analyze the property of it. Finally, numerical results show the effectiveness of our proposed model.

## 1 Introduction

The image segmentation problem is fundamental in the field of computer vision, and the aim of it is to divide an image into a finite number of important regions. Recently, variational methods have been extensively studied for image segmentation because of their flexibility in modeling and advantages in numerical implementation.

The geometric active contour (GAC) model is one of the most well-known variational models [1–4] for image segmentation. It was proposed in [2] and has been widely used in practice [5]. The main idea of the GAC model is to utilize the image gradient to stop evolving contours on object boundaries. However, this model has one major disadvantage, that is, giving an initial curve, during the evolution, the energy may evolve to its local minimizers.

Moreover, there are other variational models for image segmentation [6–8]. These models do not utilize the image gradient and are significantly less sensitive to the location of initial contours than other modes. Therefore, they have good performance for the image with weak object boundaries. Among these models, the Chan-Vese model [6] is very popular and useful. This model can be applied for the segmentation of images with two regions, each having a distinct mean of pixel intensities. In order to handle images with multiple regions, Vese and Chan proposed the piecewise constant (PC) models [9], in which multiple regions can be represented by multiple level set functions. And yet, these PC models are not very successful for images with intensity inhomogeneity. To deal with more general situation efficiently, Chunming Li proposed the region-scalable fitting model in [10]. However, this model is not always valid when the whole object needs to be segmented.

In this paper, inspired by the GAC model, the region-scalable fitting model, the weighted bounded variation model [3–5] and the active contour model based on the Mumford-Shah model [11], we propose a new model which can be applied to segment both gray-scale and color images. In order to make our model apply to color images, we shall use the red-green-blue model [12]. Although there are some other models which are similar to our new model, they have different essence and applications. Our new model cannot only make full use of advantages of both edge-based and region-based models, but also overcome the usual drawback in the level set approach. Moreover, compared with other active contours models, our model can keep more accurate overall message of segmented objects for simple and complex images of different modalities. Finally, we investigate the new model mathematically and establish the existence of the minimum to the new energy functional.

The remainder of the paper is organized as follows. In Section 2, we show some background. In Section 3, our new model is proposed. Theoretical results, iterating schemes and experimental results are also given in this section. Finally, we conclude our paper in Section 4.

## 2 Background

### 2.1 GAC model

*ds*is the Euclidean element of length and $L(c)$ is the length of the curve

*c*. Hence the energy functional in (2.1) is actually a new length obtained by weighting the Euclidean element of length

*ds*. The function

*g*is an edge indicator function that vanishes at object boundaries. If $d=1$,

where *β* is an arbitrary positive constant.

where *R*, *G* and *B* represent the pixel values of red, green and blue after Gaussian convolution, respectively, *i.e.*, $R={G}_{\sigma}\ast {f}_{1}$, $G={G}_{\sigma}\ast {f}_{2}$ and $B={G}_{\sigma}\ast {f}_{3}$.

### 2.2 The region-scalable fitting model

where ${K}_{\sigma}$ is the Gaussian function and ${f}_{1}$, ${f}_{2}$ are two functions that fit image intensities near the point *x*. Moreover, *ϕ* is the level set function embedding the evolving active contour $c(t)=\{x:\varphi (x,t)=0\}$ and $H(\varphi )$ is the Heaviside function.

*ϕ*periodically during the evolution because of the second term of (2.4). If ${\lambda}_{2}=0$, (2.4) is equivalent to

## 3 Our proposed model

where *g* is a diffusion coefficient defined in the same way as formula (2.2) or (2.3) and ${K}_{\sigma}$ is the Gaussian function.

*u*, according to the necessary condition of the minimization problem, the functions ${f}_{i1}(y)$, ${f}_{i2}(y)$ must satisfy the following equations:

where ${K}_{\sigma}$ takes larger values at the points near the center point *y*, and decreases to 0 as *x* goes away from *y*. Therefore, ${f}_{i1}(y)$, ${f}_{i2}(y)$ are allowed to vary in space.

*u*is limited to a characteristic function ${1}_{{\mathrm{\Omega}}_{c}}$, energy functional (3.3) can be changed into the following form:

where *C* is a constant.

when approximating ${f}_{i}$ with spatially varying fitting functions ${f}_{i1}$, ${f}_{i2}$.

The above analysis shows that our new model uses not only the edge detector which contains information concerning the boundaries of objects, but also the spatially varying fitting functions ${f}_{i1}(y)$, ${f}_{i2}(y)$ which are used to approximate the image intensities and avoid existence of the local minimizers to energy functional (3.3).

### 3.1 Mathematical results

In [11, 14], the proof of existence of models was not given. In the following, we state existence of the minimizer to energy functional (3.3) and analyze the property of it.

**Theorem 1** *For any given* ${f}_{i1}(x),{f}_{i2}(x)\in {L}^{\mathrm{\infty}}(\mathrm{\Omega})$ ($i=1,\dots ,d$, *where* $d=1\phantom{\rule{0.25em}{0ex}}\mathit{\text{or}}\phantom{\rule{0.25em}{0ex}}3$), *there exists a function* $u\in g-B{V}_{[0,1]}(\mathrm{\Omega})$ *minimizing the energy functional* *E* 1 *in* (3.3).

*Proof*Let

*i.e.*, ${lim}_{n\to \mathrm{\infty}}E1({u}_{n})=\beta $. So, there is a positive constant ${M}_{2}$ such that

If $d=1$, from (2.2) we can obtain $g(x)\ge \frac{1}{1+c{\parallel f\parallel}_{{L}^{\mathrm{\infty}}(\mathrm{\Omega})}^{2}}$ with *c* being a positive constant. Since $f\in {L}^{\mathrm{\infty}}(\mathrm{\Omega})$, $g\ge \frac{1}{1+C1}$ where *C* 1 is a positive constant.

where ${c}_{i}\ge 0$ ($i=1,2,3$). Since ${f}_{i}\in {L}^{\mathrm{\infty}}(\mathrm{\Omega})$ ($i=1,2,3$), $g\ge \frac{1}{1+C2}$, where *C* 2 is a positive constant.

So, ${|{u}_{n}|}_{BV}$ is bounded.

Since $\{{u}_{n}\}\in g-B{V}_{[0,1]}(\mathrm{\Omega})=\{x:u(x)\in [0,1]\text{for every}x\in \mathrm{\Omega}\}\cap g-BV(\mathrm{\Omega})$, the sequence $\{{u}_{n}\}$ has a bounded BV-norm.

Thus, there is a subsequence, also denoted by $\{{u}_{n}\}$, and ${u}_{\ast}\in BV(\mathrm{\Omega})$ such that ${u}_{n}\to {u}_{\ast}$ strongly in ${L}^{1}(\mathrm{\Omega})$. Moreover, according to the formula ${u}_{n}\to {u}_{\ast}$ in ${L}^{1}(\mathrm{\Omega})$, we know that there is a subsequence, also denoted by $\{{u}_{n}\}$, satisfying ${lim}_{n\to \mathrm{\infty}}{u}_{n}(x)={u}_{\ast}(x)$ a.e. for $x\in \mathrm{\Omega}$. Since ${u}_{n}(x)\in [0,1]$ for any $x\in \mathrm{\Omega}$, ${u}_{\ast}(x)\in [0,1]$ a.e. for $x\in \mathrm{\Omega}$.

That is, ${u}_{n}\to {\overline{u}}_{\ast}$ strongly in ${L}^{1}(\mathrm{\Omega})$ and ${\overline{u}}_{\ast}(x)\in [0,1]$ for every $x\in \mathrm{\Omega}$.

*E*1

Therefore ${\overline{u}}_{\ast}\in g-B{V}_{[0,1]}(\mathrm{\Omega})$ and ${\overline{u}}_{\ast}$ is a minimum of the energy functional *E* 1. □

Similar to [11, 15], we can obtain the property of minimizers to energy functional (3.3).

**Theorem 2** *Let* ${f}_{i}(x)$ ($i=1,\dots ,d$), $g(x)\in [0,1]$. *For any given* ${f}_{i1}(x)$, ${f}_{i2}(x)$ ($i=1,\dots ,d$), *if* $u(x)$ *is any minimum of the energy functional* *E* 1 *defined in* (3.3), *then for almost every* $\mu \in [0,1]$, *the characteristic function* ${1}_{{\mathrm{\Omega}}_{c}}={1}_{\{x:u(x)>\mu \}}$ *is a global minimum of the functional* *E* 1 *where* *c* *is the boundary of the set* ${\mathrm{\Omega}}_{c}$.

### 3.2 Numerical implementation

*E*by alternating the following steps:

- (1)
Considering

*u*fixed, compute ${f}_{i1}$ and ${f}_{i2}$ by using formula (3.2); - (2)
Considering ${f}_{i1}$ and ${f}_{i2}$ fixed, update

*u*by using the iterative schemes of minimization problem (3.3).

When a steady state is found, the final segmentation is obtained by thresholding *u* at any level in $[0,1]$ (in our experiments, we choose $\mu =0.5$).

where $\nu (u)=max\{0,2|u-0.5|-1\}$ is an exact penalty function provided that the constant *α* is chosen large enough. The energy functional *E* 2 is convex, so *E* 2 does not possess local minimizers. Hence, any minimizer of *E* 2 is global.

*θ*is chosen to be small. Since this functional is convex, its minimum can be computed by minimizing this functional w.r.t.

*u*and

*v*separately. That is,

- (1)
*v*being fixed, we search for*u*as a solution of$\underset{u}{min}{\int}_{\mathrm{\Omega}}g(x)|\mathrm{\u25bd}u|\phantom{\rule{0.2em}{0ex}}dx+\frac{1}{2\theta}{\parallel u-v\parallel}^{2},$(3.8) - (2)
*u*being fixed, we search for*v*as a solution of$\begin{array}{c}\underset{v}{min}{\int}_{\mathrm{\Omega}}\left[\sum _{i=1}^{d}({\lambda}_{i1}{\int}_{\mathrm{\Omega}}{K}_{\sigma}(x-y){({f}_{i}(x)-{f}_{i1}(y))}^{2}\phantom{\rule{0.2em}{0ex}}dy)\right]v\phantom{\rule{0.2em}{0ex}}dx+\frac{1}{2\theta}{\parallel u-v\parallel}^{2}\hfill \\ \phantom{\rule{1em}{0ex}}-{\int}_{\mathrm{\Omega}}\left[\sum _{i=1}^{d}({\lambda}_{i2}{\int}_{\mathrm{\Omega}}{K}_{\sigma}(x-y){({f}_{i}(x)-{f}_{i2}(y))}^{2}\phantom{\rule{0.2em}{0ex}}dy)\right]v+\alpha \nu (v)\phantom{\rule{0.2em}{0ex}}dx.\hfill \end{array}$(3.9)

### 3.3 Experimental results

*u*got by using our new model are displayed in Figures 2c, d and Figures 3c, d, respectively. Figures 2b and 3b show the active contours obtained by using the model in [11]. From these experiment results, we find that our model can segment the entire object more accurately and keep more details. Finally, we use our new model for segmentation of color images in Figures 4, 5, 6. Figure 4a is the noisy image with the variance 0.01. Figures 5a and 6a are complex images. According to Figures 4b, c, 5b, c, and 6b, c, we see that in all the three cases the experimental results are very good and can correspond to the actual needs.

## 4 Conclusion

This paper describes a new model for segmentation of gray-scale and color images. This model is based on the GAC model, the region-scalable fitting model, the weighted bounded variation model and the active contour model based on the Mumford-Shah model. Compared with other active contour models, our new model cannot only make full use of advantages of both edge-based and region-based models, but also keep more accurate overall message of the segmented objects. Our numerical results confirm the effectiveness of our algorithm. Moreover, we investigate the new model mathematically and establish the existence of the minimum to the new energy functional.

## Declarations

### Acknowledgements

This work is partially supported by the National Science Foundation of China (11271100, 11126222, 11301113, 71303067), the Fundamental Research Funds for the Central Universities (Grant No. HIT. NSRIF. 2012065, Grant No. HIT. HSS. 201201), China Postdoctoral Science Foundation funded project (Grant No. 2012M510933, Grant No. 2013M541400), the Heilongjiang Postdoctoral Fund (LBH-Z12102), the Aerospace Supported Fund of China (Contract No. 2011-HT-HGD-06), and also the Financial Support from Postdoctoral Science-Research Developmental Foundation of Heilongjiang Province (LBH-Q11111).

## Authors’ Affiliations

## References

- Kass M, Witkin A, Terzopoulos D: Snakes: active contour models.
*Int. J. Comput. Vis.*1988, 1: 321–331. 10.1007/BF00133570View ArticleGoogle Scholar - Caselles V, Kimmel R, Sapiro G: Geodesic active contours.
*Int. J. Comput. Vis.*1997, 22: 61–79. 10.1023/A:1007979827043MATHView ArticleGoogle Scholar - Li C, Liu J, Fox MD: Segmentation of external force field for automatic initialization and splitting of snakes.
*Pattern Recognit.*2005, 11: 1947–1960.View ArticleGoogle Scholar - Li C, Xu C, Gui C, Fox MD: Level set evolution without re-initialization: a new variational formulation.
*IEEE Conference on Computer Vision and Pattern Recognition*2005, 430–436.Google Scholar - Li F, Shen C, Pi L: A new diffusion-based variational model for image denoising and segmentation.
*J. Math. Imaging Vis.*2006, 26: 115–125. 10.1007/s10851-006-8303-2MathSciNetView ArticleGoogle Scholar - Chan TF, Vese LA: Active contours without edges.
*IEEE Trans. Image Process.*2001, 38: 266–277.View ArticleGoogle Scholar - Paragios N, Deriche R: Geodesic active regions and level set methods for supervised texture segmentation.
*Int. J. Comput. Vis.*2002, 46: 223–247. 10.1023/A:1014080923068MATHView ArticleGoogle Scholar - 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: 1169–1186. 10.1109/83.935033MATHView ArticleGoogle Scholar - Vese LA, Chan TF: A multiphase level set framework for image segmentation using the Mumford and Shah model.
*Int. J. Comput. Vis.*2002, 50: 271–293. 10.1023/A:1020874308076MATHView ArticleGoogle Scholar - Li C, Kao C, Gore JC, Ding Z: Minimization of region-scalable fitting energy for image segmentation.
*IEEE Trans. Image Process.*2008, 10: 1940–1949.MathSciNetGoogle Scholar - Bresson X, Esedoglu S, Vandergheynst P, Thiran JP, Osher S: Fast global minimization of the active contour/snake model.
*J. Math. Imaging Vis.*2007, 28: 151–167. 10.1007/s10851-007-0002-0MathSciNetView ArticleGoogle Scholar - Blomgren PV, Chan TF: Color TV: total variation methods for restoration of vector valued images.
*IEEE Trans. Image Process.*1998, 7: 304–309. 10.1109/83.661180View ArticleGoogle Scholar - Pi L, Shen C, Li F, Fan J: A variational formulation for segmenting desired objects in color images.
*Image Vis. Comput.*2007, 25: 1414–1421. 10.1016/j.imavis.2006.12.013View ArticleGoogle Scholar - Mory B, Ardon R Lecture Notes in Computer Science.
*Fuzzy Region Competition: A Convex Two-Phase Segmentation Framework*2007, 214–226.Google Scholar - Chan TF, Esedoglu S, Nikolova M: Algorithms for finding global minimums of image segmentation and denoising models.
*SIAM J. Appl. Math.*2006, 66: 1632–1648. 10.1137/040615286MATHMathSciNetView ArticleGoogle Scholar - Chan TF, Golub GH, Mulet P: A nonlinear primal-dual method for total variation-based image restoration.
*SIAM J. Sci. Comput.*1999, 20(6):1964–1977. 10.1137/S1064827596299767MATHMathSciNetView ArticleGoogle Scholar - Carter, JL: Dual methods for total variation-based image restoration. PhD thesis, UCLA (2001)Google Scholar
- Aujol JF, Chambolle A: Dual norms and image decomposition models.
*Int. J. Comput. Vis.*2005, 63: 85–104. 10.1007/s11263-005-4948-3View ArticleGoogle Scholar - Aujol JF, Gilboa G, Chan TF, Osher S: Structure-texture image decomposition modeling algorithms and parameter selection.
*Int. J. Comput. Vis.*2006, 67: 111–136. 10.1007/s11263-006-4331-zMATHView ArticleGoogle Scholar - Chambolle A: An algorithm for total variation minimization and applications.
*J. Math. Imaging Vis.*2004, 20: 89–97.MathSciNetView ArticleGoogle Scholar

## Copyright

This article is published under license to BioMed Central Ltd. This is an open access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.