A multi-objective image segmentation system and method based on a BVFSnake model
By introducing a direction vector field into the BVFSnake model and correcting the inverse gradient vector in the force field, the accuracy problem of multi-object image segmentation is solved, and higher segmentation accuracy is achieved.
Patent Information
- Application Number
- CN202310462658.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-26
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2043-04-26
AI Technical Summary
The existing BVFSnake model is not accurate enough in multi-object image segmentation and cannot correctly segment multiple objects in complex images.
By introducing a direction vector field into the BVFSnake model, the inverse gradient vector in the force field is corrected, a fusion field is established, and the segmentation accuracy is improved.
It improves the accuracy of multi-object image segmentation, expands the application scope of the BVFSnake model, and enables it to better handle complex images.
Smart Images

Figure CN116486083B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image segmentation, and more particularly to a multi-target image segmentation method based on a BVFSnake model. BACKGROUND
[0002] At present, high-resolution imaging sonar has a good application prospect in seabed target recognition. When high-resolution imaging sonar is applied to seabed target recognition, image segmentation is a key step.
[0003] There are many image segmentation methods, among which the method based on the active contour model is concerned because it can obtain the continuous edge (boundary) of the target, and there are reports on the application of this method in sonar image segmentation. The related background of the active contour model is introduced below.
[0004] The traditional active contour model is also called Snake model. Its essence is a open or closed curve c(s) = [x(s), y(s)], s ∈ [0, 1] under the influence of internal force and external force, where s is the arc length parameter, the internal force mainly ensures the continuity and smoothness of the curve, and the external force guides the curve to converge to the target boundary. The following function is minimized to complete
[0005]
[0006] where E int is the internal force, and E ext is the external force.
[0007]
[0008] The internal force is composed of an α-controlled first-order term and a β-controlled second-order term, and α and β represent the elastic and rigid weight coefficients respectively. c'(s) and c''(s) represent the first and second derivatives of c(s) with respect to s, which mainly control the deformation of the curve.
[0009] E ext (x, y) = - |▽[G σ (x, y) * I(x, y)]| 2 (3)
[0010] where G σ (x, y) is a two-dimensional Gaussian function with a standard deviation, σ is the variance, ▽ is the gradient operator, * represents convolution, and I is the gray value of the image.
[0011] In order to obtain the minimum snake E Snake , according to the variational principle, the following Euler equation must be satisfied:
[0012] α|c′(s)| 2 -β|c″(s)|2 +▽E ext (s) = 0 (4)
[0013] To solve the Euler equation, the Snake is made dynamic by making c a function of time t and s, i.e. c(s,t). Then the partial derivative of c(s,t) with respect to t is set equal to the left side of equation (4) as follows:
[0014] c t (s,t) = a |c"(s,t)| 2 - β |c""(s,t)| 2 +▽E ext (s) (5)
[0015] When the solution c t (s,t) is stable, i.e. the above equation equals zero, the solution of equation (4) is obtained.
[0016] Although the Snake model has great significance, it is difficult to segment complex images because of its limited capture range and difficulty in converging to a concave boundary.
[0017] To solve the problem of limited capture range and difficulty in converging to a concave boundary of the traditional Snake model, Xu et al. proposed a Gradient Vector Flow (GVF). This model introduces a new external force as a new external force field instead of the external force F ext in the Snake model, which is a two-dimensional vector field v(s) = [u(s), v(s)] that minimizes the following objective function:
[0018]
[0019] where u x , u y are the derivatives of u with respect to x and y, respectively, v x , v y are the derivatives of v with respect to x and y, respectively, f is the edge map, μ is a regulation coefficient that controls the size of the first and second terms, and is set according to the noise level in the image, with a larger noise level requiring a larger μ, and ∇f is the gradient of the edge map.
[0020] Using the variational principle, the following equation is obtained:
[0021]
[0022] where ∇ 2 is the Laplacian operator.
[0023] It can be seen from equations (7) and (8) that the second terms of equations (7) and (8) are zero at the far distance from the object boundary because the image intensity I(x, y) is close to a constant and the edge map f(x, y) is close to zero. The diffusion process produces a certain counter force so that some vectors can act on the boundary of the concave region. This improves the shortcoming of the traditional Snake to some extent. However, the GVFs are generated iteratively, and the computation is very large.
[0024] To solve the problem of large computation of GVFs, K. W. Sum et al. proposed a boundary vector field (BVF) of parametric active contour. This external force is generated by a new interpolation scheme. By using the binary edge map F B (x, y), four potential functions Ψ x , Ψ y , Ψ xy and Ψ yx are independently generated by using row-wise interpolation in four independent scans, which are horizontal, vertical and two diagonal directions. The interpolation is completed by using two types of boundary points, which are object boundary B O and image boundary B I . The object boundary B O is defined as the boundary points indicated in the binary edge map, and the potential value of which is set to the normalized value of the edge map. The image boundary B I is defined as the extended boundary points of the image, and the potential value of which is set to zero. For example, the potential values of the object boundary points and the image boundary points are preset as follows:
[0025]
[0026] After the potential values of the boundary points are defined, the potential values of the non-boundary points are calculated by interpolation. Given the definition of the binary edge map, in the following three scenarios, all non-boundary points are surrounded by two boundary points B O or B I , no matter which scanning direction is encountered.
[0027] If a point is surrounded by an object boundary and an image boundary, the linear interpolation is used to estimate the potential value as follows:
[0028] Ψ(x, y) = (1 - δ)Ψ(x o , y o ) + δΨ(x i , y i ) (10)
[0029] where (x o , y o ) and (x i , y i) are the coordinates of the target boundary point and the image boundary point respectively, and δ ∈ [0, 1] is the step length to move the point from one boundary point to the other.
[0030] Two object boundaries or two image boundaries. In these scenarios, linear interpolation cannot be simply applied because the boundary boundary points have the same potential. The basis functions constructed on the unit interval are as follows:
[0031]
[0032] If a point is enclosed by two object boundaries B O1 and B O2 at (x o1 ,y o1 ) and (x o2 ,y o2 ) respectively, the potential value is defined as:
[0033]
[0034] If a point is enclosed by two object boundaries B O1 and B O2 at (x m ,y m ) and (x o1 ,y o1 ) respectively, the potential value is defined as: where (x o2 ,y o2 ) is the midpoint between (x i1 ,y i1 ) and (x i2 ,y i2 ). This midpoint is implanted in order to add nonlinearity in the originally flat potential function. Similarly, if a point is enclosed by two image boundaries B I1 and B I2 at (x m ,y m ) and (x i1 ,y i1 ) respectively, the potential value is defined as:
[0035]
[0036] where (x i2 ,y i2 ) is the midpoint between (x x ,y y ) and (x x ,y y ).midpoint between 0 and 1, and ω is a weight parameter, usually set to a non-zero positive value, in order to provide greater vector magnitude in uniform regions and the Snake evolves faster. If it is set to zero, all broken object boundaries can be preserved but the Snake shape evolution will be slightly slower.
[0037] BVF defines two two-dimensional boundary vector fields according to the gradient of the potential function as follows:
[0038] Φ1= [▽Ψ x ,▽Ψ y ] (15)
[0039]
[0040] where Ψ x , Ψ y are the horizontal and vertical difference magnitudes, and Ψ xy , Ψ yx are the diagonal direction interpolated magnitudes.
[0041] The vector field of BVF1, namely Φ1, is defined by the horizontal and vertical potential functions, while the vector field of BVF2, namely Φ2, is defined by the diagonal potential function. As shown above, BVF is simple to compute and the potential function is generated by only four scans without iterative optimization process. Based on the traditional Snake model, a new Snake model, namely BVF Snake model, is defined by applying two BVFs as external forces one by one:
[0042] E ext (x,y) = Φ(x,y) (17)
[0043] First, BVF1 is applied (i.e. Φ(x,y) = Φ1(x,y)) and the Snake is evolved until it converges. Then, BVF2 is applied (i.e. Φ(x,y) = Φ2(x,y)) and the Snake is evolved to the final result.
[0044] However, this method is not applicable when we apply BVF Snake to segment multi-object images. In BVF Snake, only the gradient magnitude is used to compute the gradient vector flow. Therefore, BVF Snake can be attracted to strong edges with opposite gradient directions relative to the predetermined boundary. As shown in Figure 1 Figure 1 a) There are two objects: an ellipse and a straight line. The ellipse is the object to be segmented out, and the straight line is the object to be kept out. Figure 1 b) is a BVF Snake field, 1c) is a local enlarged view of the vicinity of the straight line in the BVF Snake field, it can be seen that the direction of the Snake field above the straight line points to the lower side, not to the ellipse, so there will be part of the convergence to the straight line, 1d) is the result of segmentation by applying the BVF Snake model, the red line is the boundary of the target segmented, it can be seen that the BVF Snake does not correctly segment the specified target.
[0045] Therefore, how to improve the accuracy of the BVF Snake model in the segmentation of multi-target images is a problem that those skilled in the art need to solve. SUMMARY
[0046] Therefore, the present application provides a multi-target image segmentation system and method based on the BVF Snake model, which can correct the anti-gradient vectors generated in the BVF potential field by direction vectors during the segmentation process in multi-target images, improve the accuracy of segmentation, and expand the segmentation capability of the BVF Snake model for multi-target images.
[0047] In order to achieve the above purpose, the present application adopts the following technical solutions:
[0048] A multi-target image segmentation method based on the BVF Snake model, comprising the following steps:
[0049] Obtaining a multi-target image;
[0050] Confirming a target to be segmented and a reference point according to the target to be segmented;
[0051] Calculating the direction vectors of each pixel in the multi-target image pointing to the reference point to form a direction vector field;
[0052] Establishing a potential field by the BVF Snake model;
[0053] Fusing the potential field and the direction vector field to obtain a fused field;
[0054] Setting an initial Snake curve and iterating in the fused field to obtain the contour of the target to be segmented.
[0055] Further, the initial Snake curve is set outside the target to be segmented.
[0056] Further, the reference point is set inside or on the edge of the target to be segmented.
[0057] Further, before confirming the reference point, it further comprises obtaining an edge map and setting the reference point inside or on the edge of the target to be segmented according to the edge map.
[0058] Further, the direction vector of each pixel in the multi-target image pointing to the reference point is calculated, and the steps are as follows:
[0059] Obtaining the coordinates of the pixel and the coordinates of the reference point;
[0060] The direction vector d(x, y) = (dx, dy) can be obtained by the following equation:
[0061]
[0062] Wherein, x and y are the horizontal coordinate and the vertical coordinate of the pixel respectively; m and n are the horizontal coordinate and the vertical coordinate of the reference point respectively.
[0063] Further, the coordinates (m, n) of the reference point are:
[0064]
[0065] Wherein, (x i ,y i )(i = 1, 2,..., N) is the coordinates of the pixel in the target, and N is the number of pixels in the target. Further, the potential field and the direction vector field are fused, and the formula used is:
[0066] V dbvf (x, y) = [u dbvf (x, y), v dbvf (x, y)]
[0067]
[0068] Wherein, V dbvf represents the fusion vector of each pixel in the fusion field; u dbvf represents the horizontal coordinate of the fusion vector, and v dbvf represents the vertical coordinate of the fusion vector.
[0069] Further, iteration is performed in the fusion field, and the dynamic equation during iteration is:
[0070] c t (s, t) = α |c″(s, t)| 2 - β |c″″(s, t)| 2 + V dbvf (x, y)
[0071] Wherein, s is the arc length parameter, t is the iteration number, and α and β represent the elastic and rigid weight coefficients respectively.
[0072] A multi-target image segmentation system based on the BVFSnake model, comprising:
[0073] an acquisition module configured to acquire a multi-target image;
[0074] a preprocessing module configured to select a target to be segmented and a reference point in the multi-target image;
[0075] a calculation module configured to calculate a direction vector of each pixel in the multi-target image pointing to the reference point, thereby forming a direction vector field;
[0076] a segmentation module configured to establish a potential field by a BVFSnake model, and fuse the potential field with the direction vector field, thereby obtaining a fused field; and extract a contour of the target to be segmented by using the fused field.
[0077] Further, the preprocessing module is further configured to generate an edge map according to the multi-target image, and set the reference point based on the edge map.
[0078] Further, the segmentation module comprises:
[0079] a fusion sub-module configured to multiply the direction vector field and the potential field at corresponding pixel positions, thereby obtaining a fused vector corresponding to each pixel, and forming the fused field;
[0080] an action sub-module configured to set an initial value c(t), and iterate to convergence by using the following formula, thereby obtaining the contour; c t (s,t)=α|c″(s,t)| 2 -β|c″″(s,t)| 2 +V dbvf (x,y)
[0081] wherein s is an arc length parameter, t is an iteration number, and alpha and beta represent elastic and rigid weight coefficients respectively, and V dbvf represents the fused vector corresponding to each pixel in the fused field.
[0082] Advantages of the present application:
[0083] Compared with the prior art, the multi-target image segmentation system and method based on the BVFSnake model provided by the present application can correct the counter gradient vector generated in the BVF potential field by using the direction vector during the segmentation process in the multi-target image, thereby improving the segmentation accuracy and expanding the segmentation capability of the BVFSnake model for the multi-target image. BRIEF DESCRIPTION OF DRAWINGS
[0084] In order to make the technical solutions in the embodiments of the present application or the prior art clearer, the accompanying drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description only aim at the embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of the provided drawings.
[0085] Figure 1 The accompanying drawings are schematic diagrams of segmentation effects of the BVFSnake model.
[0086] Figure 2 The accompanying drawings are schematic diagrams of a multi-target image segmentation method based on the BVFSnake model provided by the embodiments of the present application.
[0087] Figure 3 The accompanying drawings are schematic diagrams of a multi-target image segmentation system structure based on the BVFSnake model provided by the embodiments of the present application. DETAILED DESCRIPTION
[0088] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort belong to the protection scope of the present application.
[0089] Embodiment 1
[0090] As Figure 2 disclosed in the embodiments of the present application is a multi-target image segmentation method based on the BVFSnake model, which comprises the following steps:
[0091] S1: obtaining a multi-target image; the image can be a sonar image.
[0092] S2: confirming a target to be segmented and confirming a reference point according to the target to be segmented;
[0093] In an embodiment, the center of the target to be segmented is taken as the reference point, and the center coordinates (m, n) of the target to be segmented are:
[0094]
[0095] wherein (x i ,y i )(i=1,2,...,N) are the coordinates of pixels in the target, and N is the number of pixels in the target.
[0096] In the embodiment, the reference point is selected based on the edge map, the coordinates and number of pixels in the target are determined according to the edge map, and the center of the target to be segmented, i.e., the reference point, is determined. The edge map is set according to the multi-target image:
[0097] f = |▽(G σ (x,y) * I(x,y))| 2 (25)
[0098] In the formula, G σ (x,y) is a two-dimensional Gaussian function with a standard deviation, σ = 2.5 is a variance, and the greater the noise, the greater the value of σ;▽ is a gradient operator, and * represents convolution. The edge map f takes a threshold T = 0.9, T ∈ [0, 1].
[0099] S3: Calculate the direction vector of each pixel point in the multi-target image pointing to the reference point to form a direction vector field; the specific steps include:
[0100] Obtain the coordinates of the pixel point and the coordinates of the reference point;
[0101] The direction vector d(x, y) = (dx, dy) can be obtained by the following equation:
[0102]
[0103] Wherein, x and y are the horizontal coordinate and vertical coordinate of the pixel point; and m and n are the horizontal coordinate and vertical coordinate of the reference point.
[0104] S4: Establish a force field through the BVFSnake model, and fuse the force field and the direction vector field to obtain a fusion field; the specific steps include:
[0105] The force field established by the BVFSnake model can obtain the horizontal and vertical pixel difference amplitude gradients;
[0106] The force field and the direction vector field are fused, and the formula used is:
[0107] V dbvf (x,y) = [u dbvf (x,y), v dbvf (x,y)]
[0108]
[0109] Wherein, V dbvf represents the fusion vector of each pixel of the fusion field; u dbvf represents the horizontal coordinate of the fusion vector, and v dbvf represents the vertical coordinate of the fusion vector;▽Ψ x and▽Ψ y are the horizontal gradient and the vertical gradient, respectively.
[0110] S6: iteration in the fusion field to obtain the contour of the target to be segmented.
[0111] In an embodiment, the dynamic equation in iteration is:
[0112] c t (s,t)=α|c″(s,t)| 2 -β|c″″(s,t)| 2 +V dbvf (x,y)
[0113] wherein s is an arc length parameter, t is the iteration number, and a and β represent the elastic and rigid weight coefficients respectively; the initial Snake curve c(t) is set outside the target to be segmented.
[0114] In another embodiment, the initial Snake curve is set with a difference distance of 0.5-1.5. The Snake curve is composed of many discrete points, and the difference distance herein refers to the distance between each point. The smaller the distance, the more accurate the curve, and the greater the calculation amount.
[0115] Embodiment 2
[0116] As Figure 3 disclosed in the present application is also a multi-target image segmentation system based on the BVFSnake model, comprising:
[0117] an acquisition module for acquiring a multi-target image;
[0118] a preprocessing module for selecting a target to be segmented and a reference point in the multi-target image;
[0119] a calculation module for calculating the direction vector of each pixel point in the multi-target image to the reference point to form a direction vector field;
[0120] a segmentation module for establishing a force field by the BVFSnake model, fusing with the fusion direction vector field to obtain a fusion field, and extracting the contour of the target to be segmented by the fusion field.
[0121] In an embodiment, the preprocessing module is further configured to generate an edge map according to the multi-target image and set the reference point based on the edge map.
[0122] In another embodiment, the segmentation module comprises:
[0123] a fusion sub-module for multiplying the direction vector field and the force field at the corresponding pixel point positions to obtain the fusion vector corresponding to each pixel point to form the fusion field;
[0124] The action sub-module sets an initial value c(t) and iterates to convergence by using the following formula to obtain the contour;
[0125] c t (s,t) = a|c"(s,t)| 2 - β|c'"(s,t)| 2 + V dbvf (x,y)
[0126] Wherein, s is the arc length parameter, t is the iteration number, a and β represent the elastic and rigid weight coefficients respectively, V dbvf represents the fusion vector corresponding to each pixel point of the fusion field.
[0127] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed by the embodiments, since it corresponds to the method disclosed by the embodiments, the description is relatively simple, and the related parts can be referred to the method part.
[0128] The above description of the disclosed embodiments enables a person skilled in the art to implement or use the present application. Various modifications to the embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A multi-object image segmentation method based on a BVFSnake model, characterized in that, The method comprises the following steps: acquiring a multi-target image; confirming a target to be segmented and a reference point according to the target to be segmented; calculating a direction vector of each pixel in the multi-target image pointing to the reference point to form a direction vector field; the step comprises: acquiring a pixel coordinate and a reference point coordinate; the coordinate (m, n) of the reference point is: ; where (x i , y i ) (i = 1,2,...,N) are the coordinates of the pixels in the target, and N is the number of pixels in the target; a direction vector d(x, y) = (dx, dy) can be obtained by the following equation: ; ; wherein x and y are the horizontal coordinate and the vertical coordinate of the pixel respectively; m and n are the horizontal coordinate and the vertical coordinate of the reference point respectively; establishing a potential field by a BVFSnake model; fusing the potential field and the direction vector field to obtain a fusion field; the formula used is: ; ; ; wherein, represents a fusion vector of each pixel of the fusion field; represents an abscissa of the fusion vector, represents an ordinate of the fusion vector, x and ∇Ψ y are respectively a horizontal gradient and a vertical gradient of the pixel point under the potential force field; setting an initial Snake curve and iterating in the fusion field to obtain a contour of the target to be segmented.
2. The multi-object image segmentation method based on the BVFSnake model according to claim 1, characterized in that, The reference point is set in the interior of the target to be segmented.
3. The multi-object image segmentation method based on the BVFSnake model according to claim 2, characterized in that, Before confirming the reference point, the method further comprises acquiring an edge map and setting the reference point in the interior of the target to be segmented according to the edge map.
4. The multi-object image segmentation method based on the BVFSnake model according to claim 1, characterized in that, When iterating in the fusion field, the dynamic equation is: ; wherein s is an arc length parameter, t is the iteration number, and a and b represent the elastic and rigid weight coefficients respectively.
5. A multi-object image segmentation system based on BVFSnake model, characterized in that, The method comprises the following steps: an acquiring module for acquiring a multi-target image; a preprocessing module for selecting a target to be segmented and a reference point in the multi-target image; a calculating module for calculating a direction vector of each pixel in the multi-target image pointing to the reference point to form a direction vector field; a segmentation module for establishing a potential field by a BVFSnake model, fusing the potential field and the direction vector field to obtain a fusion field, and extracting a contour of the target to be segmented by using the fusion field.
6. The multi-object image segmentation system based on BVFSnake model according to claim 5, wherein, The preprocessing module is further configured to generate an edge map according to the multi-target image and set the reference point based on the edge map.
7. The multi-object image segmentation system based on BVFSnake model according to claim 5, wherein, The segmentation module comprises: a fusion sub-module for multiplying the direction vector field and the potential field at corresponding pixel positions to obtain a fusion vector corresponding to each pixel to form a fusion field; an action sub-module for setting an initial value c(t) and iterating to convergence by using the following formula to obtain the contour: ; where s is the arc length parameter, t is the iteration number, and a and β represent the elastic and rigid weight coefficients, respectively, represents the fusion vector corresponding to each pixel point in the fusion field.