Vessel image contour extraction method, device and equipment and storage medium
By acquiring two image matrices and a marker point matrix from a blood vessel image, the blood vessel tree image is segmented and binarized to determine initial contour points and construct the blood vessel contour. This solves the problem of inaccurate contour extraction in existing technologies and achieves more accurate blood vessel contour extraction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU SHENGSHI SCI & TECH CO LTD
- Filing Date
- 2022-10-28
- Publication Date
- 2026-04-10
AI Technical Summary
Existing methods for extracting vascular image contours cannot accurately fit the original blood vessels, resulting in inaccurate extracted contours.
By acquiring two image matrices and a marker point matrix from the blood vessel image, the blood vessel tree image is segmented and a grayscale image is obtained. Binarization segmentation is performed using the centerline of the marked blood vessel segment to determine the initial contour points. The blood vessel contour is then constructed based on the normal vector to eliminate background interference and optimize contour extraction.
It achieves automatic extraction of contours that fit the edges of real blood vessels, eliminates background interference, and improves the accuracy and fit of contour extraction.
Smart Images

Figure 1
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of image processing, and particularly relates to a blood vessel image contour extraction method and device, equipment and a storage medium. BACKGROUND
[0002] In medical images, accurately segmenting blood vessels such as coronary artery blood vessels and extracting blood vessel contours are of great significance for determining the stenosis, lesions and the like of coronary arteries. At present, the contour extraction of blood vessel images mostly adopts a traditional region growing method or a machine learning method, and the contours extracted by these methods do not conform to the original blood vessels. SUMMARY
[0003] The present application provides a blood vessel image contour extraction method, device, equipment and storage medium.
[0004] The technical scheme of the present application embodiment is implemented as follows:
[0005] The present application provides a blood vessel image contour extraction method, which comprises the following steps:
[0006] obtaining two image matrices and a marker point matrix of a blood vessel image;
[0007] segmenting a blood vessel tree image from the blood vessel image based on the two image matrices, and obtaining a grayscale image of the blood vessel tree image;
[0008] obtaining a center line of a marker segment blood vessel based on the grayscale image of the blood vessel tree image and the marker point matrix, wherein the center line of the marker segment blood vessel comprises a starting point and an ending point contained in the marker point matrix;
[0009] performing binary segmentation on the grayscale image of the blood vessel tree image based on the center line of the marker segment blood vessel, to obtain a marker segment blood vessel grayscale image after blood vessel and background segmentation;
[0010] determining two first normal vectors corresponding to each point on the center line with the point as the origin, and taking the intersection point of the two first normal vectors and the edge of the marker segment blood vessel grayscale image as an initial contour point, and constructing a contour of the marker segment blood vessel based on the initial contour point.
[0011] The present application provides a blood vessel image contour extraction device, which comprises:
[0012] an acquisition module, configured to obtain two image matrices and a marker point matrix of a blood vessel image;
[0013] a processing module, configured to segment a blood vessel tree image from the blood vessel image based on the two image matrices, and obtain a grayscale image of the blood vessel tree image;
[0014] The processing module is used to obtain the centerline of the marked blood vessel segment based on the grayscale image of the blood vessel tree image and the marker point matrix; wherein the centerline of the marked blood vessel segment includes the start point and end point contained in the marker point matrix;
[0015] The processing module is used to perform binarization segmentation on the grayscale image of the blood vessel tree image based on the centerline of the marked blood vessel segment, so as to obtain the grayscale image of the marked blood vessel segment after the blood vessel and background are segmented.
[0016] The processing module is used to determine the intersection points of the two first normal vectors corresponding to each point on the center line as origins, and the intersection points with the edges of the grayscale image of the marked segment blood vessel as initial contour points, and to construct the contour of the marked segment blood vessel based on the initial contour points.
[0017] This application provides a contour extraction device for blood vessel images, the contour extraction device for blood vessel images comprising: a processor, a memory, and a communication bus;
[0018] The communication bus is used to realize the communication connection between the processor and the memory;
[0019] The processor is used to execute a contour extraction program for blood vessel images stored in the memory to implement the steps of the blood vessel image contour extraction method described above.
[0020] This application provides a storage medium storing one or more programs that can be executed by one or more processors to implement the steps of the above-described method for contour extraction of blood vessel images.
[0021] The contour extraction method, apparatus, device, and storage medium for vascular images provided in this application acquire two image matrices and a marker point matrix from the vascular image; based on the two image matrices, a vascular tree image is segmented from the vascular image, and a grayscale image of the vascular tree image is obtained; based on the grayscale image of the vascular tree image and the marker point matrix, the centerline of the marked segment of the vascular is obtained; wherein the centerline of the marked segment of the vascular includes the start and end points contained in the marker point matrix; based on the centerline of the marked segment of the vascular, the grayscale image of the vascular tree image is binarized to obtain a grayscale image of the marked segment of the vascular after the vascular and background are segmented; taking each point on the centerline as the origin, the intersection points of the two first normal vectors corresponding to each point with the edge of the grayscale image of the marked segment of the vascular are determined as initial contour points, and the contour of the marked segment of the vascular is constructed based on the initial contour points; that is, the contour extraction method for vascular images provided in this application realizes the automatic extraction of the contour of the vascular image that fits the edge of the real vascular, based on the grayscale image of the vascular tree image, that is, starting from the actual scene, the marked segment of the vascular and the background are segmented to eliminate background interference, thus making the obtained vascular contour fit the edge of the real vascular. Attached Figure Description
[0022] Figure 1 A flowchart illustrating the contour extraction method for blood vessel images provided in this application embodiment;
[0023] Figure 2 A schematic diagram of the read blood vessel image and marker points provided in the embodiments of this application;
[0024] Figure 3 A schematic diagram of Gaussian filtering provided in the embodiments of this application;
[0025] Figure 4 A schematic diagram of median filtering provided in the embodiments of this application;
[0026] Figure 5 A schematic diagram of bilateral filtering provided in the embodiments of this application;
[0027] Figure 6 A schematic diagram of the sharpened image provided in the embodiments of this application;
[0028] Figure 7 This application provides an embodiment of an image with its brightness adjusted during the sharpening process;
[0029] Figure 8 This application provides an embodiment of an image sharpening process after adjusting the brightness and contrast of the image;
[0030] Figure 9 A schematic diagram of the grayscale image of the vascular tree provided in the embodiments of this application;
[0031] Figure 10 A schematic diagram of the centerline of the marked segment of the blood vessel provided in the embodiments of this application;
[0032] Figure 11 A schematic diagram of the grayscale image of the marked blood vessel segment provided in the embodiments of this application;
[0033] Figure 12 A schematic diagram of the initial contour provided in the embodiments of this application;
[0034] Figure 13 A schematic diagram of the modified contour provided in the embodiments of this application;
[0035] Figure 14 A schematic diagram of the optimized contour provided in the embodiments of this application;
[0036] Figure 15 A schematic diagram of the edge image of a blood vessel provided in the embodiments of this application;
[0037] Figure 16 A schematic diagram of the replaced contour provided in the embodiments of this application;
[0038] Figure 17 A schematic diagram of the contour after secondary correction provided in the embodiments of this application;
[0039] Figure 18 A schematic diagram of polynomial fitting of blood vessel contours provided in the embodiments of this application;
[0040] Figure 19 A schematic diagram of the structure of the contour extraction device for blood vessel images provided in this application embodiment;
[0041] Figure 20 A schematic diagram of the structure of the contour extraction device for blood vessel images provided in this application embodiment. Detailed Implementation
[0042] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0043] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0044] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0045] The vascular image contour extraction device provided in this application embodiment can be implemented as any vascular image contour extraction device such as a laptop computer, tablet computer, desktop computer, mobile device (e.g., personal digital assistant, dedicated messaging device), or intelligent robot, or it can be implemented as a server. Below, exemplary applications of the vascular image contour extraction device when implemented as a vascular image contour extraction device will be described.
[0046] This application provides a method for contour extraction of blood vessel images. This method is applied to a contour extraction device for blood vessel images. See [link to relevant documentation]. Figure 1 As shown, the method includes:
[0047] Step 101: Obtain two image matrices and a marker matrix of the blood vessel image.
[0048] In this embodiment, the vascular images include, but are not limited to, medical images of the coronary arteries and aortic branches. This embodiment does not specifically limit the location corresponding to the vascular images.
[0049] Here, the two image matrices comprise data from medical images acquired at different angles at the same time. For example, matrices of coronary angiography images from different angles at the same time onto two projection planes. The marker matrix includes at least two marker points. When two marker points are included, one can be marked as the start point and the other as the end point; when there are more than two marker points, there is one start point, one end point, and an intermediate point between the start and end points. These marker points are used to generate the vessel centerline for subsequent vessel segmentation.
[0050] For example, see Figure 2 As shown, taking digital subtraction angiography (DSA) coronary artery images as an example, the process involves reading files in Digital Imaging and Communications in Medicine (DICOM) format to obtain the DSA coronary artery image and the marker points of the segment of interest, resulting in two image matrices and a marker point matrix. The marker points of the segment of interest include... Figure 2 The first marker point 201 (assumed to be the first marker point) and the second marker point 202 (assumed to be the last marker point) are shown.
[0051] Step 102: Based on the two image matrices, segment the vascular tree image from the vascular image and obtain the grayscale image of the vascular tree image.
[0052] In this embodiment, the blood vessel image is segmented based on two image matrices to extract the blood vessel tree image from the original blood vessel image. This process is also known as the image preprocessing process, which reduces interference for subsequent contour extraction.
[0053] Furthermore, after segmenting the vascular tree image, thresholding can be performed on the vascular tree image to obtain a grayscale image of the vascular tree image. Thresholding can include, but is not limited to, binarization segmentation.
[0054] Step 103: Based on the grayscale image and marker matrix of the vascular tree image, obtain the centerline of the marked segment of the vascular vessel.
[0055] The centerline of the marked segment of the blood vessel includes the start and end points contained in the marker point matrix.
[0056] In this embodiment of the application, there is more than one path from one point to another on the grayscale image of the vascular tree image, and the length of each path may be different. Based on the grayscale image of the vascular tree image and the marker point matrix, the length of each path is determined, and the center line of the marked segment of the blood vessel is obtained based on the length of each path.
[0057] Here, the centerline of the marked vessel segment can be obtained based on the shortest path from one point to another. Alternatively, the centerline of the marked vessel segment can be obtained using the Fast Marching Level Set Method.
[0058] Step 104: Binarize the grayscale image of the blood vessel tree image based on the centerline of the marked blood vessel segment to obtain the grayscale image of the marked blood vessel segment after the blood vessel and background are segmented.
[0059] In this embodiment of the application, the grayscale image of the blood vessel tree image is binarized based on the centerline of the marked blood vessel segment to obtain the grayscale image of the marked blood vessel segment after the blood vessel and background are segmented. In the process of obtaining the grayscale image of the marked blood vessel segment, the image binarization processing method can be used to achieve the segmentation of blood vessels and background in order to obtain the grayscale image of the marked blood vessel segment.
[0060] Image binarization is the process of setting the grayscale value of pixels in an image to 0 or 255, thus giving the entire image a distinct black and white effect. The threshold is used during image segmentation to distinguish target objects from background pixels; pixels with values greater than or equal to the threshold belong to the target object, while other pixels belong to the background. In this application, the target object includes labeled blood vessel segments.
[0061] In this embodiment, the grayscale image of the blood vessel tree is binarized and segmented using thresholding, which includes, but is not limited to, global thresholding and adaptive thresholding.
[0062] Global thresholding refers to using the same threshold for the entire image, suitable for images where there is a clear contrast between the background and the labeled blood vessel segment. In many cases, the contrast between the labeled blood vessel segment and the background is not uniform throughout the image, making it difficult to separate them using a single threshold. In such cases, different thresholds can be applied based on local image features. In practice, the image needs to be divided into several sub-regions according to the specific problem, and thresholds should be selected for each region separately, or the threshold at each point should be dynamically selected based on a certain neighborhood range.
[0063] In some embodiments of this application, the Otsu thresholding algorithm can be used to binarize the grayscale image of the blood vessel tree image during the adaptive thresholding process. The segmentation values for the marked blood vessels and the background can be thresholds calculated using the inter-class variance method.
[0064] As can be seen, this application is based on the grayscale image of the blood vessel tree, that is, starting from the actual scene, segmenting the marked blood vessels and the background, eliminating background interference, so that the obtained blood vessel contours are more in line with the real blood vessel edges.
[0065] Step 105: Using each point on the center line as the origin, determine the intersection of the two first normal vectors corresponding to each point with the edge of the grayscale image of the marked segment blood vessel as the initial contour point, and construct the contour of the marked segment blood vessel based on the initial contour point.
[0066] In this embodiment of the application, for each point on the center line, two first normal vectors can be determined, and the directions of these two first normal vectors are opposite.
[0067] In some embodiments, the outline of the marked segment vessel is constructed based on the initial outline points, which can be formed by directly connecting the initial outline points; that is, the outline of the marked segment vessel can be obtained based on the grayscale image of the marked segment vessel.
[0068] In other embodiments, the contour of the marked blood vessel segment is constructed based on the initial contour points. The initial contour points can be directly connected to form the initial contour of the marked blood vessel segment, and then the initial contour is updated at least once to obtain the final contour. The final contour and the initial contour not only eliminate the interference of the background in the blood vessel image on the contour extraction, but also further improve the fit of the contour extraction.
[0069] The contour extraction method for blood vessel images provided in this application involves obtaining two image matrices and a marker point matrix from the blood vessel image; segmenting a blood vessel tree image from the blood vessel image based on the two image matrices and obtaining a grayscale image of the blood vessel tree image; obtaining the centerline of the marked blood vessel segment based on the grayscale image of the blood vessel tree image and the marker point matrix; wherein the centerline of the marked blood vessel segment includes the start point and end point contained in the marker point matrix; performing binarization segmentation on the grayscale image of the blood vessel tree image based on the centerline of the marked blood vessel segment to obtain a grayscale image of the marked blood vessel segment after segmentation of the blood vessel and the background; determining the intersection points of the two first normal vectors corresponding to each point on the centerline as the origin, and the intersection points with the edges of the grayscale image of the marked blood vessel segment as initial contour points, and constructing the contour of the marked blood vessel segment based on the initial contour points; that is, the contour extraction method for blood vessel images provided in this application realizes automatic extraction of the contour of the blood vessel image that fits the real blood vessel edge, based on the grayscale image of the blood vessel tree image, that is, starting from the actual scene, segmenting the marked blood vessel segment and the background, eliminating background interference, thus making the obtained blood vessel contour fit the real blood vessel edge more closely.
[0070] In some embodiments of this application, step 102, which segments the vascular tree image from the vascular image based on two image matrices, is implemented through the following two-stage operation:
[0071] In the first stage, the two image matrices are filtered to obtain the filtered image matrix.
[0072] In this embodiment, the filtering process includes, but is not limited to, Gaussian filtering, bilateral filtering, median filtering, and mean filtering. Here, the original 3D image corresponding to the two image matrices is named img. For example, in the process of filtering the two image matrices, Gaussian filtering, median filtering, and bilateral filtering can be performed on img sequentially.
[0073] For example, Gaussian filtering is performed on the image using a filter kernel of size p×p. See the image below for the Gaussian-filtered result. Figure 3 As shown, this makes the image smoother. Here, p is a positive integer, for example, p = 5. Of course, p can also take other values, such as 3, etc., and this application does not specifically limit this.
[0074] For example, using the q-neighborhood as the range Figure 3 Median filtering is performed to preserve as much detail as possible in the image and avoid thinning or coarsening of image edges. The resulting median-filtered image can be found in [reference needed]. Figure 4 As shown, this further smooths the image. Here, q is a positive integer, for example, q = 5. Of course, q can also take other values, such as 3, etc., and this application does not specifically limit this.
[0075] For example, targeting Figure 4First, a scale (sigma) is set. A multidimensional Gaussian filter of the same size as the image is constructed at the current sigma scale. Gaussian filtering is performed, and the Hessian matrix and Hessian eigenvalues are calculated. For each pixel, the maximum value at all sigma scales is returned, and its corresponding image is used as the output to obtain the bilaterally filtered image. See [link to documentation]. Figure 5 The image shown is a vascular tree.
[0076] In the second stage, the filtered image matrix is sharpened to obtain the vascular tree image.
[0077] Here, the vascular tree image is represented as img1, which can be obtained by the following formula (1):
[0078] img1 = (log I (K·img)) g (1);
[0079] Where K is the sharpening matrix, I is the contrast adjustment coefficient, and g is the brightness adjustment coefficient.
[0080] For example, the filtered image matrix... Figure 5 The vascular tree image shown is sharpened to obtain the following result: Figure 6 A clear image of the vascular tree is shown.
[0081] In a scenario where sharpening is feasible, adjust g=0.6 and I=0.4. Figure 5 Taking the brightness and contrast of the vascular tree image shown as an example, the image obtained after adjusting the brightness is shown in [reference needed]. Figure 7 As shown, further adjustments to the contrast are made, resulting in the image shown below. Figure 8 As shown, a complete and clear vascular tree image is obtained by segmenting from the original vascular image.
[0082] Here, still using the vascular tree image obtained in the second stage as an example, a threshold of 0.04 is set, and threshold binarization segmentation is performed, such as local Otsu threshold binarization vascular segmentation, to obtain the grayscale image of the vascular tree image. See [link to relevant documentation]. Figure 9 As shown.
[0083] Furthermore, with Figure 9 The grayscale image and marker matrix of the vascular tree shown are used to obtain the centerline of the marked vascular segment (see [reference]). Figure 10 As shown: According to Figure 9 The grayscale image and the marker point matrix of the generated vascular tree image are the vascular marker points of the segment of interest. The center line of the marked segment of the vascular tree is obtained by using the fast matching level set algorithm. The starting point of the center line is the first marker point, the path includes intermediate marker points, and the ending point is the last marker point.
[0084] In some embodiments of this application, step 104, which performs binarization segmentation of the grayscale image of the blood vessel tree based on the centerline of the marked blood vessel segment to obtain the grayscale image of the marked blood vessel segment after segmentation of the blood vessel and the background, can be achieved through the following steps:
[0085] First, using each point in the center line as a seed point, the segmentation threshold between blood vessels and the background is obtained.
[0086] For example, the segmentation threshold can be determined by obtaining the maximum inter-class variance within the segmentation window and determining the segmentation threshold between blood vessels and background based on the maximum inter-class variance.
[0087] Secondly, the image within the segmentation window is segmented based on the segmentation threshold to obtain partial blood vessel images within the segmentation window.
[0088] Finally, the partial vascular images within all the segmented windows are combined, and morphological operations are performed on the combined image to obtain a grayscale image of the labeled vascular segment.
[0089] In this embodiment, morphological operations include opening and closing operations. Opening refers to performing erosion followed by dilation on an image, which can eliminate discrete points and "spiky" features, and can separate two objects. Closing refers to performing dilation followed by erosion on an image, which can fill internal holes and concave corners, and can connect two adjacent targets.
[0090] For example, based on the obtained grayscale images of the centerline of the marked blood vessels and the blood vessel tree image, each point on the centerline is used as a seed point, and an r×r matrix centered at the seed points is used as a segmentation window, where r is a positive integer, for example, r=26. The maximum inter-class variance of each pixel value in the segmentation window is calculated as the segmentation threshold, and the blood vessels and background in the segmentation window are segmented. Finally, the segmentation results of each segmentation window are combined to obtain the final result of local Otsu threshold binarization segmentation, and morphological filling and opening / closing operations are performed to obtain the grayscale image of the marked blood vessels, as shown in img3 in Figure 11. Here, r can also take other values, such as 25, and this application does not specifically limit it.
[0091] In some embodiments of this application, step 105, which involves constructing the contour of the marked segment blood vessel based on the initial contour points, includes the following steps:
[0092] A11. Connect the initial contour points to obtain two initial contours of the marked segment of the blood vessel.
[0093] For example, based on the centerline of the generated marked blood vessel segment and the grayscale image img3 of the blood vessel tree image, the tangent vector of the centerline and the normal vectors in two directions are calculated. Starting from various sub-points of the centerline as the origin, the intersection points of the normal vector directions with the edges of the marked blood vessel segment grayscale image are found as initial contour points. Finally, two initial contours are obtained, denoted as c1 and c2, as follows. Figure 12 As shown.
[0094] A12. Based on the blood vessel image, take each contour point in the initial contour as the starting point and the unit normal vector on the first normal vector as the step size, and calculate the gradient of n effective points in the direction of the first normal vector.
[0095] Where n is a positive integer. Here, the n valid points are points in the blood vessel image.
[0096] A13. Take the maximum gradient point of each contour point on the two first normal vectors as the new contour point to obtain two corrected contours.
[0097] For example, based on the initial blood vessel contours c1 and c2 obtained from A11, the tangent vector and normal vector of each contour are calculated on the basis of the blood vessel image. A Sobel gradient operator is set, and the Sobel gradients of f valid points along the normal vector direction are calculated, using each contour point in c1 and c2 as the starting point and the normal vector as the step size. The point with the largest Sobel gradient in both directions is stored as a new contour point in the initial contour, resulting in the corrected contour, denoted as c1. 1n c 2n like Figure 13 As shown. Here, f is a positive integer, for example, 8, and the value range of f is [1, 10]. That is to say, this application updates and optimizes the contour points based on the original blood vessel image and initial contour, according to the principle of maximizing gradient.
[0098] For example, the Sobel gradient value can be calculated using the following formulas (2) to (5):
[0099]
[0100]
[0101]
[0102]
[0103] Where A is the pixel coordinate of the original contour point, A′ is the pixel coordinate of the point to be measured, G is the Sobel gradient value at point A′, and h is the step size. Let G be the unit normal vector at point A. x G yThese are the Sobel gradient components along the x-axis and y-axis at point A′, respectively.
[0104] In some embodiments of this application, after obtaining the two corrected contours in step A13, the following steps may also be performed:
[0105] B11. Obtain the distance between each point in the two corrected contours and the opposite point of the corresponding point in the two initial contours.
[0106] B12. If the distance exceeds the distance threshold, replace the points in the two corrected contours that exceed the distance threshold with the corresponding points in the two initial contours to obtain the two optimized corrected contours.
[0107] For example, the distance threshold ranges from [0.6l, 1.25l], where l is the initial distance parameter.
[0108] In a feasible scenario, after updating to the corrected contour, the distances to multiple neighboring contour points at each location on the initial contour are calculated to obtain the initial distance parameter l. These neighboring groups include, but are not limited to, four groups. Further, the distance l′ between each point in the corrected contour and the corresponding point on the opposite side of the blood vessel in the original contour is calculated. If l′ > 1.25l or l′ < 0.6l, then c is... 1n c 2n Replace the point in c1 with points in c2 to obtain the corrected contour, denoted as c. 1nn c 2nn ,like Figure 14 As shown.
[0109] In other embodiments, the ratio of l′ to l can be used to determine whether it is within a proportional threshold range. If it is, the points in the two corrected contours that exceed the distance threshold are replaced with the corresponding points in the two initial contours to obtain the two optimized corrected contours.
[0110] For example, the tangent vector and normal vector are calculated for each contour, with c 1nn c 2nn Starting from each contour point and using the unit normal vector as the step size, we sequentially search for the z valid points along the normal vector direction to determine if they are img. edge The edge of the blood vessel in the middle, if so, then c 1nn c 2nn The points in the table are replaced with the retrieved valid points. The calculation formula is as follows:
[0111]
[0112] A′=A if A′ pixel =255;
[0113] Where A is the pixel coordinate of the original contour point, A′ is the pixel coordinate of the point to be measured, and z is the step size. Let A' be the unit normal vector at point A. pixel Let A' be the pixel value of the point to be measured.
[0114] In this embodiment, the Sobel gradient is corrected a second time within a range of fewer than a preset number of valid points to obtain c. 1nnn c 2nnn .
[0115] In some embodiments of this application, after obtaining the two optimized and corrected contours in step B12, the following steps may also be performed:
[0116] C11. Extract the edge image of blood vessels based on the blood vessel tree image.
[0117] For example, based on a vascular tree image, the extraction of vascular edge images can be achieved through the following steps: First, Gaussian filtering is performed. Then, the Sobel gradient and direction of each pixel are calculated. Next, a non-maximum suppression algorithm is used to eliminate false edge detections. All points on the gradient matrices corresponding to the two image matrices are traversed, and pixels with maximum values in the edge direction are retained. After non-maximum suppression, a dual threshold is applied to filter boundaries. For example, an upper threshold of 150 and a lower threshold of 50 are set. Boundaries greater than the upper threshold are called strong boundaries, and those less than the lower threshold are called weak boundaries. Finally, the weak boundaries connected to the largest strong boundary are identified as target boundaries, while other weak boundaries are suppressed. The resulting vascular edge image is shown below. Figure 15 As shown,
[0118] C12. Starting from each contour point in the two optimized and corrected contours, and taking the unit normal vector on the second normal vector corresponding to each contour point as the step size, search whether the m valid points on the second normal vector are the blood vessel edges in the edge image.
[0119] Where m is a positive integer.
[0120] C13. If the m valid points retrieved are the blood vessel edges in the edge image, replace the corresponding contour points in the two optimized and corrected contours with the m valid points retrieved to obtain two replaced contours.
[0121] For example, based on the optimized two corrected contour and edge images, the tangent vector and normal vector of each contour are calculated. Taking each contour point as the starting point and the normal vector as the step size, the system searches for m valid points along the normal vector direction to determine if they represent blood vessel edges in the image. If an edge is found, the points in the blood vessel contour are replaced with the searched valid points, resulting in two replaced contours. See [link to documentation]. Figure 16 As shown. For example, m = 8.
[0122] For example, the obtained vascular contour is subjected to a second correction using the Sobel gradient with three valid points as the range, and the resulting vascular contour after the second correction is shown in the figure. Figure 17 As shown.
[0123] In some embodiments of this application, after obtaining the two replaced contours in step C13, the following steps may also be performed:
[0124] D11. Extract the new center lines of the two replaced contours.
[0125] D12. Obtain the span D along the X-axis of the two replaced contours. x and the span D in the Y-axis direction y .
[0126] D13, if D x >D y A high-order polynomial fitting is performed with the x-axis as the independent variable and the y-axis as the dependent variable. The contour points on the two replaced contours are then substituted into the first fitted curve function to calculate the final blood vessel contour points. The first fitted curve is a function curve generated with the x-axis as the independent variable and the y-axis as the dependent variable.
[0127] D14, if D y >D x A high-order polynomial fitting is performed with the ordinate as the independent variable and the abscissa as the dependent variable. The contour points on the two replaced contours are then substituted into the second fitted curve function to calculate the final blood vessel contour points. The second fitted curve is a function curve generated with the ordinate as the independent variable and the abscissa as the dependent variable.
[0128] For example, based on the obtained secondary corrected blood vessel contour, a new centerline is calculated by taking the midpoint of the contour, and the span D in the X-axis direction of the contour is calculated. x and the span D in the Y-axis direction y If D x >D y Then, using the horizontal axis as the independent variable and the vertical axis as the dependent variable, a high-order polynomial fitting is performed. The intersection point of the centerline and the first fitted curve is found based on the distance *l* between the original contour and the centerline, and this intersection point is taken as the final vascular contour point. If D y >D x Then, using the ordinate as the independent variable and the abscissa as the dependent variable, a high-order polynomial fitting is performed to obtain the final blood vessel contour points in the manner described above. See [link to documentation]. Figure 18 As shown. In this application Figures 2-18 The image coordinate system is used to represent pixel coordinates.
[0129] In this embodiment, the maximum Sobel gradient point around the contour point is retrieved in the original image and used as the vessel edge. Contour points that failed optimization due to background interference are restored after updating. Simultaneously, edge optimization is applied to the contour points, and the maximum Sobel gradient is retrieved within a small range to eliminate the influence of the background on contour extraction, making the contour closer to the real vessel edge in the original image. Finally, polynomial fitting is used to smooth the contour and ensure that the contour points on both sides correspond, facilitating subsequent vessel data calculation. Through these steps, based on the original coronary artery image and marker points, functions including image processing, centerline extraction, vessel segmentation, contour extraction, contour optimization, and correction can be achieved, ultimately obtaining the edge contour of the marked vessel segment. This not only eliminates background interference from the original image and improves the fitting rate by optimizing the contour, but also makes the final contour smoother and neater. Therefore, the vessel image contour extraction method provided in this application, from a practical application perspective, controls the algorithm in a fully automated process. After obtaining the input vessel image and marker points, the entire process can be completed automatically without manual intervention or other operations. Furthermore, after automatic algorithm optimization, the extracted vessel contour has high accuracy and does not require secondary manual correction.
[0130] Embodiments of this application provide a contour extraction device for blood vessel images, which can be used to implement... Figure 1 A corresponding embodiment provides a method for contour extraction of blood vessel images, referring to... Figure 19 As shown, the contour extraction device 300 for the blood vessel image includes:
[0131] The acquisition module 301 is used to acquire two image matrices and a marker point matrix of a blood vessel image;
[0132] The processing module 302 is used to segment a vascular tree image from a vascular image based on two image matrices and obtain a grayscale image of the vascular tree image.
[0133] The processing module 302 is used to obtain the centerline of the marked blood vessel segment based on the grayscale image and the marker point matrix of the blood vessel tree image; wherein the centerline of the marked blood vessel segment includes the start point and the end point contained in the marker point matrix;
[0134] The processing module 302 is used to perform binarization segmentation of the grayscale image of the blood vessel tree image based on the center line of the marked blood vessel segment to obtain the grayscale image of the marked blood vessel segment after the blood vessel and background are segmented.
[0135] The processing module 302 is used to determine the initial contour points by taking each point on the center line as the origin and the intersection of the two first normal vectors corresponding to each point with the edge of the grayscale image of the marked segment blood vessel as the initial contour points, and to construct the contour of the marked segment blood vessel based on the initial contour points.
[0136] In some embodiments of this application, the processing module 302 is used to connect the initial contour points to obtain two initial contours of the marked blood vessel segment; based on the blood vessel image, taking each contour point in the initial contour as the starting point and the unit normal vector on the first normal vector as the step size, the gradient of n effective points in the direction of the first normal vector is calculated; where n is a positive integer; the maximum gradient point of each contour point on the two first normal vectors is taken as the new contour point to obtain two corrected contours.
[0137] In some embodiments of this application, the acquisition module 301 is used to acquire the distance between each point in the two corrected contours and the opposite point of the corresponding point in the two initial contours.
[0138] The processing module 302 is used to replace the points in the two corrected contours that exceed the distance threshold with the corresponding points in the two initial contours if the distance exceeds the distance threshold, so as to obtain two optimized corrected contours.
[0139] In some embodiments of this application, the processing module 302 is used to extract the edge image of blood vessels based on the blood vessel tree image; taking each contour point in the optimized two corrected contours as the starting point, and taking the unit normal vector on the second normal vector corresponding to each contour point as the step size, it searches whether m valid points on the second normal vector are the blood vessel edges in the edge image; where m is a positive integer; if the searched m valid points are the blood vessel edges in the edge image, the searched m valid points replace the corresponding contour points in the optimized two corrected contours to obtain two replaced contours.
[0140] In some embodiments of this application, processing module 302 is used to extract new centerlines of the two replaced contours; and to obtain the span D in the X-axis direction of the two replaced contours. x and the span D in the Y-axis direction y If D x >D y Using the x-axis as the independent variable and the y-axis as the dependent variable, a high-order polynomial fitting is performed. The contour points on the two replaced contours are then substituted into the first fitted curve function to calculate the final vessel contour points. If D y >D x Using the ordinate as the independent variable and the abscissa as the dependent variable, a high-order polynomial fitting is performed. The contour points on the two replaced contours are substituted into the second fitting curve function to calculate the final blood vessel contour points.
[0141] In some embodiments of this application, the processing module 302 is used to filter two image matrices to obtain a filtered image matrix; and to sharpen the filtered image matrix to obtain a vascular tree image.
[0142] In some embodiments of this application, the processing module 302 is used to represent the blood vessel tree image as img1, img1 = (log I (K·img)) g Where K is the sharpening matrix, I is the contrast adjustment coefficient, and g is the brightness adjustment coefficient.
[0143] The contour extraction device for blood vessel images provided in this application obtains two image matrices and a marker point matrix from the blood vessel image; based on the two image matrices, it segments a blood vessel tree image from the blood vessel image and obtains the grayscale image of the blood vessel tree image; based on the grayscale image of the blood vessel tree image and the marker point matrix, it obtains the centerline of the marked blood vessel segment; wherein the centerline of the marked blood vessel segment includes the start point and end point contained in the marker point matrix; based on the centerline of the marked blood vessel segment, it performs binarization segmentation on the grayscale image of the blood vessel tree image to obtain the grayscale image of the marked blood vessel segment after segmentation of blood vessels and background; taking each point on the centerline as the origin, it determines the intersection points of the two first normal vectors corresponding to each point with the edge of the grayscale image of the marked blood vessel segment as initial contour points, and constructs the contour of the marked blood vessel segment based on the initial contour points; that is, the contour extraction method for blood vessel images provided in this application is based on the grayscale image of the blood vessel tree image, that is, starting from the actual scene, it segments the marked blood vessel segment and the background to eliminate background interference, thus making the obtained blood vessel contour more closely fit the edge of the real blood vessel.
[0144] Embodiments of this application provide a contour extraction device for blood vessel images. Figure 20 The contour extraction device 400 for the illustrated blood vessel image includes: a processor 401, a memory 402, and a communication bus 403, wherein:
[0145] The communication bus 403 is used to realize the communication connection between the processor 401 and the memory 402.
[0146] The processor 401 is used to execute a contour extraction program for the blood vessel image stored in the memory 402 to perform the following steps:
[0147] Obtain two image matrices and a marker matrix from the blood vessel image;
[0148] Based on two image matrices, a vascular tree image is segmented from a vascular image, and a grayscale image of the vascular tree image is obtained.
[0149] Based on the grayscale image and the marker matrix of the vascular tree image, the centerline of the marked vascular segment is obtained; wherein, the centerline of the marked vascular segment includes the start and end points contained in the marker matrix;
[0150] The grayscale image of the vascular tree is binarized based on the centerline of the marked vascular segment to obtain the grayscale image of the marked vascular segment after the segmentation of the vascular segment and the background.
[0151] Using each point on the center line as the origin, the intersection of the two first normal vectors corresponding to each point with the edge of the grayscale image of the marked segment blood vessel is determined as the initial contour point, and the contour of the marked segment blood vessel is constructed based on the initial contour point.
[0152] In this embodiment of the application, the processor 401 is used to execute a contour extraction program for blood vessel images stored in the memory 402 to achieve the following steps:
[0153] Connecting the initial contour points yields two initial contours for the marked segment of the blood vessel.
[0154] Based on the vascular image, starting from each contour point in the initial contour and taking the unit normal vector on the first normal vector as the step size, the gradient of n effective points in the direction of the first normal vector is calculated; where n is a positive integer.
[0155] The maximum gradient point of each contour point on the two first normal vectors is taken as the new contour point, resulting in two corrected contours.
[0156] In this embodiment of the application, the processor 401 is used to execute a contour extraction program for blood vessel images stored in the memory 402 to achieve the following steps:
[0157] Obtain the distance between each point in the two corrected contours and the opposite point of the corresponding point in the two initial contours;
[0158] If the distance exceeds the distance threshold, the points in the two corrected contours that exceed the distance threshold are replaced with the corresponding points in the two initial contours to obtain the two optimized corrected contours.
[0159] In this embodiment of the application, the processor 401 is used to execute a contour extraction program for blood vessel images stored in the memory 402 to achieve the following steps:
[0160] Extract the edge image of blood vessels based on the blood vessel tree image;
[0161] Starting from each contour point in the two optimized and corrected contours, and taking the unit normal vector on the second normal vector corresponding to each contour point as the step size, we search whether the m valid points on the second normal vector are the blood vessel edges in the edge image; where m is a positive integer.
[0162] If the m valid points retrieved are the blood vessel edges in the edge image, replace the corresponding contour points in the two optimized and corrected contours with the m valid points retrieved to obtain two replaced contours.
[0163] In this embodiment of the application, the processor 401 is used to execute a contour extraction program for blood vessel images stored in the memory 402 to achieve the following steps:
[0164] Extract the new center lines of the two replaced contours;
[0165] Obtain the span D along the X-axis of the two replaced contours. x and the span D in the Y-axis direction y ;
[0166] If D x >D y Using the horizontal axis as the independent variable and the vertical axis as the dependent variable, a high-order polynomial fitting is performed. The contour points on the two replaced contours are substituted into the first fitting curve function to calculate the final blood vessel contour points.
[0167] If D y >D x Using the ordinate as the independent variable and the abscissa as the dependent variable, a high-order polynomial fitting is performed. The contour points on the two replaced contours are substituted into the second fitting curve function to calculate the final blood vessel contour points.
[0168] In this embodiment of the application, the processor 401 is used to execute a contour extraction program for blood vessel images stored in the memory 402 to achieve the following steps:
[0169] The two image matrices are filtered to obtain the filtered image matrix.
[0170] The filtered image matrix is then sharpened to obtain the vascular tree image.
[0171] In this embodiment of the application, the processor 401 is used to execute a contour extraction program for blood vessel images stored in the memory 402 to achieve the following steps:
[0172] The vascular tree image is represented as img1, img1 = (log I (K·img)) g ;
[0173] Where K is the sharpening matrix, I is the contrast adjustment coefficient, and g is the brightness adjustment coefficient.
[0174] The processor can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0175] The contour extraction device for blood vessel images provided in this application obtains two image matrices and a marker point matrix from the blood vessel image; based on the two image matrices, it segments a blood vessel tree image from the blood vessel image and obtains the grayscale image of the blood vessel tree image; based on the grayscale image of the blood vessel tree image and the marker point matrix, it obtains the centerline of the marked blood vessel segment; wherein the centerline of the marked blood vessel segment includes the start point and end point contained in the marker point matrix; based on the centerline of the marked blood vessel segment, it performs binarization segmentation on the grayscale image of the blood vessel tree image to obtain the grayscale image of the marked blood vessel segment after the blood vessel and background are segmented; taking each point on the centerline as the origin, it determines the intersection points of the two first normal vectors corresponding to each point with the edge of the grayscale image of the marked blood vessel segment as initial contour points, and constructs the contour of the marked blood vessel segment based on the initial contour points; that is, the contour extraction method for blood vessel images provided in this application is based on the grayscale image of the blood vessel tree image, that is, starting from the actual scene, it segments the marked blood vessel segment and the background to eliminate background interference, thus making the obtained blood vessel contour more closely fit the edge of the real blood vessel.
[0176] It should be noted that the specific implementation process of the steps executed by the processor in this embodiment can be referred to Figure 1 The implementation process of the contour extraction method for blood vessel images provided in the corresponding embodiments will not be described in detail here.
[0177] The description of the apparatus in this application is similar to that of the method embodiments described above, and has similar beneficial effects, therefore, it will not be repeated. For technical details not disclosed in this apparatus embodiment, please refer to the description of the method embodiments of this application for understanding.
[0178] This application provides a storage medium storing executable instructions. When these executable instructions are executed by a processor, they cause the processor to perform the method provided in this application, for example... Figure 1 The method shown.
[0179] The storage medium provided in this application acquires two image matrices and a marker point matrix from a blood vessel image; based on the two image matrices, it segments a blood vessel tree image from the blood vessel image and acquires the grayscale image of the blood vessel tree image; based on the grayscale image of the blood vessel tree image and the marker point matrix, it obtains the centerline of the marked blood vessel segment; wherein, the centerline of the marked blood vessel segment includes the start point and end point contained in the marker point matrix; based on the centerline of the marked blood vessel segment, it performs binarization segmentation on the grayscale image of the blood vessel tree image to obtain the grayscale image of the marked blood vessel segment after segmentation of the blood vessel and the background; taking each point on the centerline as the origin, it determines the intersection points of the two first normal vectors corresponding to each point with the edge of the grayscale image of the marked blood vessel segment as initial contour points, and constructs the contour of the marked blood vessel segment based on the initial contour points; that is, the contour extraction method of blood vessel image provided in this application is based on the grayscale image of the blood vessel tree image, that is, starting from the actual scene, it segments the marked blood vessel segment and the background to eliminate background interference, so that the obtained blood vessel contour is more in line with the edge of the real blood vessel.
[0180] In some embodiments, the storage medium may be a computer-readable storage medium, such as a ferromagnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), flash memory, magnetic surface memory, optical disc, or a compact disk-read-only memory (CD-ROM); or it may be a device that includes one or any combination of the above-mentioned memories.
[0181] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0182] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file containing other programs or data, for example, in one or more scripts within a Hyper Text Markup Language (HTL) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files storing one or more modules, subroutines, or code sections). As an example, executable instructions may be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.
[0183] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A contour extraction method of a blood vessel image, characterized by, The method comprises: obtaining two image matrices and a marker point matrix of a blood vessel image; segmenting a blood vessel tree image from the blood vessel image based on the two image matrices, and obtaining a grayscale image of the blood vessel tree image; obtaining a centerline of a marked segment blood vessel based on the grayscale image of the blood vessel tree image and the marker point matrix, wherein the centerline of the marked segment blood vessel comprises a start point and an end point contained in the marker point matrix; performing binary segmentation on the grayscale image of the blood vessel tree image based on the centerline of the marked segment blood vessel, to obtain a marked segment blood vessel grayscale image after blood vessel and background segmentation; determining two first normal vectors corresponding to each point on the centerline as the origin, and taking the intersection points of the edges of the marked segment blood vessel grayscale image as initial contour points; connecting the initial contour points to obtain two initial contours of the marked segment blood vessel; based on the blood vessel image, taking each contour point in the initial contour as a start point, and taking a unit normal vector on the first normal vector as a step size, to calculate the gradient of n effective points in the direction of the first normal vector; wherein n is a positive integer; taking the maximum gradient points of each contour point on the two first normal vectors as new contour points, to obtain two modified contours.
2. The method of claim 1, wherein, After obtaining the two modified contours, the method comprises: obtaining the distance between each point in the two modified contours and the opposite point of the corresponding point in the two initial contours; if the distance exceeds a distance threshold, replacing the points in the two modified contours that exceed the distance threshold with the corresponding points in the two initial contours, to obtain two optimized modified contours.
3. The method of claim 2, wherein, After obtaining the two optimized modified contours, the method comprises: extracting an edge image of the blood vessel based on the blood vessel tree image; taking each contour point in the two optimized modified contours as a start point, and taking a unit normal vector on the second normal vector corresponding to each contour point as a step size, to search whether m effective points on the second normal vector are blood vessel edges in the edge image; wherein m is a positive integer; if the m effective points searched are blood vessel edges in the edge image, replacing the corresponding contour points in the two optimized modified contours with the m effective points searched, to obtain two replaced contours.
4. The method of claim 3, wherein, After obtaining the two replaced contours, the method comprises: extracting a new centerline of the two replaced contours; acquiring spans in the x-axis direction and the y-axis direction of the two replaced contours and the y-axis direction ; If If the two replaced profiles are fitted with a high order polynomial with the horizontal coordinate as the independent variable and the vertical coordinate as the dependent variable, the profile points on the two replaced profiles are substituted into a first fitting curve function, and the final blood vessel profile points are calculated. If With the longitudinal coordinate as the independent variable and the transverse coordinate as the dependent variable, high-order polynomial fitting is performed, and the profile points on the two replaced profiles are substituted into the second fitting curve function to calculate the final blood vessel profile points.
5. The method according to any one of claims 1 to 4, characterized in that, the step of segmenting a blood vessel tree image from the blood vessel image based on the two image matrices comprises: performing filtering processing on the two image matrices to obtain a filtered image matrix; performing sharpening processing on the filtered image matrix to obtain the blood vessel tree image.
6. The method of claim 5, wherein, the step of performing sharpening processing on the filtered image matrix to obtain the blood vessel tree image comprises: The blood vessel tree image is characterized by ; wherein, is a sharpening matrix, I is a contrast adjustment coefficient, is a luminance adjustment coefficient.
7. A contour extraction apparatus of a blood vessel image, characterized by comprising: The device comprises: an acquisition module configured to obtain two image matrices and a marker point matrix of a blood vessel image; a processing module configured to segment a blood vessel tree image from the blood vessel image based on the two image matrices, and obtain a grayscale image of the blood vessel tree image; The processing module is configured to obtain a center line of the marked segment vessel based on the grayscale image of the vessel tree image and the marked point matrix, wherein the center line of the marked segment vessel includes a start point and an end point included in the marked point matrix. The processing module is configured to perform binaryzation segmentation on the grayscale image of the vessel tree image based on the center line of the marked segment vessel to obtain a marked segment vessel grayscale image after segmentation of the vessel and the background. The processing module is configured to determine, with each point on the center line as an origin, intersection points of the marked segment vessel grayscale image edge on two first normal vectors corresponding to the point as initial contour points, connect the initial contour points to obtain two initial contours of the marked segment vessel, and calculate gradients of n effective points in the first normal vector direction based on the vessel image, with each contour point in the initial contour as a start point and a unit normal vector on the first normal vector as a step, wherein n is a positive integer, and take maximum gradient points of each contour point on the two first normal vectors as new contour points to obtain two corrected contours.
8. A contour extraction apparatus of a blood vessel image, characterized by comprising: The contour extraction device of the vessel image comprises: a memory configured to store executable instructions; a processor configured to execute the executable instructions stored in the memory to implement the contour extraction method of the vessel image according to any one of claims 1 to 6.
9. A storage medium, characterized by executable instructions stored in the memory, when executed, are configured to cause the processor to perform the contour extraction method of the vessel image according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method and system for automatically extracting inner contour of blood vessel wall based on OCT image
CN114820678A
Method and apparatus for acquiring contour lines of blood vessel according to center line of blood vessel
WO2021097817A1