An image segmentation method based on active contour model of K-medoids clustering
Through the K-medoids clustering algorithm and adaptive regularization function, the problem of low efficiency and poor accuracy in the existing technology is solved, and efficient and stable image segmentation effect is achieved.
Patent Information
- Application Number
- CN202310464822.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-26
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2043-04-26
AI Technical Summary
In the prior art, when performing image segmentation based on the contour model, there are problems of low efficiency and poor segmentation accuracy.
The K-medoids clustering algorithm is used to binarize the segmented images, and the pre-segment fitting function is constructed. The zero-level set replacement profile curve that satisfies the Lipschitz condition is used to combine the gradient descent method and the adaptive regularization function to minimize the energy functional, and the curve is smoothed and shortened by regularizing the zero-level set function, and the segmentation result is output.
It greatly improves the calculation speed, reduces the calculation cost, improves the image segmentation efficiency and accuracy, enhances the system's robustness and noise interference resistance, and ensures the stability and accuracy of the segmentation results.
Smart Images

Figure CN116596951B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an active contour model image segmentation method and device based on K-medoids clustering, and a computer-readable storage medium. Background Art
[0002] The most commonly used method in the field of image segmentation is the active contour model, which essentially uses a continuous and closed curve to represent the target boundary and defines an energy functional so that its independent variable includes the edge curve. Therefore, the image segmentation process is transformed into a process of solving the minimum value of the energy functional. The location where the energy reaches the minimum value is the contour of the target.
[0003] Active contour models are divided into two categories based on the curve's representation: parametric active contour models and geometric active contour models. Parametric active contour models are based on the Lagrange framework and directly represent curves in their parameterized form. These models have been successfully applied in the early stages of biological image segmentation, but they suffer from shortcomings such as susceptibility to initial contour settings and difficulty handling changes in the curve's topological structure. Furthermore, their energy functionals depend solely on the choice of curve parameters and are independent of the object's geometry, which limits their further application and development. Furthermore, the curve evolution process in geometric contour models is based on the curve's metric parameters rather than its representation parameters, making them better able to handle topological changes. These models also offer advantages such as insensitivity to initial position and stable numerical solutions. Geometric active contour models are categorized into edge-based, region-based, and hybrid active contour models based on their evolutionary approach. However, these models share common drawbacks, such as slow computational speed, low efficiency, poor segmentation accuracy, sensitivity to initial contours, poor system robustness, and poor noise immunity. Summary of the Invention
[0004] Therefore, the technical problem to be solved by the present invention is to overcome the problems of low efficiency and poor segmentation accuracy in the prior art when performing image segmentation based on a contour model.
[0005] To solve the above technical problems, the present invention provides an active contour model image segmentation method based on K-medoids clustering, comprising:
[0006] The K-medoids clustering algorithm is used to perform binarization processing on the segmented image to obtain the fitting result and obtain the foreground image and background image;
[0007] Construct a pre-segmented fitting function based on the binarized fitting results;
[0008] The contour curve of the pre-segment fitting function is replaced by a zero level set satisfying the Lipschitz condition to obtain a KM pre-segment fitting function;
[0009] Using the gradient descent method, the energy functional of the KM pre-segment fitting function is minimized to obtain the gradient flow equation;
[0010] Regularizing a data-driven term of the gradient flow equation using an adaptive regularization function;
[0011] The zero level set function is regularized using a rulesig function, the regularized zero level set function is smoothed and a curve is shortened using a kernel function, and the level set function is output as a segmentation result of the image to be segmented.
[0012] In one embodiment of the present invention, the step of using the k-medoids clustering algorithm to perform binarization processing on the segmented image to obtain a fitting result and acquire a foreground image and a background image includes:
[0013] Randomly select k pixels in the image to be segmented as the initial representative pixels ;
[0014] Assign the remaining pixels to the cluster where the representative pixel with the value closest to itself is located;
[0015] Randomly select a non-representative pixel , calculate non-representative pixels Instead of representing pixels The resulting cost function ;
[0016] If the cost function , then use replace , forming a new set of k representative pixels; otherwise, retaining the original set of k representative objects;
[0017] Repeat the allocation of the remaining pixels until the clustering result no longer improves, and obtain two clusters, representing the set C of all pixels in the foreground image. l and the set C of all pixels of the background image s ;
[0018] Among them, the cost function Expressed as:
[0019] ,
[0020] Where k=2, It is a non-representative object in the new set of k representative pixels. It is a non-representative object in the original set of k representative objects. It represents the object. is the clustering result before replacement, is the clustering result after replacement.
[0021] In one embodiment of the present invention, the pre-segmented fitting function is constructed based on the binarized fitting result, which is expressed as:
[0022] ;
[0023] in, Represents the intensity of the image to be segmented at point x; Represents the contour curve of the pre-segmented fitting function; represents the background point set, Represents the foreground point set.
[0024] In one embodiment of the present invention, the contour curve of the pre-segment fitting function is replaced by the zero level set that satisfies the Lipschitz condition to obtain the KM pre-segment fitting function, which is expressed as:
[0025] ,
[0026] in, represents the zero level set that satisfies the Lipschitz condition; ;ε is a constant, and its value is 1; Represents the image domain of the image to be segmented.
[0027] In one embodiment of the present invention, the gradient descent method is used to minimize the energy functional of the KM pre-segment fitting function to obtain a gradient flow equation, which is expressed as:
[0028] ,
[0029] in, For traditional data-driven items, , ;
[0030] Simplifying the gradient flow equation, we get:
[0031] ,
[0032] Among them, optimize data-driven items , approximate Dirac function ; Is a signed constant used to adjust the evolution speed and direction of the evolution curve. If the segmentation target in the image to be segmented is the white part, The sign of is negative; otherwise, The sign of is positive.
[0033] In one embodiment of the present invention, regularizing the data-driven term of the gradient flow equation using an adaptive regularization function includes:
[0034] Based on the K-medoids clustering algorithm, the gradient flow equation is rewritten to obtain:
[0035] ,
[0036] in, is the signed model running speed adjustment coefficient. If the segmentation target in the image to be segmented is white, then , otherwise, ; The standard deviation of the image ; Wherein, the adaptive regularization function for:
[0037] ; η represents the integral variable.
[0038] In one embodiment of the present invention, regularizing the zero level set function with a rulesig function comprises:
[0039] The evolution formula of the zero level set function of the KM pre-segment fitting function is expressed as:
[0040] ,
[0041] Defining the regularization result of the zero level set function for: ;
[0042] in, .
[0043] In one embodiment of the present invention, the kernel function is used to smooth and shorten the curve of the regularized zero level set function, and the output level set function is expressed as:
[0044] ,
[0045] Among them, the kernel function is a mean value filter template of size k×k.
[0046] The embodiment of the present invention further provides an active contour model image segmentation device based on K-medoids clustering, comprising:
[0047] The clustering module is used to perform binarization processing on the segmented image using the K-medoids clustering algorithm to obtain the fitting result and obtain the foreground image and background image;
[0048] A fitting module is used to construct a pre-segment fitting function based on the binarized fitting result; replace the contour curve of the pre-segment fitting function with a zero level set that satisfies the Lipschitz condition to obtain a KM pre-segment fitting function; and minimize the energy functional of the KM pre-segment fitting function using a gradient descent method to obtain a gradient flow equation;
[0049] A regularization output module is used to regularize the data-driven term of the gradient flow equation using an adaptive regularization function; regularize the zero level set function using a rulesig function, smooth and shorten the curve of the regularized zero level set function using a kernel function, and output the level set function as the segmentation result of the image to be segmented.
[0050] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the active contour model image segmentation method based on K-medoids clustering as described above are implemented.
[0051] The above technical solution of the present invention has the following advantages over the prior art:
[0052] The active contour model image segmentation method based on K-medoids clustering of the present invention utilizes a K-medoids clustering algorithm to fit the foreground and background of an image to be segmented before iteration, thereby significantly improving calculation speed, significantly reducing calculation cost, and improving image segmentation efficiency; a data-driven term is regularized by an adaptive regularization function, thereby improving the sensitivity of the data-driven term at a zero-crossing point, and improving the robustness and noise resistance of the system; a value range of a level set function is normalized by the regularization function to prevent the slope from being too large or too small, thereby completing the distance rule on both sides of the level set, improving the slope at the zero-crossing point of the level set, and accelerating the evolution process; the value range is normalized, thereby ensuring the stability of the evolution process and the accuracy of the segmentation result, making the evolution process more stable and the segmentation accuracy better. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below based on specific embodiments of the present invention in conjunction with the accompanying drawings, wherein
[0054] Figure 1 This is a flowchart of the steps of the active contour model image segmentation method based on K-medoids clustering provided by the present invention;
[0055] Figure 2 The first column is The second-order differential characteristic diagram of Figure 2 The second column is the function before regularization 2D graph, Figure 2The third column is the regularized function 3D graph;
[0056] Figure 3 This is a schematic diagram of the effect of the regularization function provided by the present invention. DETAILED DESCRIPTION
[0057] The present invention will be further described below with reference to the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it. However, the embodiments are not intended to limit the present invention.
[0058] Reference Figure 1 As shown, the active contour model image segmentation method based on K-medoids clustering of the present invention specifically comprises the following steps:
[0059] S101: Using the K-medoids clustering algorithm to perform binarization processing on the segmented image to obtain a fitting result, and obtaining a foreground image and a background image;
[0060] S102: Construct a pre-segmented fitting function based on the binarized fitting result, which is expressed as:
[0061] ,
[0062] in, Represents the intensity of the image to be segmented at point x; represents the background point set, represents the foreground point set;
[0063] S103: Using the zero level set that satisfies the Lipschitz condition to replace the contour curve of the pre-segment fitting function, a KM pre-segment fitting function is obtained, which is expressed as:
[0064] ,
[0065] in, represents the zero level set that satisfies the Lipschitz condition; ;ε is a constant, and its value is 1.
[0066] S104: using a gradient descent method, minimizing the energy functional of the KM pre-segment fitting function to obtain a gradient flow equation;
[0067] S105: Regularizing the data-driven term of the gradient flow equation using an adaptive regularization function;
[0068] S106: Regularizing the zero level set function using a rulesig function;
[0069] S107: Using a kernel function to smooth and shorten the curve of the regularized zero level set function, and outputting the level set function as a segmentation result of the image to be segmented.
[0070] Specifically, in step 101, the K-medoids clustering algorithm is applied. Its main idea is to first randomly select a representative object for each cluster and assign the remaining objects to the cluster with the closest Euclidean distance to the representative object based on their distance to the representative object. Then, the representative object is repeatedly replaced with non-representative objects to improve the quality of clustering. The clustering results are estimated using a cost function CF, which evaluates the average dissimilarity between the object and its reference object. In this embodiment of the present invention, k=2, and the corresponding cost function is defined as follows:
[0071] ,
[0072] in, It is a non-representative object in the new set of k representative pixels. It is a non-representative object in the original set of k representative objects. It represents the object. is the clustering result before replacement, is the clustering result after replacement.
[0073] K-medoids clustering algorithm, specifically including:
[0074] S101-1: Randomly select k pixels as initial representative pixels ;
[0075] S101-2: Assign the remaining pixels to the cluster where the representative pixel with the value closest to the pixel itself is located;
[0076] S101-3: Randomly select a non-representative pixel , calculate non-representative pixels Instead of representing pixels The resulting cost function ;
[0077] S101-4: If the cost function , then use replace , forming a new set of k representative pixels; otherwise, retaining the original set of k representative objects;
[0078] S101-5: Repeat the allocation of the remaining pixels until the clustering result no longer improves, perform black and white binarization on the segmented image, and obtain two clusters, representing the set C of all pixels in the foreground image. l and the set C of all pixels of the background images .
[0079] The embodiment of the present invention innovatively uses the K-medoids clustering algorithm to cluster the foreground and background of the image to be segmented before iteration, and integrates the clustering results into the Euclidean distance to form an energy function, which saves running overhead time and improves image segmentation accuracy and efficiency.
[0080] Specifically, in step 104, the gradient flow equation is expressed as:
[0081] ,
[0082] in, For traditional data-driven items; , ;
[0083] Simplifying the gradient flow equation, we get: ,
[0084] Among them, optimize data-driven items , effectively reflects the boundary of the target object and reduces the interference of heterogeneity. Figure 2 As shown, Figure 2 The first column is the visualization experiment results. The results show that the fitting function represents the second-order differential characteristics of the image. The zero crossing of the data reflects the boundary points of the image, the white objects and the black objects. Just the opposite.
[0085] Approximate Dirac function ; Is a signed constant used to adjust the evolution speed and direction of the evolution curve. If the segmentation target in the image to be segmented is the white part, The sign of is negative; otherwise, The sign of is positive.
[0086] Specifically, in step S105, due to the diversity of image types, the contrast of each image is very different, so in the simplified gradient flow equation, the data-driven term is optimized. The values of are very different, resulting in poor robustness of the system, which increases the difficulty of the experiment. To this end, the data-driven item data needs to be normalized to improve the robustness of the system, while also improving the sensitivity of the data-driven item at zero crossings. To this end, the embodiment of the present invention designs a function with an adaptive function to normalize the optimized data-driven item in the simplified gradient flow equation, thereby rewriting the simplified gradient flow equation. Therefore, the present invention proposes the formula of an adaptive energy function based on K-medoids clustering as follows:
[0087] ;
[0088] in, It is a signed model running speed adjustment coefficient, which is used to adjust the model running speed to prevent over- and under-segmentation. If the segmentation target in the image to be segmented is white, then , otherwise, ; The standard deviation of the image ; Among them, the adaptive regularization function for:
[0089] ; η represents the integral variable.
[0090] This function can effectively normalize the value range and improve the sensitivity at zero crossings (boundary points). Figure 2 As shown, Figure 2 The second and third columns are the functions before regularization And the regularized function The 3D visualization of the energy adjustment is compared before and after the energy adjustment. Before the adjustment, although the target edge correctly reflects the differential characteristics of the boundary, its intensity is uneven. After the adjustment, the energy can provide a stable system environment and improve the robustness of the system. In addition, the second-order differential characteristics of the boundary are standardized and unified, and the boundary outline is clear.
[0091] And the embodiment of the present invention defines It is calculated before the iteration and has nothing to do with the iteration. Therefore, the KM model in this paper greatly saves the computational overhead. The iteration process only updates Different from the traditional active contour model, the fitting function in this paper is independent of the contour line, thus significantly improving the robustness of the initial contour.
[0092] Specifically, in steps S106 and S107, the evolution formula of the zero level set function of the KM pre-segment fitting function is expressed as:
[0093] ;
[0094] Different from the traditional model, the energy function of the present invention does not contain regularity term and length term function. Therefore, the present invention also uses a function to prevent the level set function Too steep or too flat, complete the distance rule on both sides of the level set, that is, increase the slope of the level set zero crossing area; then, Smoothing completes the traditional length term function:
[0095] Defining the regularization result of the zero level set function for: ; The purpose is to increase the slope of the zero-crossing region to ensure It has a strong regularization property, suppresses the slope at the high points at both ends, and reaches the level set function Regularization of
[0096] Define the output results of the level function set ; The purpose is to KM When minimized, the contour line will include all the dividing lines on the edge, but there will also be some redundant curves on non-edges. This formula is used to smooth and shorten the curves.
[0097] in, ; Kernel function is a mean value filter template of size k×k.
[0098] Reference Figure 3 As shown in the figure, it is a schematic diagram of the effect of the regularization function. The upper row is the 2D and 3D graphs of the image level set, and the lower row is the 2D and 3D graphs of the level set after regularization. The red line is the zero level set. The experimental results show that the data on both sides of the zero level set are stretched, so that the sensitivity at the zero point is improved. At the same time, The range of the function is limited to (-1,1), which makes the evolution process more stable and the segmentation results more accurate.
[0099] Based on the above embodiment, in this embodiment, an active contour model image segmentation device based on K-medoids clustering is provided, comprising:
[0100] The clustering module 100 is used to perform binarization processing on the segmented image using the K-medoids clustering algorithm to obtain a fitting result, thereby obtaining a foreground image and a background image;
[0101] The fitting module 200 is configured to construct a pre-segment fitting function based on the binarized fitting result; replace the contour curve of the pre-segment fitting function with a zero level set that satisfies the Lipschitz condition to obtain a KM pre-segment fitting function; and minimize the energy functional of the KM pre-segment fitting function using a gradient descent method to obtain a gradient flow equation.
[0102] The regularization output module 300 is used to regularize the data-driven term of the gradient flow equation using an adaptive regularization function; regularize the zero level set function using a rulesig function, smooth and shorten the curve of the regularized zero level set function using a kernel function, and output the level set function as the segmentation result of the image to be segmented.
[0103] The active contour model image segmentation device based on K-medoids clustering of this embodiment is used to implement the aforementioned active contour model image segmentation method based on K-medoids clustering. Therefore, the specific implementation method of the active contour model image segmentation device based on K-medoids clustering can be seen in the embodiment part of the active contour model image segmentation method based on K-medoids clustering in the previous text. For example, the clustering module 100 is used to implement step S101 in the above-mentioned active contour model image segmentation method based on K-medoids clustering; the fitting module 200 is used to implement steps S102, S103 and S104 in the above-mentioned active contour model image segmentation method based on K-medoids clustering; the regularization output module 300 is used to implement steps S105, S106 and S107 in the above-mentioned active contour model image segmentation method based on K-medoids clustering. Therefore, its specific implementation method can refer to the description of the corresponding embodiments of each part and will not be repeated here.
[0104] Based on the above embodiments, in this embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the active contour model image segmentation method based on K-medoids clustering as described above are implemented.
[0105] Specifically, executing the computer program includes:
[0106] Input: image to be segmented , set the maximum number of iterations N, model coefficient , ,w;
[0107] Output: Level set function and the image to be segmented The segmentation result of
[0108] S201: Using clustering algorithm to obtain the image to be segmented Foreground image With background image ;
[0109] S202: Compute Optimization Data-Driven Items The standard deviation value of the image to be segmented ;
[0110] S203: Calculate the gradient flow equation rewritten based on the K-medoids clustering algorithm ;
[0111] S204: Initialize zero level set function for:
[0112] ,
[0113] in, is the image domain A subset of yes the boundaries;
[0114] S205: for i ← 1 to N do
[0115] Update the approximate Dirac function ;
[0116] Update the evolution formula of the zero level set function
[0117] until , stop the iteration and output the current zero level set function ;
[0118] S206: Exploitation Get the level set function regularization result ;
[0119] S207: Calculate the level set function ;
[0120] S208: End, output And the segmentation results of the image to be segmented.
[0121] The present invention innovatively uses the K-medoids clustering algorithm to cluster the foreground and background of the image before iteration, and integrates the clustering results into the Euclidean distance to form an energy function, which saves running time and improves the image segmentation accuracy and efficiency. The present invention innovatively uses an adaptive regularization function Denormalizing traditional data-driven projects , thereby improving the sensitivity at the boundary points, and the regularized data-driven term makes the system more stable and robust; the present invention designs a gradient flow based on the above regularized data-driven term, and uses the gradient descent method to solve the location of the target contour. The present invention innovatively adopts an adaptive regularization function The level set function is denormalized to prevent its slope from being too large or too small, and the distance rule on both sides of the level set is completed. The slope at the zero point of the level set is increased to accelerate the evolution process. Its value range is normalized to [-1,1], ensuring the stability of the evolution process and the accuracy of the segmentation results.
[0122] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0123] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0124] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0125] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0126] Obviously, the above embodiments are merely examples for clarity of explanation and are not intended to limit the implementation methods. Those skilled in the art will appreciate that other variations or modifications can be made based on the above description. It is not necessary and impossible to enumerate all implementation methods here. Obvious variations or modifications arising therefrom remain within the scope of protection of the present invention.
Claims
1. An active contour model image segmentation method based on K-medoids clustering, characterized in that: include: Use the K-medoids clustering algorithm to binarize the image to be segmented to obtain the fitting result, and obtain the foreground image and background image, including: randomly selecting k pixels in the image to be segmented as the initial representative pixels ; Assign the remaining pixels to the cluster where the representative pixel with the value closest to itself is located; randomly select a non-representative pixel , calculate non-representative pixels Instead of representing pixels The resulting cost function ; If the cost function , then use replace , forming a new set of k representative pixels; otherwise, retain the original set of k representative objects; repeatedly assign the remaining pixels until the clustering result no longer improves, and obtain two clusters, representing the set C of all pixels of the foreground image. l and the set C of all pixels of the background image s ; Wherein, the cost function Expressed as: , where k=2, It is a non-representative object in the new set of k representative pixels. It is a non-representative object in the original set of k representative objects. It represents the object. is the clustering result before replacement, is the clustering result after replacement; The pre-segmented fitting function is constructed based on the binarized fitting results, which is expressed as: ,in, Represents the intensity of the image to be segmented at point x; Represents the contour curve of the pre-segmented fitting function; represents the background point set, Indicates the foreground point set; subscript Indicates the outer area of the contour curve, subscript Represents the area inside the contour curve; The contour curve of the pre-segment fitting function is replaced by the zero level set that satisfies the Lipschitz condition to obtain the KM pre-segment fitting function, which is expressed as: ,in, represents the zero level set that satisfies the Lipschitz condition; ;ε is a constant, and its value is 1; The image domain representing the image to be segmented; Using the gradient descent method, the energy functional of the KM pre-segment fitting function is minimized to obtain the gradient flow equation; Regularizing a data-driven term of the gradient flow equation using an adaptive regularization function; The zero level set function is regularized using the rulesig function, and the kernel function is used to smooth and shorten the curve of the regularized zero level set function. The level set function is output as the segmentation result of the image to be segmented.
2. The active contour model image segmentation method based on K-medoids clustering according to claim 1, characterized in that: The gradient descent method is used to minimize the energy functional of the KM pre-segment fitting function to obtain the gradient flow equation, which is expressed as: , in, For traditional data-driven items, , ; Simplifying the gradient flow equation, we get: , Among them, optimize data-driven items , approximate Dirac function ; Is a signed constant used to adjust the evolution speed and direction of the evolution curve. If the segmentation target in the image to be segmented is the white part, The sign of is negative; otherwise, The sign of is positive.
3. The active contour model image segmentation method based on K-medoids clustering according to claim 2, characterized in that: Regularizing the data-driven term of the gradient flow equation using an adaptive regularization function includes: Based on the K-medoids clustering algorithm, the gradient flow equation is rewritten to obtain: , in, is the signed model running speed adjustment coefficient. If the segmentation target in the image to be segmented is white, then , otherwise, ; The standard deviation of the image ; Wherein, the adaptive regularization function for: ; η represents the integral variable.
4. The active contour model image segmentation method based on K-medoids clustering according to claim 1, characterized in that: Regularizing the zero level set function with a rulesig function includes: The evolution formula of the zero level set function of the KM pre-segment fitting function is expressed as: , Defining the regularization result of the zero level set function for: ; in, .
5. The active contour model image segmentation method based on K-medoids clustering according to claim 4, characterized in that: The kernel function is used to smooth and shorten the curve of the regularized zero level set function, and the output level set function is expressed as: , Among them, the kernel function is a mean value filter template of size k×k.
6. An active contour model image segmentation device based on K-medoids clustering, characterized in that: include: The clustering module is used to use the K-medoids clustering algorithm to perform binarization processing on the image to be segmented to obtain the fitting result and obtain the foreground image and background image, including: randomly selecting k pixels in the image to be segmented as the initial representative pixels ; Assign the remaining pixels to the cluster where the representative pixel with the value closest to itself is located; randomly select a non-representative pixel , calculate non-representative pixels Instead of representing pixels The resulting cost function ; If the cost function , then use replace , forming a new set of k representative pixels; otherwise, retain the original set of k representative objects; repeatedly assign the remaining pixels until the clustering result no longer improves, and obtain two clusters, representing the set C of all pixels of the foreground image. l and the set C of all pixels of the background image s ; Wherein, the cost function Expressed as: , where k=2, It is a non-representative object in the new set of k representative pixels. It is a non-representative object in the original set of k representative objects. It represents the object. is the clustering result before replacement, is the clustering result after replacement; The fitting module is used to construct a pre-segmented fitting function based on the binarized fitting results, which is expressed as: ,in, Represents the intensity of the image to be segmented at point x; Represents the contour curve of the pre-segmented fitting function; represents the background point set, Indicates the foreground point set; subscript Indicates the outer area of the contour curve, subscript Represents the internal area of the contour curve; the contour curve of the pre-segment fitting function is replaced by the zero level set that satisfies the Lipschitz condition to obtain the KM pre-segment fitting function, which is expressed as: ,in, represents the zero level set that satisfies the Lipschitz condition; ;ε is a constant, and its value is 1; Representing the image domain of the image to be segmented; utilizing the gradient descent method to minimize the energy functional of the KM pre-segment fitting function to obtain the gradient flow equation; A regularization output module is used to regularize the data-driven term of the gradient flow equation using an adaptive regularization function; regularize the zero level set function using a rulesig function, smooth and shorten the curve of the regularized zero level set function using a kernel function, and output the level set function as the segmentation result of the image to be segmented.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the active contour model image segmentation method based on K-medoids clustering are implemented as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Image segmentation processing method and device
CN113139936A
Active contour model image segmentation method based on adaptive local pre-fitting energy function
CN114913192A