Local adaptive image segmentation method with deviation domain and computer program product
By introducing grayscale deviation domain and weight matrix function in image segmentation, the problem that traditional models cannot segment grayscale uneven images is solved, and accurate segmentation of grayscale uneven images is achieved, eliminating the influence of grayscale unevenness. Achieve ideal segmentation effect.
Patent Information
- Application Number
- CN202411440401.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2024-11-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional region-based active contour models cannot accurately segment images with uneven grayscale.
By initializing the level set function, the grayscale deviation domain of the image is calculated, the weight matrix function with the deviation domain is introduced, the deviation domain is updated using the grayscale mean inside and outside the Gaussian window, and the grayscale inhomogeneity influence is eliminated through the iterative process, and finally the stability is achieved The horizontal set function to implement image segmentation.
Accurate segmentation of grayscale uneven images is achieved, the influence of grayscale unevenness on image segmentation is eliminated, and an ideal segmentation effect is obtained.
Smart Images

Figure CN118967705A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image data processing, and in particular, relates to a local adaptive image segmentation method with a deviation domain and a computer program product. Background Art
[0002] Image segmentation refers to the process of dividing an image into several regions with similar properties. From a mathematical point of view, image segmentation is the process of dividing an image into non-intersecting regions. The active contour model is a hot topic in the current research field of image segmentation algorithms. It has shown certain advantages in segmenting complex images such as those with blurred edges, heterogeneous intensity, and noise. Therefore, the active contour model has been widely used in the field of image segmentation, and research on it has also achieved certain results.
[0003] The region-based active contour model is a grayscale image segmentation method that is often used in the medical field. It obtains the boundary of the target through the evolution of closed curves. The traditional region-based active contour model assumes that the pixel grayscale values in the same region are equal or similar, while the pixel grayscale values in different regions are significantly different. This model can obtain good segmentation results for most medical grayscale images, but it cannot accurately evolve to the target boundary for images with uneven grayscale. Summary of the invention
[0004] The object of the present invention is to provide a local adaptive image segmentation method with a deviation domain and a computer program product to solve the problem that the traditional region-based active contour model cannot accurately segment grayscale non-uniform images.
[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions to achieve the above problems: In one aspect, the present invention provides a local adaptive image segmentation method with a bias domain, comprising: Initialize the level set function ; Calculate the input image I = I(x) The grayscale deviation of each sub-region constitutes the entire input image I The initial deviation domain b ;in, x Represents a point on the image domain Ω; Perform the following iterative process: Calculate the input image I The grayscale mean of the two parts inside and outside the curve divided by the active contour curve , : ; ; in, for Heaviside Step function; Calculate the grayscale mean of the real image corresponding to the inner and outer images of the Gaussian curve in the Gaussian window j 1 , j 2 : ; in, is the Gaussian kernel function, ; Using the calculated grayscale mean j 1 , j 2 , update the deviation domain b : ; Using the calculated grayscale mean j 1 , j 2 and the updated deviation domain b Compute smooth functions I LAW : ; Calculate the weight matrix function ω: ; Update the level set function using the following formula : ; in, for Dirac Function, indicating The derivative of represents the curvature of the level set; In the level set function When it tends to be stable, the iteration process ends and the final active contour curve is obtained.
[0006] In some embodiments of the present application, the initial deviation domain b The calculation process may include: The entire input image I Divided into several sub-areas; Calculate the deviation between the grayscale value of each pixel in each sub-region and the grayscale value of the real image in the sub-region to form the entire input image I Initial grayscale deviation domain b .
[0007] In some embodiments of the present application, the grayscale value of the real image in each sub-region may be represented by the grayscale mean value of the sub-region.
[0008] In some embodiments of the present application, the step function can be configured .
[0009] In some embodiments of the present application, the level set function is determined The stabilization process can include: Preset a precision value Q ; If the level set function calculated in this iteration The level set function calculated in the previous iteration Satisfy the conditions , then the level set function is considered If the value is stable, the iteration process ends; otherwise, the iteration process continues.
[0010] In another aspect, the present invention further proposes a computer program product, including a computer program or instructions, which, when executed by a processor, can implement the steps of the above-mentioned local adaptive image segmentation method with a deviation domain.
[0011] Compared with the prior art, the advantages and positive effects of the present invention are mainly reflected in: 1. The present invention redefines a local adaptive weight function containing image deviation domain information by quantitatively representing image grayscale inhomogeneity, and unifies the inhomogeneity information obtained by constraint estimation with the grayscale inhomogeneity of the actual segmented image, thereby achieving accurate segmentation of grayscale inhomogeneous images; 2. The present invention uses a local adaptive weight function to represent the grayscale inhomogeneity within the neighborhood of an image pixel point, and separates the grayscale deviation domain from the input image by dividing the input image into the grayscale inhomogeneity and the real image and performing iterations respectively, thereby eliminating the influence of grayscale inhomogeneity on image segmentation.
[0012] Other features and advantages of the present invention will become more apparent after reading the detailed description of the embodiments of the present invention in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 It is an overall flow chart of an embodiment of the local adaptive image segmentation method with deviation domain proposed by the present invention; Figure 2 It is the result of segmenting an image with uneven grayscale using the traditional active contour image segmentation method based on level sets; Figure 3 The image segmentation method of the present invention is used to Figure 2The segmentation result of the same image with uneven grayscale in . DETAILED DESCRIPTION
[0014] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0015] The active contour model completes image segmentation by minimizing the energy functional. Its basic energy functional can be expressed as: ; In the formula, I = I(x) represents the input image, x Represents a point on the image domain Ω; and Represents the input image I Active Contour Curve C Divided into two parts: inner and outer; , Represents the input image I Active Contour Curve C The grayscale mean of the two parts inside and outside the curve; L(C) represents the active contour curve C Length; Represents the proportion of the length constraint term, which is used to regularize the evolution curve C , ensuring that a sufficiently short curve is obtained.
[0016] Introducing the level set function and Heaviside Step function Afterwards, the above basic energy functional can be rewritten as: ; In the formula, express The gradient of .
[0017] Among them, the level set function It is a mathematical tool used to describe specific level sets (i.e., point sets with constant function values) on high-dimensional function surfaces. These level sets can represent low-dimensional curves or surfaces. The core idea of the level set method is to transform the low-dimensional evolution curve or surface problem into the evolution problem of a high-dimensional function, and indirectly describe the movement of the low-dimensional curve by solving the evolution equation of the high-dimensional function. This method is particularly suitable for dealing with problems with complex topological changes, such as image segmentation and fluid simulation in computer graphics. Solve the level set function , that is, the active contour curve is obtained C .
[0018] The gradient descent flow formula of the level set function can be expressed as: ; in, yes Dirac Function, indicating The derivative of represents the curvature of the level set. Therefore, the above formula can be transformed into: ; In the above formula, c 1 and c 2 The calculation formula is: (1).
[0019] It can be seen from the above gradient descent flow formula of the level set function that the level set function The evolution direction of is determined by the hard threshold (c1+c2) / 2, so it cannot effectively segment images with uneven grayscale.
[0020] In order to achieve accurate segmentation of images with uneven grayscale, this embodiment introduces a weight matrix function ω with a deviation domain to replace the hard threshold, and the weight coefficient can be adaptively valued according to the grayscale information in the neighborhood of the pixel point. Therefore, the gradient descent flow formula of the level set function can be rewritten as: (2).
[0021] In order to separate the grayscale unevenness of the image and obtain the real image, this embodiment first quantifies the grayscale unevenness of the image and converts the input image I (The image to be segmented) is represented as: I = b·j ; In the above formula, j Represents a real image; b Representing images I The grayscale non-uniformity of the image IThe entire image is composed of the grayscale deviations of each sub-region of the real image I deviation domain.
[0022] The weight matrix function ω with deviation domain is adaptively valued according to the local grayscale inhomogeneity characteristics around the pixel point: (3); in, I LAW represents a smooth function, which is bj 1 and bj 2 The weighted mean of is expressed as: (4); In the formula, j 1 and j 2 are the grayscale means of the real images corresponding to the images inside and outside the Gaussian curve in the Gaussian window; is the Gaussian kernel function; σ is the width function, which controls the radial range of the function; * represents the convolution operation.
[0023] It can be seen from formula (3) that: I LAW near When , the ω value becomes smaller, so that the The weight value becomes larger.
[0024] In formula (4), b and j 1 , j 2 The calculation formulas can be expressed as: (5); (6); in, .
[0025] In the process of curve evolution, by I Grayscale Non-uniformity b and real images j Iterate separately to eliminate the grayscale inhomogeneity on the image I The influence of , finally get a stable level set function , that is, the final active contour curve is obtained C , thus completing the image I of segmentation.
[0026] Combination Figure 1As shown, the specific implementation process includes: S101. Initialize the level set function .
[0027] Level Set Function This is prior art and will not be described in detail in this embodiment.
[0028] S102, calculating input image I Initial grayscale deviation domain b .
[0029] That is, calculate the input image I The grayscale deviation of each pixel in each sub-region of the image and the real image in the sub-region constitutes the entire input image I Initial grayscale deviation domain b .
[0030] Here, the grayscale value of the real image in the sub-region can be represented by the grayscale mean value of the sub-region.
[0031] S103, calculate grayscale mean c 1 , c 2 .
[0032] In this embodiment, the grayscale mean can be calculated using the above formula (1): c 1 , c 2 .
[0033] S104, calculating the grayscale mean of the real image corresponding to the inner and outer images of the Gaussian curve in the Gaussian window j 1 , j 2 .
[0034] In this embodiment, the grayscale mean can be calculated using the above formula (5): j 1 , j 2 .
[0035] It can be seen from formula (5) that the integral operation in formula (5) is to integrate the entire image domain, that is, to traverse all Gaussian windows.
[0036] S105, using the calculated grayscale mean j 1 , j 2 , update the grayscale deviation domain b .
[0037] In this embodiment, the updated grayscale deviation domain can be calculated using the above formula (6): b .
[0038] S106, according to the calculated grayscale mean c 1 , c 2 , j 1 , j 2 And the updated grayscale deviation domain b , determine the weight matrix function ω.
[0039] In this embodiment, the weight matrix function ω can be calculated using the above formulas (3) and (4).
[0040] S107, according to the calculated grayscale mean c 1 , c 2 and weight matrix function ω, update the level set function .
[0041] In this embodiment, the updated level set function can be calculated using the above formula (2): .
[0042] Determine the level set function Whether it tends to be stable, if it tends to be stable, the iteration process ends; otherwise, return to process S103 to continue iteration.
[0043] In this embodiment, a precision value can be preset Q , if the level set function calculated in this iteration The level set function calculated in the previous iteration Satisfy the conditions , then the level set function is considered When the iteration process becomes stable,
[0044] S109, output the final level set function .
[0045] The final level set function This is the active contour curve finally determined. C, That is, the target boundary, thereby completing the segmentation of the input image I.
[0046] The image segmentation results can be found in Figure 2 , Figure 3 .in, Figure 2 This is the result of segmenting an image with uneven grayscale using the traditional active contour image segmentation method based on level sets; Figure 3 The figure shows the result of segmenting the same image with uneven grayscale using the local adaptive image segmentation method with deviation domain proposed in this embodiment. By comparison, it can be seen that the image segmentation method of this embodiment can also accurately evolve to the target boundary for the image with uneven grayscale, and obtain an ideal segmentation effect.
[0047] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for a person skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to replace some of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions claimed to be protected by the present invention.
Claims
1. A local adaptive image segmentation method with bias domain, It is characterized in that include: Initialize the level set function ; Calculate the input image I = I(x) The grayscale deviation of each sub-region constitutes the entire input image I The initial deviation domain b ; in, x Represents a point on the image domain Ω; Perform the following iterative process: Calculate the input image I The grayscale mean of the two parts inside and outside the curve divided by the active contour curve , : ; ; in, for Heaviside Step function; Calculate the grayscale mean of the real image corresponding to the inner and outer images of the Gaussian curve in the Gaussian window j 1 , j 2 : ; in, is the Gaussian kernel function, ; Using the calculated grayscale mean j 1 , j 2 , update the deviation domain b : ; Using the calculated grayscale mean j 1 , j 2 and the updated deviation domain b Compute smooth functions I LAW : ; Calculate the weight matrix function ω: ; Update the level set function using the following formula : ; in, for Dirac Function, indicating The derivative of represents the curvature of the level set; In the level set function When it tends to be stable, the iteration process ends and the final active contour curve is obtained.
2. The local adaptive image segmentation method with bias domain according to claim 1, It is characterized in that The initial deviation domain b The calculation process includes: The entire input image I Divided into several sub-areas; Calculate the deviation between the grayscale value of each pixel in each sub-region and the grayscale value of the real image in the sub-region to form the entire input image I Initial grayscale deviation domain b .
3. The local adaptive image segmentation method with bias domain according to claim 2, It is characterized in that The grayscale value of the real image in the sub-region is represented by the grayscale mean value of the sub-region.
4. The local adaptive image segmentation method with bias domain according to claim 1, It is characterized in that The step function .
5. The local adaptive image segmentation method with bias domain according to any one of claims 1 to 4, It is characterized in that Determine the level set function The stabilization process includes: Preset a precision value Q ; If the level set function calculated in this iteration The level set function calculated in the previous iteration Satisfy the conditions , then the level set function is considered If the value is stable, the iteration process ends; otherwise, the iteration process continues.
6. A computer program product comprising a computer program or instructions, It is characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Multi-scale local statistic active contour model (LSACM) level set image segmentation method
CN106530314A
Adaptive active contour segmentation model based on local energy pressure driving
CN110738680A
