# An Image Segmentation Method Using an Active Contour Model Based on Improved SPF and LIF
## 3 Proposed Method
### Algorithm Steps  
The procedures of image segmentation are illustrated in Figure 1.  
Figure 1: The graphical process of image segmentation.  
After the abovementioned image segmentation algorithm has been applied, an improved SPF and LIF-based image segmentation (SPFLIF-IS) algorithm using ACM can be implemented and described as Algorithm 1, which is summarized as follows.  
```
Input: An original image Output: The result of image segmentation Step 1: Initialize the level set function \(\phi\), and set the coefficients \(\Delta t\), \(n\), and \(\varepsilon\). Step 2: Calculate the Heaviside function and the Dirac delta function using Equations (9) and (10), respectively. Step 3: For\(n=1\): iterNum // iterNum is the total number of iterations. Step 4: Compute \(c_{1}\) and \(c_{2}\) by Equations (7) and (8), respectively, and obtain\(f\) according to Equation (18). Step 5: Calculate \(spf(l(x))\), according to Equation (19), and obtain the level set evolution equation by Equation (20). Step 6: Introduce the LIF model. Step 7: Calculate the weight coefficient \(\lambda\) using Equation (23). Step 8: Calculate the level set evolution equation using Equation (22). Step 9: If the evolution of the curve is stable, then output the segmentation result. Else, return to Step 4. Step 10: End for
```  
**Algorithm 1. SPFLIF-IS**  
It is well known that convolution operations are the most time-consuming with respect to the time complexity of an algorithm. Therefore, it is necessary to explain the complexity of the convolution operation. When an algorithm requires a convolution operation, the time cost is approximately \(O(n^{2}\times N)\)[46], where \(N\) is the image size and \(n\) is the Gaussian kernel. The values of \(N\) are greater than \(n^{2}\).  
Because the C-V model [34] must be reinitialized in every iteration, its time cost is very high, and the computational complexity is \(O(N^{2})\)[31]. The LBF model [24] usually needs to perform four convolution operations in each iteration, which greatly increases the computational time complexity. This situation indicates that the time complexity is \(O(itr\times 4\times n^{2}\times N)\), where the parameter \(itr\) is the number of iterations. In contrast, the SBGFRLS model [23] must perform three convolution operations, two of which are derived by gradient calculation (horizontal and vertical), and the other involves mask image and filter mask. Thus, the total computational complexity of the SBGFRLS model is \(O(itr\times 3\times n^{2}\times N)\). The LIF model [31] performs two convolution operations in each iteration. Thus, the total computational time required for the LIF model is \(O(itr\times 2\times n^{2}\times N)\). For the SPFLIF-IS algorithm, the computational complexity is mainly concentrated in Step 6. In Algorithm 1, Step 6 is the most time-consuming to calculate in the LIF model. The computational complexity of our proposed method is \(O(itr\times 2\times n^{2}\times N)\), where \(n\) is the size of the Gaussian kernel function and \(N\) is the image size. Since in most cases, \(N>>n^{2}\), the complexity of SPFLIF-IS is \(O(N)\) approximately, which is close to that of the LIF model in [31]. It follows that our proposed method is much more computationally efficient than the C-V model [31], the LBF model [24], and the SBGFRLS model [23]. Because the SPFLIF-IS algorithm decreases the number of Gaussian convolution operations required, its time costs and number of iteration operations are drastically reduced. Therefore, the computational complexity of our SPFLIF-IS method is lower than that of the other related ACMs [6; 8; 11; 12; 15; 17; 20; 23; 24; 31; 34; 43].