1 Introduction

Image segmentation has always been a fundamental and important task in the field of computer vision and image processing. Its goal is to divide the image area into disjoint sub-regions and the properties of the image are consistent in each sub-region. For traditional segmentation methods, the difficulty comes from intensity inhomogeneity and low SNR of images.

The active contour models (ACM) proposed by Kass et al. [10] has been extensively investigated and successfully used in the image segmentation due to its strong ability to deal with the local discontinuous edge features. The existing ACMs can be classified into two types: edge-based models [4, 11, 13, 15] and region-based models [6,7,8,9, 12, 14, 16, 19,20,21,22, 24, 25]. One of the most popular edge-based models is the geodesic active contour model [4], and it is sensitive to noise and requires constant re-initialization of the level set function. In order to overcome the defect that the edge-based models excessively depend upon edge information, many researchers have proposed the region-based models. Among these models, the Chan-Vese (CV) [6] is the most representative one. It is based on the assumption that image intensities are statistically homogeneous in each region and thus it can provide rather good segmentation results for images with intensity homogeneity. Yu et al. [23] proposed the R-DRLSE model combining DRLSE [13] and CV models to reduce the iteration numbers and computation time. However, the phenomenon of intensity inhomogeneity occurs in most of real-world images.

In order to segment images with intensity inhomogeneity, Li et al. [12] proposed a local binary fitting model (LBF), which transforms the global binary fitting energy function of the CV model into the local binary fitting energy function based on the kernel function. However, the model is more sensitive to the initial contour and different initial contour position will affect the segmentation result. Wang et al. [19] proposed an energy functional with local and global intensity fitting energy (LGIF). Wang et al. [20] proposed a local Chan-Vese (LCV) model which enhances the target and the background of the intensity contrast through the convolution of the image and the original image to do the difference. Zhang et al. [25] devised a maximum likelihood energy functional based on distribution of each local region (LSACM, Locally Statistical Active Contour Model), which combines the bias field, the level set function, and the piecewise constant function approximating the true image. Wang et al. [22] proposed to construct a local hybrid image fitting (LHIF) energy function by leveraging the strength of both LBF and LIF [24] models for accurate image segmentation.

In this paper, we proposed a novel region-based active contour model based on global and local image intensity fitting with kernel function (K-GLIF) for image segmentation. Firstly, the intensity fitting term of the level set function is the gradient descent flow that minimizes the global binary fitting energy functional. Then, the local intensity fitting value based on the generalized Gaussian kernel function is incorporated into the global intensity fitting value to form the weighted intensity fitting value on the two sides of the contour. Due to the kernel function in the new intensity fitting term, the intensity information in local regions is extracted to guide the motion of the contour, which enables the proposed model to effectively segment images with inhomogeneous intensity and smooth noise. Finally, the new regularization term is used to control the smoothness of level set function and avoid complicated re-initialization. Experimental results and comparisons with other models of inhomogeneous images, synthetic images, medical images, multi-object images, natural and infrared images are made to show the advantages of the K-GLIF model in accuracy and robustness to initial contours.

The rest of the paper is organized as follows: In Section 2, we review some classic region-based models and analyze their limitations. The K-GLIF model is proposed in Section 3. Section 4 reports the experimental results on synthetic and real images, followed by some discussions in Section 5. Finally, the conclusive remark is included in Section 6.

2 Previous works

2.1 The CV model

Let I : Ω → R be an input image and C be a closed curve. The CV energy functional is defined as follows:

$$ {\displaystyle \begin{array}{l}{E}^{CV}\left({c}_1,{c}_2,C\right)=\mu \cdot \mathrm{length}\left(\mathrm{C}\right)+\mathrm{v}\cdot \mathrm{area}\left(\mathrm{inside}\left(\mathrm{C}\right)\right)\\ {}\kern4.079998em +{\lambda}_1{\int}_{inside(C)}{\left|I(x)-{c}_1\right|}^2 dx+{\lambda}_2{\int}_{outside(C)}{\left|I(x)-{c}_2\right|}^2 dx\end{array}} $$
(1)

where μ, v ≥ 0, λ1, λ2 > 0. The Euclidean length term is used to regularize the contour, c1 and c2 are two constants that approximate the image intensities in the interior and exterior of the curve C, respectively.

Minimizing the above energy functional by variational method [2], and the contour curves are expressed by level set ϕ, i.e. C = {x ∈ Ω|ϕ(x) = 0}, then get the following partial differential equation:

$$ \frac{\partial \phi }{\partial t}=\delta \left(\phi \right)\left[\mu \cdot \operatorname{div}\left(\frac{\nabla \phi }{\left|\nabla \phi \right|}\right)-v-{\lambda}_1{\left(I(x)-{c}_1\right)}^2+{\lambda}_2{\left(I(x)-{c}_2\right)}^2\right] $$
(2)

It is noted that the constants c1 and c2 represent the global information of internal and external contours and such image information is not accurate when image intensity is inhomogeneous.

2.2 The LBF model

The local binary fitting (LBF) model is proposed by Li et al. [12] that embedded the local intensity information. The energy functional of LBF model is defined as follows:

$$ {\displaystyle \begin{array}{l}{E}^{LBF}\left({f}_1,{f}_2,C\right)={\lambda}_1{\iint}_{inside(C)}{K}_{\sigma}\left(x-y\right){\left|I(y)-{f}_1(x)\right|}^2 dydx\\ {}\kern3.959998em +{\lambda}_2{\iint}_{outside(C)}{K}_{\sigma}\left(x-y\right){\left|I(y)-{f}_2(x)\right|}^2 dydx,\kern1.25em x,y\in \Omega \end{array}} $$
(3)

where λ1, λ2 > 0. Kσ is the Gaussian kernel function with standard deviation σ, f1 and f2 are two smooth functions that approximate the local image intensity of the interior and exterior of the evolving curve, respectively. Obviously, such localization property may cause the energy functional to fall into the local minimums and the segmentation result is vulnerable to contour initialization.

2.3 The LCV model

Wang et al. [19] proposed a local Chan-Vese (LCV) model which integrated the local statistical information and global region information into the energy functional. The energy functional is composed of three parts: global term EG, local term EL and regularization term ER.

$$ {E}^{LCV}=\alpha \cdot {E}^G+\beta \cdot {E}^L+{E}^R $$
(4)

where α and β are constants, the global term EG is from the CV model and the local term EL is defined as:

$$ {E}^L\left({d}_1,{d}_2,C\right)={\lambda}_1{\int}_{inside(C)}{\left|{g}_k\left(I(x)\right)-I(x)-{d}_1\right|}^2 dx+{\lambda}_2{\int}_{ouside(C)}{\left|{g}_k\left(I(x)\right)-I(x)-{d}_2\right|}^2 dx $$
(5)

where gk is an average filter with k × k size window, d1 and d2 are the intensity averages of difference image gkI(x) − I(x) in the interior and exterior of the curve C, respectively.

The LCV model does not calculate the convolution during the iteration process compared to the LBF model and thus is more effective than the LBF model. The technique using global information can improve the robustness to initial contours. However, the LCV model can be regarded as the CV model acting on the difference image gk(I(x)) − I(x). As a result, it is difficult for the LCV model to satisfactorily segment the image with inhomogeneous intensity.

3 Global and local image intensity fitting with kernel function

3.1 The intensity fitting term

Let I : Ω → R be an input image and C be a closed curve. We define the following data energy functional:

$$ {E}^{data}\left({m}_1,{m}_2,\phi \right)={\int}_{\Omega}{\left|I(x)-{m}_1\right|}^2H\left(\phi (x)\right) dx+{\int}_{\Omega}{\left|I(x)-{m}_2\right|}^2\left(1-H\left(\phi (x)\right)\right) dx $$
(6)

where m1, m2 are weighted intensity fitting values on the two sides of the contour, H(⋅) is the Heaviside function, m1 and m2 are defined as follows:

$$ \left\{\begin{array}{l}{m}_1(x)=w\cdot \mathrm{average}\left(I\in \left\{x\in \Omega \left|\phi (x)\ge 0\right.\right\}\right)+\left(1-w\right){f}_1(x)\\ {}{m}_2(x)=w\cdot \mathrm{average}\left(I\in \left\{x\in \Omega \left|\phi (x)<0\right.\right\}\right)+\left(1-w\right){f}_2(x)\end{array}\right. $$
(7)

where w is a weighting parameter (0 ≤ w ≤ 1). The more inhomogeneous an image is, the smaller the parameter w should be and larger the proportion of local intensities fitting value is larger. f1(x), f2(x) are two smooth functions of generalized Gaussian window that approximate the local image intensities fitting values in the interior and exterior of the contour. The two smooth functions are defined as follows:

$$ \left\{\begin{array}{l}{f}_1=\frac{K_{\beta}\ast \left[H\left(\phi \right)I(x)\right]}{K_{\beta}\ast H\left(\phi \right)}\\ {}{f}_2=\frac{K_{\beta}\ast \left[1-H\left(\phi \right)I(x)\right]}{K_{\beta}\ast \left(1-H\left(\phi \right)\right)}\end{array}\right. $$
(8)

where Kβ is a generalized Gaussian kernel function [17] with scale parameter α and shape parameter β and is defined by

$$ {K}_{\beta }(x)=\frac{\beta }{2\alpha \Gamma \left(1/\beta \right)}\exp \left(-{\left(\left|x\right|/\alpha \right)}^{\beta}\right) $$
(9)

where Γ(⋅) is the Gamma function. The shape parameter β determines the decay rate of the probability distribution function. Figure 1 illustrates the probability density function of the generalized Gaussian kernel functions with different shape parameters. The smaller the shape parameter is, the probability density function decline faster.

Fig. 1
figure 1

The probability density function of generalized Gaussian distribution

3.2 The new regularization term

In order to avoid the re-initialization step, the energy penalty term is proposed in [11] to keep the level set function as a signed distance function which can be characterized by the following energy functional:

$$ {R}_p\left(\phi \right)={\int}_{\Omega}p\left(\left|\nabla \phi (x)\right|\right) dx $$
(10)

where p(s) is the following potential function with minimum point s = 1:

$$ p(s)={\int}_{\Omega}\frac{1}{2}{\left(s-1\right)}^2 dx $$
(11)

However, the above energy penalty term may have an undesirable side effect on the level set function when |∇ϕ| is close to 0 and it affects the accuracy of numerical solution. Li et al. [13] proposed a double-well potential function p1(s) based on trigonometric function for the distance regularization term and the corresponding energy functional has two minimum points at s = 0 and s = 1. Wang et al. [21] take the idea of a few steps by constructing the new double-well potential function based on polynomial function:

$$ {p}_2(s)=\left\{\begin{array}{ll}\frac{1}{2}{s}^2{\left(s-1\right)}^2+\frac{1}{2}{s}^3{\left(s-1\right)}^3,& s\le 1\\ {}\frac{1}{2}{\left(s-1\right)}^2,& s>1\end{array}\right. $$
(12)

It has the same property with the double-well potential function p1(s) but has low computation complexity due to the usage of polynomials. Because the trigonometric function is computed by Taylor polynomial, the order of new polynomial function is low and is easy to be computed. Furthermore, the polynomial function has the characteristics of simple structure and easy operation, differentiation and integration.

Then, the new energy penalty term is obtained by follows:

$$ {R}_{p_2}\left(\phi \right)={\int}_{\Omega}{p}_2\left(\left|\nabla \phi (x)\right|\right) dx $$
(13)

where p2(s) is the new double-well potential function in Eq. (12).

The gradient flow of new energy penalty term is as follows:

$$ \left\{\begin{array}{l}\frac{\partial \phi }{\partial t}=-\frac{\partial {R}_{p_2}}{\partial \phi }=\mathit{\operatorname{div}}\left({d}_{p_2}\left(\left|\nabla \phi \right|\right)\nabla \phi \right)\\ {}{d}_{p_2}={p}_2\hbox{'}(s)/s\end{array}\right. $$
(14)

To control the smoothness of the zero level set, the following length penalty term is also included:

$$ L\left(\phi \right)={\int}_{\Omega}\left|\nabla H\left(\phi (x)\right)\right| dx={\int}_{\Omega}\delta (x)\left|\nabla \phi (x)\right| dx $$
(15)

In this way, the new regularize energy term of the proposed method consists of two parts:

$$ {E}^R\left(\phi \right)=v\cdot L\left(\phi \right)+P\left(\phi \right)=v{\int}_{\Omega}{\delta}_{\varepsilon}\left|\nabla \phi (x)\right| dx+{\int}_{\Omega}{p}_2\left(\left|\nabla \phi (x)\right|\right) dx $$
(16)

where v is the parameter to control the penalization term. The v larger is, the larger objects are detected.

3.3 Level set evolution equation

Now, the overall energy functional of the proposed method is defined as follows:

$$ {\displaystyle \begin{array}{l}{E}^{new}\left({m}_1,{m}_2,\phi \right)={E}^{data}\left({m}_1,{m}_2,\phi \right)+{E}^R\left(\phi \right)\\ {}\kern4.079998em ={\int}_{\Omega}{\left|I(x)-{m}_1\right|}^2H\left(\phi (x)\right) dx+{\int}_{\Omega}{\left|I(x)-{m}_2\right|}^2\left(1-H\left(\phi (x)\right)\right) dx\\ {}\kern4.439998em +v{\int}_{\Omega}{\delta}_{\varepsilon}\left|\nabla \phi (x)\right| dx+{\int}_{\Omega}{p}_2\left(\left|\nabla \phi (x)\right|\right) dx\end{array}} $$
(17)

In the above equation, the regularized versions of Heaviside function and Dirac function are utilized as follow:

$$ \left\{\begin{array}{l}{H}_{\varepsilon }(x)=\frac{1}{2}\left(1+\frac{2}{\pi}\arctan \left(\frac{x}{\varepsilon}\right)\right)\\ {}{\delta}_{\varepsilon }(x)=\frac{1}{\pi}\cdot \frac{\varepsilon }{\varepsilon^2+{x}^2}\end{array}\right. $$
(18)

Minimizing the overall energy function with respect to ϕ to get the corresponding gradient descent flow by the variation level set method [2]:

$$ {\displaystyle \begin{array}{l}\frac{\partial \phi }{\partial t}=-{\delta}_{\varepsilon}\left(\phi \right)\left[\left(I(x)-{m}_1{(x)}^2\right)-\left(I(x)-{m}_2{(x)}^2\right)\right]\\ {}\kern1.56em +v\cdot {\delta}_{\varepsilon}\left(\phi \right)\cdot \mathit{\operatorname{div}}\left(\frac{\nabla \phi }{\left|\nabla \phi \right|}\right)+\mathit{\operatorname{div}}\left({d}_{p_2}\left(\left|\nabla \phi \right|\right)\nabla \phi \right)\end{array}} $$
(19)

where δε(ϕ) is the regularized Dirac function defined in Eq. (18).

3.4 Description of algorithm steps

The main steps of the proposed algorithm are summarized as follows:

  1. Step 1:

    Set the initial contour C and the default parameters.

  2. Step 2:

    Set the parameters v, w and the number of iteration n.

  3. Step 3:

    Calculate the object and the background weighted intensity fitting values of the original image.

  4. Step 4:

    Evolve level set function ϕ according to the Eq. (19).

  5. Step 5:

    Judge whether evolution is stationary. If yes, extract the zero level set from the final level set function ϕn + 1; Otherwise, go to Step 3.

4 Experimental results and analysis

In this section, we apply the proposed K-GLIF model to inhomogeneous images, synthetic images, medical images, multi-object images, natural and infrared images from different modalities, and use the same parameters setting of Δt = 0.1, h = 1, ε = 1, α = 40 and β = 0.4 for all the experiments. The parameters of v, w and n can be adjusted according to specific images. The computation is performed in Matlab 2014a on a computer with 3.30GHz Intel Core i5 CPU and 4GB RAM.

4.1 Inhomogeneous images segmentation

Four images with inhomogeneous intensity are used to validate the performance of the K-GLIF model. The upper row of Fig. 2 shows the initial contour (red curve) of the four images. The lower row of Fig. 2 demonstrates the segmentation results (green curve) using the K-GLIF model. It can be seen that the proposed method can effectively segment images with inhomogeneous intensity. The parameters are taken as w = 0.01, v = 0.002 × 2552 for the first image and w = 0.01, v = 0.001 × 2552 for the other three images.

Fig. 2
figure 2

Segmentation results on inhomogeneous images using the K-GLIF model. The upper row: the initial contours. The lower row: the segmentation results of the proposed method

4.2 The robustness of the initial contour

Figure 3 illustrates the segmentation results of the K-GLIF model from different initial contours on a synthetic image. The upper row includes different four different initial contours (red curve) of the images, the middle row demonstrates the segmentation results using the LBF model from the four initial contours, and the lower row is the segmentation results by the proposed K-GLIF model. It can be observed that the LBF fails to segment the synthetic image for different initial contours while the proposed K-GLIF model can overcome the weak boundaries and extract the objects of interest with different initial contours on the synthetic image. Moreover, starting from the four initial contours, the proposed K-GLIF model gives almost same segmentation results and thus it is robust to initial contours. The parameters setting of the K-GLIF model are w = 0.01, v = 0.002 × 2552 and that of the LBF model are λ1 = λ2 = 1, v = 0.001 × 2552 and σ = 3.

Fig. 3
figure 3

Segmentation results on a synthetic image. The upper row: the initial contours. The middle row: the segmentation results of LBF model. The lower row: the segmentation results of the proposed method

4.3 Medical images segmentation

The non-linearity of intensity distribution often occurs in medical images, such as the five images shown in Fig. 4. The first column shows initial contours in medical images, the middle column demonstrates the segmentation results using the LSACM, and the last column shows the segmentation using the K-GLIF model. In the brain MR image, the segmentation result using LSACM is very smooth, resulting in the loss of the edge information of the brain whiter matter, the K-GLIF model captures more details in edge-region and detects the contour of brain. The object of medical images in second and third row is obvious, it can be seen from segmentation results that the proposed model is more accurate than LSACM, and the segmentation curve is closer to the real object contour. The fourth and fifth row are two blood vessel images with intensity inhomogeneity. We can observe that the segmentation curve of K-GLIF model is smoother than that of LSACM, and there is no phenomenon that background is mis-divided into object. In the experiment, we use the parameters w = 0.5, v = 0.05 × 2552 for the first three images in the K-GLIF model and w = 0.1, v = 0.01 × 2552 for the other images in the K-GLIF model, the LSACM use the optimal parameter σ = 2.5 for the forth image and σ = 6 for the other images.

Fig. 4
figure 4

Segmentation results on medical images using LSACM and the K-GLIF model. The first column: the initial contours. The middle column: the segmentation results of LSACM. The last column: the segmentation results of K-GLIF model

In addition, the iteration numbers and computation time of LSACM and K-GLIF model in experiment are given in Table 1 for five medical images displayed in Fig. 4. Our model requires less iteration numbers and computation time than LSACM. Considering both accuracy and computation efficiency, the K-GLIF model has better segmentation performances than LSACM.

Table 1 Iterations and CPU time(s) by LSACM and K-GLIF model for medical images

4.4 Multi-object images segmentation

Besides the segmentation of images with inhomogeneous intensity and noisy images, multi-object segmentation is also a great difficulty for the level set method. By utilizing both local and global information, the K-GLIF model provides some effectiveness on multi-object images segmentation and it obtains higher accuracy than other models. In Fig. 5a, the intensity of some objects is higher than the background intensity and that of others objects is lower than the background intensity. The initial contour in original image is shown in Fig. 5b. Figure 5c and e are the segmentation results of the CV model and the LCV model. It can be seen that the two low intensity circles are missed. Figure 5d is the result of the LBF where the result is of slight over-segmentation. Figure 5f is the result of the proposed K-GLIF model, where all the six circles are successfully segmented. The K-GLIF model use the parameters setting w = 0.05 and v = 0.003 × 2552, and the parameters in the CV model and the LCV model are λ1 = λ2 = 1 and v = 0.003 × 2552, which are tuned to achieve the best results. The parameters setting of the LBF model are λ1 = λ2 = 1, v = 0.003 × 2552 and σ = 3.

Fig. 5
figure 5

Segmentation results on multi-object image using CV, LBF, LCV and the K-GLIF models. a original image b initial contour c CV model d LBF model e LCV model f K-GLIF model

In Fig. 6, we further illustrate of the segmentation effect of the CV, LBF, LCV and K-GLIF models for multiple small objects with slight inhomogeneous intensity. The initial contour in original image is shown in Fig. 6b and c–f are segmentation results. It can be seen that the CV fails to detect edge objects at the bottom of the image, the result of the LBF model contains redundant contours. The result of the LCV model is similar to that of CV model, where the edge objects at the top of the image and the right of the image are not closed and the bottom of objects are not fully segmented. Differently, the K-GLIF model can overcome the above phenomenon and accurately extracts all small objects in the image. In the experiment, we use the parameters w = 0.1 and v = 0.001 × 2552 in the K-GLIF model. The CV and LCV models use the optimal parameters λ1 = λ2 = 1, v = 0.001 × 2552. The LBF model uses the parameters λ1 = λ2 = 1, v = 0.001 × 2552 and σ = 3.

Fig. 6
figure 6

Segmentation results on multi-object image using CV, LBF, LCV and the K-GLIF models. a original image b initial contour c CV model d LBF model e LCV model f K-GLIF model

4.5 Natural images segmentation

We compared our model with the CV, LBF and LCV models based on Berkeley Segmentation Dataset (BSD300) [1]. The BSD300 consists of a number of natural images. More than 120 images are selected from dataset in the experimental, and the segmentation results of 5 natural images (Image ID: 86016, 135,069,163,014, 42,049, 317,080) are shown in Fig. 7. The original images and ground truth are shown in Fig. 7a–b and the segmentation results of CV, LBF, LCV and the K-GLIF are shown in Fig. 7c–f. It can be seen that the proposed model has more closer segmentation results than other models.

Fig. 7
figure 7

Segmentation results on natural images using CV, LBF, LCV and the K-GLIF models. a original image b ground truth c CV model d LBF model e LCV model f K-GLIF model

4.6 Infrared images segmentation

In order to verify the superiority of the K-GLIF model, a comparison is performed between it and the other three models: the CV, LBF model and LCV models. Infrared images of size 320 × 240 are derived from the OTCBVS Benchmark Dataset [18]. In experiments, the CV and LCV models use the optimal parameters: λ1 = λ2 = 1, v = 0.01 × 2552. The LBF model uses the optimal parameters: λ1 = λ2 = 1, v = 0.001 × 2552 and σ = 3. The K-GLIF model use the parameters w = 0.6, v = 0.06 × 2552 for the infrared data1 and w = 0.5, v = 0.5 × 2552 for the infrared data2 and data3.

In the infrared data1 and data2, the object and background are relatively complex, and some pixels in background are similar to that in object in intensity, as shown in Figs. 8a and 9a. The initial contours in the original images are shown in Figs. 8b and 9b. It can be seen that only the K-GLIF model can successfully extract the object and the object’s edges in the segmentation results using the K-GLIF model are smoother and more accurate, as shown in Figs. 8f and 9f. The other models fail to give satisfactory results.

Fig. 8
figure 8

The comparison of infrared data1 segmentation. a original image b initial contour c CV model d LBF model e LCV model f K-GLIF model

Fig. 9
figure 9

The comparison of infrared data2 segmentation. a original image b initial contour c CV model d LBF model e LCV model f K-GLIF model

In the infrared data3, the background is complex and there is obvious interference, as shown in Fig. 10a. It is difficult for both the CV model and the LCV model to separate the object from the background due to strong interference, as shown in Fig. 10c and e. The result of the LBF model is also unsatisfactory, as shown in Fig. 10d. Differently, the K-GLIF model gives a satisfactory result without misclassification and over-segmentation, as shown in Fig. 10f.

Fig. 10
figure 10

The comparison of infrared data3 segmentation. a original image b initial contour c CV model d LBF model e LCV model f K-GLIF model

Finally, the two measures, F-measure (FM) and Localization-error (LE) [3, 5] are used to evaluate the segmentation results of different models on the three infrared images. As shown in Fig. 11, which segmentation results FP given by the different model and standard results FN given by the ground truth. FM and LE are given by:

Fig. 11
figure 11

The schematic diagram of evaluation measure

$$ FM=2 TP/\left(2 TP+ FP+ FN\right) $$
(20)
$$ LE=\left( FN+ FP\right)/\left( TP+ TN+ FP+ TN\right) $$
(21)

A higher FM score means that a model is more accurate. Meanwhile, a small LE score means that the localization error is small and the segmentation result is better. Scores in Tables 2 and 3 show that the K-GLIF model obtains competitive performance in comparison with the other three models.

Table 2 FM scores of four models
Table 3 LE scores of four models

5 Discussion

5.1 The parameters w and v

In this paper, the parameter w is weighting parameter (0 ≤ w ≤ 1), which controls the proportion of the global intensity fitting term and the local intensity fitting term. When the intensity of the image is inhomogeneous, the local intensity fitting should play a leading role, in order to obtain satisfactory segmentation result, we can use relatively smaller w as the weight of local intensity. Thus, the image evolution energy can accurately drive the evolution curve to capture the local information, and finally converge to object boundary. For the image with minor inhomogeneity, we should choose larger w as the weight global parameter, the global energy allows the curve to rapidly evolve to the area near the object, and not be affected by the location of initial contour, then the local energy is able to attract the curve to the edge of the object. The length controlling parameter v is formatted by v = λ × 2552, λ ∈ (0, 1). When v is large, large-size objects are detected; when v is small, then small-size objects are detected.

5.2 Effect of the new regularization term

The regularization term defined in Eq. (16) is necessary in the K-GLIF model, which contains the energy penalty term about level set function and the length penalty term. Without the penalty term, the level set function grows to very large values (positive or negative) on the interior and exterior of zero level set. The function will lose the character of the signed distance function, which results errors in the computation for the numerical solution to the evolution equation and eventually affect the accuracy of final segmentation results. We use the new double-well potential function based on polynomial function to avoid the re-initialization of the level set function in the paper. The new double-well potential function not only avoids side effects that occur in the traditional function, but also offers appealing theoretical and numerical property of the level set evolution.

Double-well function p2(s), the first derivative \( {p}_2^{\prime }(s) \) and function dp2(s) are plotted in Fig. 12, we can observe that dp2(s) satisfies the following relationship \( \underset{s\to 0}{\lim }{d}_{p2}(s)=\underset{s\to \infty }{\lim }{d}_{p2}(s)=1 \) and |dp2(s)| < 1.

Fig. 12
figure 12

The function curve of p2(s), \( {p}_2^{\prime }(s) \) and dp2(s)

If |∇ϕ| > 1, dp2(|∇ϕ|) is positive and diffusion is forward so as to decrease the |∇ϕ|.

If |∇ϕ| < 0.5, dp2(|∇ϕ|) is positive and diffusion is forward so as to decrease the |∇ϕ| down to zero.

If 0.5 < |∇ϕ| < 1, dp2(|∇ϕ|) is negative and diffusion is backward so as to increase the |∇ϕ|.

6 Conclusions

In this paper, a new region-based active contour model based on kernel function for image segmentation is proposed. Due to the generalized Gaussian kernel function in the weighted intensity fitting term, the intensity information in local regions is extracted to guide the motion of the contour, which enables the proposed method to effectively segment images with inhomogeneous intensity and smooth noise. The experiments on synthetic images, medical images, multi-object images, natural and infrared images have demonstrated that the K-GLIF model can provide desirable segmentation results and allow for more flexible localizations of initial contour in comparison with the CV, LCV, LSACM and LBF models.