The present application relates to the field of ultrasonic image segmentation, and in particular to a Gabor wavelet-fused multi-scale local level set ultrasonic image segmentation method.
Currently, tumors in the digestive tract have high incidence worldwide and have a high fatality rate, which seriously threaten people's life and health. Ultrasonic endoscopy uses ultrasound to detect and image the internal organs of human body, which is non-damaging to human body and has low cost of detection and high diagnostic accuracy, and therefore becomes one of the important means for early detection and treatment of digestive tract tumors. The location, size, and shape of a tumor in the digestive tract are important parameters to assist physicians in judgment. Therefore, it is of great significance to perform edge extraction of tumors on ultrasonic images. Due to the detection characteristics of an ultrasound system, ultrasonic images have the disadvantages of uneven grayscale distribution, high noise, and poor edge continuity. As a result, it is difficult to obtain complete and accurate edges by using some classical segmentation methods such as a Canny operator method and a thresholding method.
The proposal of an active contour model is a breakthrough in the field of image segmentation. The basic idea of the proposal is to use continuous curves to fit edges to be measured and to perform image segmentation by defining an energy functional equation with the edges as variables and taking minimum values. With the introduction of a level set method, the applicability of the active contour model has been developed. However, the conventional level set algorithm still has some defects when performing actual image processing. For example, the famous Mumford-Shah model is not appropriate for actual application due to the complex computational iteration process and massive computation. It is also difficult to obtain accurate segmentation results for images having non-uniform grayscale by using the Chan-Vase model improved based on this model.
A local area-based level set method has been proposed for the segmentation of images having non-uniform grayscale. In 2007, Li proposed the local binary energy (local binary pattern, LBF) model, which introduced a Gaussian kernel function into an energy equation to extract local grayscale information, and added a regularization item, so that reinitialization is not required during the iteration of a level set, thereby reducing the amount of operations. However, the algorithm is sensitive to an initial contour and has poor robustness to noisy images. In 2008, Lankton proposed the LRB method, which also uses local region information to segment inhomogeneous images. However, the computational efficiency of the algorithm is low. In 2011, Li proposed the local intensity clustering level set method, which has a good segmentation effect for images with uniform grayscale variation but has serious over-segmentation for ultrasonic images with weak edges and uneven grayscale variation.
Therefore, there is a need in this field for a method that can accurately segment ultrasonic images.
For the foregoing technical problems in the prior art, an objective of the present application is to provide an ultrasonic image segmentation algorithm, thereby improving the segmentation accuracy of ultrasonic images.
The technical solution of the present application is as follows.
A first aspect of the present application provides an image segmentation method, including the following steps:
Preferably, a change function of the multi-directional Gabor wavelets in step S2 is:
g
q(x,y)=g(x cos θ+y sin θ,−x sin θ+y cos θ),
where g(x, y) is a Gabor function in a two-dimensional space; gq(x, y) is a multi-directional Gabor wavelet transformation template, where x and y are coordinates in two directions of the template; θ=qπ/, represents a total quantity of directions in wavelet transformation, and q is a direction parameter; and convolution is performed on Gabor wavelets in different directions with the original image to obtain the plurality of intermediate images, as shown by the following formula:
I
q(x,y)=I(x,y)*gq(x,y)q=0,1, . . . Q−1
where I(x, y) is original image data, and Iq(x, y) is intermediate image data.
Preferably, a fusion equation for fusing the plurality of intermediate images in step S3 is as follows:
I′(x,y)=max{Iq(x,y), q=0,1, . . . , Q−1},
where I′(x, y) is fused image data.
Preferably, the energy equation includes: an energy functional item related to the image itself, a length regularization item for keeping edge smoothness by limiting an edge length, and a distance regularization item for keeping a level set equation from reinitialization.
Preferably, it is assumed that an image having non-uniform grayscale is a result obtained after a grayscale offset item and an actual image are weighted and summed with noise added therein, and Gaussian templates having different variances are constructed to calculate the energy functional item; and the Gaussian templates are as follows:
where σp=σ0×p; σp is a variance of a different scale, and σ0 is a minimum variance, Kσ
(ϕ,c,b)=ε(ϕ,c,b)+ν(ϕ)+μ(ϕ),
where (ϕ, c, b) is a constructed energy function, ε(ϕ, c, b) is the energy functional item related to the image itself, L(ϕ) is the length regularization item used for forcing level set contour to be smooth by limiting an arc length thereof, R(ϕ) is the distance regularization item that keeps a level set function stable during iteration in order to keep a level set from reinitialization, and ν and μ are respectively corresponding weighting factors;
where P is a quantity of different scales, Kσ
L(ϕ) and Rp(ϕ) are the two regularization items, L(ϕ) is the length regularization item used for calculating a length of a zero-level contour of a level set equation ϕ and forcing level set contour to be smooth by limiting an arc length thereof; and an expression of the length regularization item is as follows:
(ϕ)=∫|∇H(ϕ)|dx
R(ϕ) is the distance regularization item that keeps a level set function stable during iteration in order to keep a level set from reinitialization, and an expression of the distance regularization item is as follows:
where p(s) represents a part of a regularization item equation, where s represents the absolute value of an edge gradient of the image.
Preferably, ϕ, c, b are optimized to enable the energy function to take the minimum value, the three parameters are respectively optimized, and during optimization of one parameter, values of the other two parameters are firstly fixed, the level set equation ϕ is optimized by using a Euler-Lagrange formula, c and b are optimized by using a partial differential equation, and an optimization equation for ϕ is as follows:
represents performing iteration on the level set equation, P represents a scale, δ(ϕ) is an impulse function, and ν and μ respectively represent the corresponding weighting factors, and div represents a difference operation; ei,p is an energy factor related to a distance constructed in a different scale; and ϕ and b are fixed, and c is optimized by the following equation:
where bp is a grayscale offset field calculated in the scale p; and ci,p is an image corrected by using the grayscale offset field in the scale p, and includes an inside part and an outside part of the level set;
ϕ and c are fixed, and b is optimized by the following equation:
where bp is the grayscale offset field calculated in the scale p, and Kσ
A second aspect of the present application provides an image processing apparatus is provided, including:
A third aspect of the present application provides an ultrasonic imaging apparatus is provided, including:
A fourth aspect of the present application provides an ultrasonic endoscope, including an insertion part, a control part, and the ultrasonic imaging apparatus according to the third aspect of the present application.
Through the foregoing technical solution, the present application provides a Gabor wavelet-fused multi-scale local clustering level set ultrasonic image segmentation method. The multi-directional property of Gabor wavelets is used to process images having non-uniform grayscale, and an intermediate image with an enhanced difference between a region to be segmented and a background is obtained by fusing maximum values. In the present application, the multi-scale idea is introduced into a local clustering level set algorithm, Gaussian kernel functions having different variances are set, and a level set is iterated by means of average fusion to obtain a final edge, thereby overcoming the disadvantages of a weak edge and inaccurate segmentation of an ultrasonic image.
An image segmentation method, an image processing apparatus, and an ultrasonic imaging apparatus according to the present application are described below with reference to the accompanying drawings.
An implementation procedure of the image segmentation method in this embodiment is shown in
Step 1: Read an acquired original ultrasonic image. In a preferred embodiment, the ultrasonic image is a two-dimensional ultrasonic image of a stomach cross-section.
Step 2: Filter the image by using a multi-directional Gabor filter. A Gabor function in a two-dimensional space is shown in the following formula:
In the formula, σx and σy respectively represent broadenings of a Gaussian function in an x direction and a y direction, and W represents a frequency bandwidth of a Gabor wavelet. A multi-directional Gabor wavelet transformation function may be represented as:
g
q(x,y)=g(x cos θ+y sin θ, −x sin θ+y cos θ)
where, g(x, y) is a Gabor function in a two-dimensional space; gq(x, y) is a multi-directional Gabor wavelet transformation template, where x and y are coordinates in two directions of the template; θ=qπ/, and represents a total quantity of directions in wavelet transformation; and convolution is performed on Gabor wavelets in different directions with the original image to obtain the plurality of intermediate images, as shown by the following formula:
I
q(x,y)=I(x,y)*gq(x,y)q=0,1, . . . Q−1,
I(x, y) is the original image data and Iq(x, y) is intermediate image data.
Step S3: To keep as many details as possible of the original image and enhance a difference between a foreground to be segmented and a background, fuse the plurality of intermediate images by taking maximum values, to obtain an enhanced image.
I′(x,y)=max{Iq(x,y),q=0,1, . . . , Q−1},
where I′(x, y) is the fused image data.
Step S4: Construct a corresponding level set energy equation for the intermediate images. The energy equation of the entire image is formed by three parts, which include: an energy functional item related to the image itself, a length regularization item for keeping edge smoothness by limiting an edge length, and a distance regularization item for keeping a level set equation from reinitialization. It is assumed that an image having non-uniform grayscale is a result obtained after a grayscale offset item and an actual image are weighted and summed with noise added therein, and Gaussian templates having different variances are constructed to calculate the energy functional item. The Gaussian templates are as follows:
where σp=σ0×p, σp is a variance of a different scale, and σ0 is a minimum variance, and p is the different scale, Kσ
(ϕ,c,b)=ε(ϕ,c,b)+ν(ϕ)+μ(ϕ),
where (ϕ,c,b) is a constructed energy function, ε(ϕ, c, b) is the energy functional item related to the image itself, L(ϕ) is the length regularization item used for forcing level set contour to be smooth by limiting an arc length thereof, R(ϕ) is the distance regularization item that keeps a level set function stable during iteration in order to keep a level set from reinitialization, and ν and μ are respectively corresponding weighting factors;
where P is a quantity of different scales, M1(ϕ)=H(ϕ), M2(ϕ)=1−H(ϕ). H(x) is a Heaviside function. M1(ϕ) and M2(ϕ) respectively correspond to an edge inside and an edge outside of the image. In the formula, (ϕ)=∫|∇H(ϕ)|dx, (ϕ)=∫p(|∇ϕ|)dx. A functional form of p(s) is as follows:
where p(s) represents a part of a regularization item equation, where s represents the absolute value of an edge gradient of the image.
Step 5: Optimize ϕ, c, b, to enable the energy function to take the minimum value, the three parameters are respectively optimized, and during optimization of one parameter, values of the other two parameters are firstly fixed, the level set equation ϕ is optimized by using a Euler-Lagrange formula, c and b are optimized by using a partial differential equation, and an optimization equation for ϕ is as follows:
where
represents performing iteration on the level set equation, P represents a scale, δ(ϕ) is an impulse function, and ν and μ respectively represent the corresponding weighting factors, and div represents a difference operation; ei,p is an energy factor related to a distance constructed in a different scale; and ϕ and b are fixed, and c is optimized by the following equation:
where bp is a grayscale offset field calculated in the scale p; and ci,p is an image corrected by using the grayscale offset field in the scale p, and includes an inside part and an outside part of the level set;
ϕ and c are fixed, and b is optimized by the following equation:
where bp is the grayscale offset field calculated in the scale p, and Kσ
Step S6: Repeat the calculation of the optimization equations in step S5 until the energy function takes the minimum value to obtain a final edge.
As shown in
The processing part is configured to obtain edge information in the image in the storage apparatus by using the method in any implementation in Embodiment 1.
As shown in
The ultrasonic probe is configured to emit an ultrasonic wave to an object under test, receive a reflected ultrasonic wave reflected by the object under test, and generate an echo signal corresponding to the reflected ultrasonic wave.
The generation part is configured to generate an ultrasonic image related to the object under test according to the echo signal.
The processing part is configured to obtain edge information in the ultrasonic image by using the method in any implementation in Embodiment 1.
A person skilled in the art can understand that although the image segmentation method in the above embodiments uses an ultrasonic image as a processing object, the present application is not limited to thereto. That is, in addition to using an ultrasonic image as a processing object, the image segmentation method in the embodiments of the present application can also process various grayscale images suitable for processing by using the method, for example, a CT image generated by an X-ray computed tomography device, an X-ray image generated by an X-ray diagnostic device, and an MR image generated by a magnetic resonance imaging device.
Several embodiments of the present application are described with respect to the present application. However, these embodiments are shown as examples and are not intended to limit the scope of the present application. These new embodiments may be implemented in various other ways, and various omissions, substitutions, and changes can be made without departing from the scope of the main idea of the present application. These embodiments and variations thereof fall within the scope and the main idea of the present application and fall within the scope of the prevent application and its equivalents as set forth in the claims.
This application is a continuation-in-part of International Application No. PCT/CN2020/107283, filed on Aug. 6, 2020, which is based upon and claims priority to International Application No. PCT/CN2020/086248, filed on Apr. 23, 2020, the entire contents of both are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2020/086248 | Apr 2020 | US |
Child | PCT/CN2020/107283 | US |
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2020/107283 | Aug 2022 | US |
Child | 18048527 | US |