Keywords

1 Introduction

Image segmentation is a basic technique in the field of computer vision and image processing. Many segmentation methods have been proposed during the past decades. Active contour model (ACM) is one of the most important segmentation methods. The existing ACM methods can be divided into two categories: edge-based models [1] and region-based models [2,3,4,5, 7,8,9,10].

The classical edge-based models is Geodesic active contour (GAC) model [1], which depends on the gradient of the given image to construct an edge stopping function (ESF). The main role of ESF is to stop the evolution contour on the true object boundaries. In addition, some other edge-based ACMs introduce a balloon force term to control the motion of the contour. However, the edge-based models often lead to local minimization, are sensitive to initial contour and cannot get good segmental result for noise image.

Region-based ACM has many advantages over edge-based ones. One of the most popular region-based ACMs is Chan-Vese (CV) [2] model, which proposed by Chan and Vese. The CV model is based on Mumford-Shah segmentation techniques and has been successfully applied to binary phase segmentation. However, this method usually fails to segment images with intensity inhomogeneity, because it is based on the assumption that the image domain contains a series of homogeneous region.

To solve the limitations of intensity inhomogeneity, various efficient methods have been developed. In 2005, Li et al. proposed a local binary fitting (LBF) [3,4,5] method to segment the image with intensity inhomogeneity and reduce the costly re-initialization. In 2012, Wang et al. proposed a local Chan-Vese (LCV) [6] model, by comparison with CV model and LBF model, LCV model can segment images with few iteration times and be less sensitive to initial contour. In 2014, Zhang et al. proposed a novel level set (LSACM) [7] method, which utilize a sliding window to map the original image into another domain where the intensity of each object is homogeneity, this method can achieve better segmentation results for images with severe intensity inhomogeneity. In 2015, Suvadip Mukherjee et al. [8] proposed a region-based method (L2S), which enables accommodate objects even in presence of intensity inhomogeneity or noise. However, this model may be slow, owing to computing Legendre basis functions. In 2016, Shi et al. [9] presented a local and global binary fitting active contour model (LGBF), which effectively overcomes shortcomings of the CV model and LBF model. LGBF model is superiority for the intensity inhomogeneous.

In this paper, we propose a novel adaptive segmentation method combines the advantages of the SBGFRLS model and GAC model. Our model is robust and efficient to deal with images in the presence of intensity inhomogeneity, noise and weak-edge object.

This paper is organized as follows. Section 2 reviews GAC, the L2S and SBGFRLS method briefly. Section 3 introduces the new model and corresponding algorithm. In Sect. 4, we carry out some experiments for synthetic and real images, and make a comparison with other active contour models. A summary of our work is drawn in Sect. 5.

2 The Related Works

2.1 The GAC Model

Let \( \Omega \) be a bounded open subset of \( R^{2} \) and \( I : [ 0 , {\text{a]}} \times [ 0 , {\text{b]}} \to R^{ + } \) be a given image. Let \( C(q):[0,1] \to R^{2} \) be a parameterized planar curve. The GAC model is formulated by minimizing the following energy function:

$$ E^{GAC} (C) = \int_{0}^{1} {g(\left| {\nabla I(C(q)} \right|)} \left| {C^{'} (q)} \right|dq $$
(1)

where \( \nabla I \) is the gradient of image \( I \), \( C^{'} (q) \) is the tangent vector of the curve \( C \). \( g \) is an ESF, which can stop the contour evolution on the desired object boundaries. Generally speaking, ESF \( g(\left| {\nabla I} \right|) \) is requested to be positive, decreasing and regular, such that \( \lim_{t \to - \infty } g(t) = 0 \). Such as

$$ \, g(\left| {\nabla I} \right|) = \frac{1}{{1 + \left| {\nabla G_{\sigma } *I} \right|^{2} }} $$
(2)

where \( G_{\sigma } \) is a Gaussian kernel with standard deviation \( \sigma \). According to calculation of variation, the corresponding Euler-Lagrange equation of Eq. (1) is as follows:

$$ C_{t} = g(\left| {\nabla I} \right|)\kappa \mathop N\limits^{ \to } - (\nabla g \cdot \mathop N\limits^{ \to } )\mathop N\limits^{ \to } $$
(3)

where \( \kappa \) is the curvature of the contour and \( \mathop N\limits^{ \to } \) is the normal to the curve. The constant term \( \alpha \) can be used for shrinking or expanding the curve. Then Eq. (3) can be rewritten as:

$$ C_{t} = g(\left| {\nabla I} \right|)(\kappa + \alpha )\mathop N\limits^{ \to } - (\nabla g \cdot \mathop N\limits^{ \to } )\mathop N\limits^{ \to } $$
(4)

The corresponding level set formulation is as follows:

$$ \frac{\partial \phi }{\partial t} = g\left| {\nabla \phi } \right|(div(\frac{\nabla \phi }{{\left| {\nabla \phi } \right|}}) + \alpha ) + \nabla g \cdot \nabla \phi $$
(5)

The GAC model is effective to extract the object when the initial contour surrounds its boundary and inefficient to detect the interior contour without setting the interior initial contour. In conclusion, the GAC model possesses local segmentation property, which can only segment the desired object with a more reasonable initial contour. However, this method cannot segment images with faint boundaries, ill-defined edges or low contrast.

2.2 The SBGFRLS Model

Zhang et al. proposed selective binary and Gaussian filtering regularized level set (SBGFRLS) [10] method in 2009. A new signed pressure force (SPF) function was proposed to substitute ESF function in Eq. (5). The corresponding gradient descent flow equation is obtained as follows:

$$ \frac{\partial \phi }{\partial t} = spf(I(x)) \cdot (div(\frac{\nabla \phi }{{\left| {\nabla \phi } \right|}}) + \alpha )\left| {\nabla \phi } \right| + \nabla spf(I(x)) \cdot \nabla \phi , \, x \in \Omega $$
(6)

where the SPF function has values in the range \( [ - 1,1] \), that are smaller within the region(s)-of-interest. It modulates the signs of the pressure forces inside and outside the region of interest so that the contour shrinks when outside the object, or expands when inside the object. The SPF function as follows:

$$ spf(I(x)) = \frac{{I(x) - \frac{{c_{1} + c_{2} }}{2}}}{{\hbox{max} (\left| {I(x) - \frac{{c_{1} + c_{2} }}{2}} \right|)}}, \, x \in \Omega $$
(7)

where \( c_{1} \) and \( c_{2} \) are defined in Eqs. (8) and (9), respectively.

$$ c_{1} (\phi ) = \frac{{\int_{\Omega } {I(x) \cdot H(\phi )} dx}}{{\int_{\Omega } {H(\phi )} dx}} $$
(8)
$$ c_{2} (\phi ) = \frac{{\int_{\Omega } {I(x) \cdot (1{ - }H(\phi )} )dx}}{{\int_{\Omega } {(1 - H(\phi } ))dx}} $$
(9)

The regular term \( div(\frac{\nabla \phi }{{\left| {\nabla \phi } \right|}})\left| {\nabla \phi } \right| \) is unnecessary since this model utilizes a Gaussian filter. In addition, the term \( \nabla spf \cdot \nabla \phi \) can also be removed. Finally, the level set formulation of the proposed model can be written as follows:

$$ \frac{\partial \phi }{\partial t} = spf(I(x)) \cdot \alpha \left| {\nabla \phi } \right|,x \in \Omega $$
(10)

The model utilizes the image statistical information to stop the curve evolution on the desired boundaries, which are less sensitive to noise, and is more efficient. However, for images with severe intensity inhomogeneity, this model and CV model have similar weaknesses, because the models utilize the global image intensities inside and outside the contour.

2.3 The L2S Model

Suvadip Mukherjee et al. [8] proposed a region-based segmentation by utilizing Legendre polynomials to approximate the foreground and background illumination. The traditional CV model can be reformulated and generalized by two smooth functions \( c^{m}_{1} (x) \) and \( c_{2}^{m} \) instead of the scalars \( c_{1} \) and \( c_{2} \). To preserve the smoothness and flexibility of the functions, \( c^{m}_{1} (x) \) and \( c_{2}^{m} \) can be represented as a liner combination of a set of Legendre basis functions. The two functions can be written as follow:

$$ c^{m}_{1} (x) = \sum {\alpha_{k} } {\rm P}_{k} (x),\;\;c_{2}^{m} (x) = \sum {\beta_{k} } {\rm P}_{k} (x) $$
(11)

where \( {\rm P}_{k} \) is one dimensional Legendre polynomial of degree k, which can be seen as the outer product of the one dimensional counterparts. The 2-D polynomial is defined as

$$ \rho_{k} (x,y) = {\rm P}_{k} (x){\rm P}_{k} (y),X = (x,y) \in \Omega \subset \left[ { - 1,1} \right]^{2} $$
(12)

where \( {\rm P}_{k} \) can be defined as

$$ {\rm P}_{k} (x) = \frac{1}{{2^{k} }}\sum\limits_{i = 0}^{k} {\left( {\begin{array}{*{20}c} k \\ i \\ \end{array} } \right)} (x - 1)^{k - i} (x + 1)^{i} $$
(13)

\( {\rm P}(x) = ({\rm P}_{0} (x), \cdot \cdot \cdot ,{\rm P}_{N} (x))^{T} \) is the vector of Legendre polynomials. \( A = (\alpha_{0} , \cdot \cdot \cdot ,\alpha {}_{N})^{T} \), \( B = (\beta_{0} , \cdot \cdot \cdot ,\beta_{N} )^{T} \) are both the coefficient for the inside contour and outside contour, respectively. Then the energy functional of the L2S can be written as the following equation:

$$ \begin{array}{*{20}l} {E^{L2S} (\phi ,A,B) = \int_{\Omega } {\left| {f(x) - A^{T} {\rm P}(x)} \right|}^{2} H(\phi (x))dx + \lambda_{1} \left\| A \right\|_{2}^{2} } \hfill \\ {\quad \quad \quad \quad \quad \quad + \;\int_{\Omega } {\left| {f(x) - B^{T} {\rm P}(x)} \right|}^{2} (1 - H(\phi (x)))dx + \lambda_{1} \left\| B \right\|_{2}^{2} } \hfill \\ {\quad \quad \quad \quad \quad \quad + \;\nu \int_{\Omega } {\delta_{\varepsilon } } (\phi )\frac{\nabla \phi }{{\left| {\nabla \phi } \right|}}dx} \hfill \\ \end{array} $$
(14)

where \( \lambda_{1} \ge 0,\lambda_{2} \ge 0 \) are fixed scalars. The last term in Eq. (14) is regulated by the positive parameter \( \nu \), Let perform \( \frac{{\partial E^{L2S} }}{\partial A} = 0, \, \frac{{\partial E^{L2S} }}{\partial B} = 0 \), so \( \hat{A} \) and \( \hat{B} \) are respectively acquired as:

$$ \begin{array}{*{20}l} {\hat{A} = \left[ {K + \lambda_{1} {\rm I}} \right]^{ - 1} P, \, \left[ K \right]_{i,j} = \left\langle {\sqrt {H(\phi (x))} {\rm P}_{i} (x),\sqrt {H(\phi (x))} {\rm P}_{j} (x)} \right\rangle } \hfill \\ {\hat{B} = \left[ {L + \lambda_{2} {\rm I}} \right]^{ - 1} Q, \, \left[ L \right]_{i,j} = \left\langle {\sqrt {1 - H(\phi (x))} {\rm P}_{i} (x),\sqrt {1 - H(\phi (x))} {\rm P}_{j} (x)} \right\rangle } \hfill \\ \end{array} $$
(15)

\( \left\langle , \right\rangle \) denotes the inner product operator. The vector \( P \) and \( Q \) are obtained as \( P{ = }\int_{\Omega } {{\rm P}(x)f(x)H(\phi (x))} dx \), \( Q = \int_{\Omega } {{\rm P}(x)f(x)(1{ - }H(\phi (x)))} dx \). By minimizing Eq. (14), we obtain the corresponding variational level set formulation as follow:

$$ \frac{\partial \phi }{\partial t} = \left[ { - \left| {f(x) - \hat{A}^{T} {\rm P}(x)} \right|^{2} + \left| {f(x) - \hat{B}^{T} {\rm P}(x)} \right|^{2} } \right]\delta_{\varepsilon } (\phi ){ + }\nu \delta_{\varepsilon } (\phi )div(\frac{\nabla \phi }{{\left| {\nabla \phi } \right|}}) $$
(16)

\( H(\phi (x)) \) is the Heaviside function and \( \delta (\phi ) \) is the Dirac function. They are selected as follows:

$$ \left\{ \begin{aligned} & H(\phi ) = \frac{1}{2}(1 + \frac{2}{\pi }\arctan (\frac{\phi }{\varepsilon })), \\ & \delta_{\varepsilon } = \frac{1}{\pi } \cdot \frac{\varepsilon }{{\varepsilon^{2} + \phi^{2} }}, \\ \end{aligned} \right.\phi \in R $$
(17)

The model approximates foreground and background by computing \( \hat{A}^{T} {\rm P}(x) \), \( \hat{B}^{T} {\rm P}(x) \), respectively.

3 A Novel Adaptive Segmentation Model

3.1 Model Construction

Let \( \Omega \) be an open subset of \( R^{2} \), a given image \( I:\Omega \to R \). Let us define the evolving curve \( C \) in \( \Omega \). For arbitrary point \( x \in \Omega \), \( C \) can be represented by the zero level set of a Lipschitz function \( \phi (x) \) such that \( C{ = }\left\{ {x \in \Omega :\phi (x)} \right.\left. { = 0} \right\} \).

$$ \left\{ \begin{aligned} inside(C) = \left\{ {x \in \Omega :\phi (x)} \right. > \left. 0 \right\}, \hfill \\ outside(C) = \left\{ {x \in \Omega :\phi (x)} \right.\left. { < 0} \right\} \, \hfill \\ \end{aligned} \right. $$
(18)

\( inside(C) \), \( outside(C) \) denote the foreground regions and background regions, respectively.

Similar as GAC model, in order to control the length of evolution curve, we introduce the area of the curve in this section. This can be more effective to avoid local minima and get desired result. The gradient descent flow equation is as follows:

$$ \frac{\partial \phi }{\partial t} = g\left| {\nabla \phi } \right|(div(\frac{\nabla \phi }{{\left| {\nabla \phi } \right|}}) + \alpha ) + \nabla g \cdot \nabla \phi - \nu $$
(19)

where \( \nu \ge 0 \) is fixed parameter. In our numerical calculations, we set \( \nu \in \left[ {0,1} \right] \). Especially if the image background is white, we set \( \nu { = 0} \).

Inspired by GAC model and SBGFRLS model, the balloon force \( \alpha \) could control the contour shrinking or expanding, and then we can improve SPF function. The contour will expand when it is inside the object, and will shrink when it is outside the object. We substitute the SPF function in Eq. (7) for the ESP in Eq. (19), the level set formulation is defined as follows:

$$ \frac{\partial \phi }{\partial t} = spf(I(x)) \cdot (div(\frac{\nabla \phi }{{\left| {\nabla \phi } \right|}}) + \alpha )\left| {\nabla \phi } \right| + \nabla spf(I(x)) \cdot \nabla \phi - \nu ,x \in \Omega $$
(20)

In addition, SPF function employs statistical information of regions, which can well handle images with weak edges or without edges, so the term \( \nabla spf(I(x)) \cdot \nabla \phi \) is not very important and can be removed. So the level set formulation can be simplified as:

$$ \frac{\partial \phi }{\partial t} = spf(I(x))(div(\frac{\nabla \phi }{{\left| {\nabla \phi } \right|}}) + \alpha )\left| {\nabla \phi } \right| - \nu , \, x \in \Omega $$
(21)

Curvature \( div(\frac{\nabla \phi }{{\left| {\nabla \phi } \right|}}) \) [11] can smooth the contour, meanwhile the use of \( \alpha \) has the effect of shrinking or expanding contour at a constant speed.

In order to overcome the shortcomings of SBGFRLS model, we substitute constants \( c_{1} \), \( c_{2} \) by \( c_{1}^{m} (x), \, c_{2}^{m} (x) \) in Eq. (7), and it is better to deal with images in presence of intensity inhomogeneity. The new SPF function is defined as follow:

$$ spf(I(x)) = \frac{{I(x) - \frac{{\hat{A}^{T} {\rm P}(x) + \hat{B}^{T} {\rm P}(x)}}{2}}}{{\hbox{max} (\left| {I(x) - \frac{{\hat{A}^{T} {\rm P}(x) + \hat{B}^{T} {\rm P}(x)}}{2}} \right|)}}, \, x \in \Omega $$
(22)

We can replace \( \left| {\nabla \phi } \right| \) by \( \delta (\phi ) \) in (21) to increase the speed of curve evolution, and the final proposed model is as follows:

$$ \frac{\partial \phi }{\partial t} = \delta (\phi ) \cdot spf(I(x))(div(\frac{\nabla \phi }{{\left| {\nabla \phi } \right|}}) + \alpha ) - \nu , \, x \in \Omega $$
(23)

where \( \alpha \in R \) is a correction term, then we can ensure \( div(\frac{\nabla \phi }{{\left| {\nabla \phi } \right|}}) + \alpha \) is a non-zero value. The constant \( \alpha \) may be seen as a force to push the curve evolves towards object boundary and an adaptive constant to control direction of curve. In the case of gray level increasing (from black to grey), if the correction term is positive, the evolution curve will continuously evolve from outside to inside, it is more efficient to segment objects within initial contour. If the correction term is negative, the curve will evolve in an opposite direction, then it can sweep over objects outside the initial contour. Conversely, in the case of gray level decreasing (from grey to black), we will get the opposite result. Therefore, for each category of images, an appropriate correction term is necessary for achieving satisfying segmentation results.

The final energy function make full use of a region term (global information part) and Legendre polynomials (local information part). Our model has the flexibility to segment desired object and avoid edge leakage.

3.2 Algorithm Procedure

In the section, the main procedure of the proposed model is summarized as follows:

figure a

The step (e) serves as an optional segmentation procedure.

4 Experimental Results

Synthetic and real images are tested in this section. In each experiment, parameters and initial contour are set manually. We choose \( m = 1 \), \( \sigma = 1 \) here. The correction term \( \alpha \) and region term \( \nu \) are very important for image segmentation. The Dice Similarity Coefficients (DSC) is compared for results with different models. The Dice index \( D \in \left[ {0,1} \right] \) represents the difference between the segmental result \( R_{1} \) and the ground truth \( R_{2} \). The DSC is defined as \( D(R_{1} ,R_{2} ) = \frac{{2Area(R_{1} \cap R_{2} )}}{{Area(R_{1} ) + Area(R_{2} )}} \).

Figure 1 shows the performance of our model for noisy image segmentation. The image (two objects [12]) in the first, second and third row show the corresponding segmentation results by CV model, SBGFRLS model and our model. The first column, second column and third column are images with Gaussian noise of standard deviation 0.1, 0.2, and 0.3, respectively. As shown in Fig. 2, the Dice value of our model is more stable with the variance increasing.

Fig. 1.
figure 1

Segmental results for images with Gaussian white noise of mean 0 and variance \( \sigma \) = 0.1, 0.2, 0.3 (From left to right) by CV, SBGFRLS and our model (from top to bottom).

Fig. 2.
figure 2

The corresponding dice values of the segmental results in Fig. 1

Figure 3 shows comparison results for images (Yeast Fluorescence Micrograph, two X-ray images of vessels [12]) with intensity inhomogeneity. The edge around the blood vessels is blurred, which render it a challenging task for segmentation. Figures 3 and 4 show that our model is superior to GAC model, L2S model and SBGFRLS model. In conclusion, our model can obtain true boundaries and deal with images with intensity inhomogeneity.

Fig. 3.
figure 3

Comparison result for various types of image, intensity inhomogeneity, low contrast, weak edge image. First column: results of GAC model. Second column: results of SBGFRLS model. Third column: results of L2S model. Fourth column: result of our proposed model.

Fig. 4.
figure 4

The corresponding dice values of the segmental results in Fig. 3.

Figures 5 and 6 show the effectiveness of our model for low contrast images. The first column are original images. The second column, third column and fourth column show the contours of the regions-of-interest by LCV model, LSACM model and our model. As shown in Fig. 5, our model and LSACM model can successfully obtain segmentation objects, but our model gets more smoother curve and detects well the object’s boundary. So our model has capability to segment images with weak boundary. For images with brighter background, we set \( \nu = 0 \) and \( \alpha < 0 \), then the new model will evolve without region term. Therefore, the curve can evolve from outside to inside quickly and effectively instead of \( \alpha > 0 \). Better segmentation results can be obtained, and the flexibility of our model also can be shown in Figs. 4 and 5.

Fig. 5.
figure 5

Detected contour of regions-of-interest by LCV model, LSACM model and our model. The corresponding figure shows from left to right. First column: the original image. Second column: results of LCV model. Third column: results of model. Fourth column: results of our model.

Fig. 6.
figure 6

The corresponding dice values of the segmental results in Fig. 5.

5 Conclusions

In this paper, a novel adaptive segmentation model for images in presence of low contrast, noise, weak edge and intensity inhomogeneity is proposed. The new model combines the advantages of GAC model and SBGFRLS model. The local and global information are all considered by our model. Legendre polynomials are employed to approximate region and then new model can deal with images with intensity inhomogeneity. The new model can choose the evolution direction adaptively and not very sensitive for initial contour. In addition our model can also handle images by selecting a rectangular or elliptical initial contour. Experimental results show that our model is more available and effective.