Visual tracking method for tumor interventional guidewires based on vascular imaging features
By extracting the direction angle and width variation sequence of the blood vessel centerline, and combining gradient response and overlap screening, the problem of insufficient accuracy and loss at bifurcation in guidewire visual tracking methods in complex blood vessels is solved, and stable positioning and continuous tracking of the guidewire tip are achieved.
Patent Information
- Application Number
- CN202611620869.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-20
- Publication Date
- 2026-11-17
AI Technical Summary
Existing guidewire visual tracking methods are susceptible to interference from vessel bifurcation and similar backgrounds in digital subtraction angiography images. They lack utilization of the continuous topological features of vessel segment direction and width, and the candidate guidewire segment screening and inter-frame search position prediction are unreliable, resulting in insufficient tracking accuracy and easy loss at bifurcation points.
By extracting the direction angle sequence and width change sequence of the blood vessel centerline, a topological feature vector is formed. Candidate points are screened by combining gradient response and overlap. The search starting point for the next frame is predicted by using displacement vector and motion velocity vector, which reduces the interference of blood vessel overlap and background structure and improves the stability of guidewire tip positioning.
Stable positioning and continuous tracking of the guidewire tip were achieved in complex vascular topologies, reducing interference from erroneous branches and improving the tracking accuracy and stability of the guidewire at vascular bifurcation and curvature changes.
Smart Images

Figure CN123118644A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image processing technology, specifically to a method for visual tracking of interventional guidewires for tumors based on vascular imaging features. Background Technology
[0002] In interventional oncology, digital subtraction angiography (DSA) image sequences are used for intraoperative navigation, and visual tracking of the guidewire position is a crucial step in determining the relationship between the instrument and the blood vessel. Existing guidewire tracking methods typically search for the guidewire tip or segment within a whole frame or local area based on the guidewire's grayscale, edges, texture, or geometric templates, and use motion models such as Kalman filtering and particle filtering for position prediction. Some methods also use the vessel centerline as auxiliary information to constrain the guidewire position to its vicinity.
[0003] In DSA images with dense vascular bifurcation, dramatic curvature changes, and low contrast between the guidewire and the vascular background, relying solely on the guidewire's appearance can easily lead to misidentification of vascular boundaries, bifurcation ridges, or other high-contrast structures as the guidewire, resulting in abrupt changes in the guidewire's position. Template matching-based methods are insufficiently adaptable to changes in guidewire morphology and inter-frame deformation. When the guidewire bends, rotates, or is partially obscured by the vascular system, the matching score decreases, and the tracking point may remain on the wrong branch. Conventional motion prediction methods struggle to determine which branch the guidewire enters at bifurcation points. Once the guidewire falls into the wrong branch, the subsequent trajectory will deviate from the true path. Vessel centerline-assisted methods often only utilize the local centerline position, lacking a topological description of the continuous changes in the direction and width of the vessel segment. They cannot provide stable branch determination information at bifurcation boundaries and are unable to suppress cross-branch drift of the tracking path. In local searches, the selection of candidate guidewire segments is usually based on grayscale consistency or edge intensity, lacking a measure of the degree of overlap with the vessel centerline, easily leading to the selection of non-guidewire segments in areas where the guidewire and vessel overlap.
[0004] For the reasons mentioned above, existing methods suffer from insufficient tracking accuracy, easy loss at bifurcation points, and unstable inter-frame prediction when dealing with complex vascular topology and weak guidewire contrast in tumor interventional DSA sequences. Summary of the Invention
[0005] To address the shortcomings of existing guidewire visual tracking methods in digital subtraction angiography images, such as susceptibility to interference from vascular bifurcation and similar backgrounds, lack of utilization of continuous topological features in the direction and width of vascular segments, and unreliable candidate guidewire segment selection and inter-frame search position prediction, a tumor interventional guidewire visual tracking method based on vascular image features is proposed. The method segments the vascular centerline by vascular bifurcation points, generating direction angle sequences and width change sequences, and searches for candidate points at the guidewire tip along the topological direction of the vascular segment. The method selects guidewire segments in the current frame based on their overlap with the vascular centerline, and predicts the search starting point for the next frame using displacement and velocity vectors. This results in more stable guidewire tip localization and continuous tracking results even in complex vascular topologies.
[0006] To achieve the above objectives, the present invention provides the following technical solution: The present invention provides a method for visual tracking of interventional guidewires for tumor treatment based on vascular image features, comprising: acquiring a sequence of digital subtraction angiography images; extracting the vascular centerline from the current frame image of the sequence; identifying vascular bifurcation points based on the curvature changes of the vascular centerline; dividing the vascular centerline into multiple vascular segments using the vascular bifurcation points as segmentation boundaries; calculating the orientation angle sequence and width change sequence of each vascular segment; combining these to form the topological feature vector of the vascular segment, so that the subsequent tracking process has vascular topological constraints; taking the predicted position of the guidewire tip in the previous frame image as the tracking starting point; performing a forward search along the orientation angle sequence of the vascular segment where the tracking starting point is located; and calculating the gradient magnitude and orientation angle deviation of each pixel on the search path. The product is used to mark the pixel with the largest product as a candidate point for the guidewire tip in the current frame. This prioritizes the location with strong gradient response and consistent with the blood vessel direction in tortuous and bifurcated blood vessels. A local search window is constructed centered on the candidate point. Within this local search window, a set of candidate guidewire segments is extracted. The overlap degree between each candidate segment and the blood vessel centerline is calculated. The candidate segment with the largest overlap degree is selected as the guidewire segment for the current frame to reduce the interference of blood vessel overlap and background structure on guidewire segment recognition. Based on the endpoint position and tracking start point of the guidewire segment, the displacement vector of the guidewire segment is calculated. Using this displacement vector and the motion velocity vector of the guidewire tip in the previous frame image, the initial search position of the guidewire tip in the next frame image is predicted to narrow the search range and improve the tracking stability of consecutive frames.
[0007] As a technical solution of this invention, the specific method for extracting the vessel centerline is as follows: Multi-scale Gaussian filtering is applied to the current frame image to generate filtered response images at each scale. The Hessian matrix of each pixel in each filtered response image is calculated, and the eigenvalues of the Hessian matrix are solved. Based on the ratio relationship between the eigenvalues, it is determined whether the pixel belongs to the vessel region, resulting in a binarized vessel region segmentation map. Morphological skeletonization processing is then performed on the vessel region segmentation map to extract an initial centerline skeleton with a single pixel width. The initial centerline skeleton is then connected by breaks and trimmed of burrs to obtain the vessel centerline. Multi-scale Gaussian filtering can enhance the display of vessels of different diameters. The Hessian matrix eigenvalue ratio criterion can distinguish between tubular vessel structures and speckled noise. Skeletonization processing ensures that the vessel centerline remains continuous and has a single pixel width, providing a reliable foundation for subsequent vessel segmentation and topological feature calculation.
[0008] As a technical solution of this invention, the specific method for calculating the direction angle sequence is as follows: The blood vessel segment is sampled at equal intervals along its extension direction to obtain multiple sampling points arranged in sequence. The directional angle between the two vectors formed by every three adjacent sampling points is calculated sequentially. This directional angle is used as the local direction angle value of the sampling point. The local direction angle values of all sampling points are arranged in the sampling order to form the direction angle sequence. The specific method for calculating the width variation sequence is as follows: The blood vessel segment is sampled at equal intervals along its extension direction to obtain sampling points on the blood vessel segment. A perpendicular line is drawn at each sampling point, perpendicular to the tangent direction of the blood vessel segment. The distance between the two intersection points of the perpendicular line and the boundary of the blood vessel region segmentation map is calculated. This distance is used as the blood vessel width value at the sampling point. The blood vessel width values of all sampling points are arranged in the sampling order to form the width variation sequence. The topological feature vector formed by the combination of the direction angle sequence and the width variation sequence can comprehensively describe the bending morphology and diameter variation of the blood vessel segment, providing prior information on blood vessel morphology for forward search.
[0009] As a technical solution of this invention, the specific method of forward search is as follows: starting from the tracking starting point, following the extension direction indicated by the direction angle sequence of the blood vessel segment where the tracking starting point is located, each pixel on the blood vessel segment is traversed sequentially until the end point or bifurcation point of the blood vessel segment is reached, completing one forward search process; during the traversal, the gradient magnitude of the currently traversed pixel is read, and the absolute value of the difference between the local direction angle of the currently traversed pixel and the main direction angle of the blood vessel segment at that pixel is calculated. This absolute value of the difference is taken as the direction angle deviation, and the product of the gradient magnitude and the direction angle deviation is taken as the response intensity value of the pixel. After the traversal is completed, the response intensity values of all pixels are compared, and the pixel with the largest response intensity value is taken as the candidate point. By constructing the response intensity together with the gradient magnitude and the direction angle deviation, the high gradient region outside the guidewire and the interference points with inconsistent directions in the blood vessel can be suppressed, improving the accuracy of candidate point localization.
[0010] As a technical solution of this invention, the specific method for extracting the guidewire candidate segment set is as follows: Within a local search window, the image of the window area is subjected to orientation gradient histogram statistics, and the direction with the strongest amplitude response in the orientation gradient histogram is taken as the main direction of the guidewire; along the main direction of the guidewire, starting from a candidate point, consecutive pixels with gradient amplitudes exceeding a preset threshold are searched in both the positive and negative directions of the main direction of the guidewire, and the line segment formed by the consecutive pixels is taken as a guidewire candidate segment. The process is repeated multiple times by changing the value of the preset threshold to obtain the guidewire candidate segment set. Using the orientation gradient histogram to determine the main direction of the guidewire can adapt to different postures of the guidewire in the blood vessel, and multi-threshold search can obtain candidate segments of different lengths, reducing missed detections and false detections.
[0011] As a technical solution of the present invention, the specific method for calculating the overlap is as follows: each candidate line segment in the candidate line segment set is discretized into a sequence of line segment pixels arranged in order. The number of pixels in the line segment pixel sequence that fall within the set of pixels occupied by the blood vessel centerline is counted. The number of pixels is divided by the total number of pixels in the line segment pixel sequence to obtain the overlap between the candidate line segment and the blood vessel centerline. The overlap reflects the degree of positional overlap between the candidate line segment and the blood vessel centerline. The candidate line segment with the largest overlap is selected as the guide wire line segment of the current frame. Guide wire lines located within the blood vessel lumen can be preferentially retained, while interfering line segments that deviate from the blood vessel direction are excluded.
[0012] Further preferably, during the process of discretizing candidate line segments into a sequence of line segment pixels, pixels whose absolute value of the difference between the direction angle of the candidate line segment and the local direction angle of each pixel in the line segment pixel sequence exceeds a preset angle threshold are removed from the line segment pixel sequence, and then the number of remaining pixels after removal is counted. This process can eliminate the interference of local pixels whose direction is significantly deviated from the center line of the blood vessel on the overlap calculation, making the guidewire line segment identification more directionally consistent.
[0013] As a technical solution of the present invention, the specific method for calculating the displacement vector is as follows: In the current frame image, the endpoint of the guide wire segment away from the candidate point is extracted as the end point of the guide wire segment; the corresponding position of the tracking start point in the current frame image is extracted; the coordinate offset of the end point relative to the corresponding position is calculated; and the coordinate offset is used as the displacement vector. This displacement vector reflects the actual displacement direction and distance of the guide wire segment in the current frame relative to the tracking start point in the previous frame.
[0014] As a technical solution of this invention, the specific method for predicting the initial search position is as follows: Obtain the vector sum of the displacement vector and the velocity vector of the guidewire tip in the previous frame image; use this vector sum as the motion compensation vector; read the position coordinates of the guidewire tip in the current frame image; add the position coordinates to the motion compensation vector to obtain the coordinates of the initial search position of the guidewire tip in the next frame image. The current frame displacement and the previous frame velocity jointly participate in the prediction, which can adapt to velocity changes during guidewire advancement or retraction, narrow the search range, reduce search deviations caused by velocity changes, and improve the stability of inter-frame tracking.
[0015] The technical effects and advantages provided by the present invention in the above technical solution are as follows: The vessel centerline is segmented according to bifurcation points, and the orientation angle sequence and width change sequence are extracted for each segment to form a topological feature vector. During forward search, pixels are traversed along the orientation angle sequence of the vessel segment where the tracking starting point is located. The product of the gradient magnitude and the orientation angle deviation is used as the response intensity, and the pixel with the largest response intensity is selected as the candidate point for the guidewire tip. The orientation angle sequence describes the local changes in the vessel's orientation, and the width change sequence describes the continuous contraction and expansion of the vessel lumen. Together, they constrain the search path to avoid cross-branch deviation due to local grayscale similarity. This method constrains the guidewire tip search to the continuous topological path of the vessel segment. The orientation angle deviation suppresses pixels that deviate from the vessel's orientation, and the gradient magnitude preserves the guidewire edge and local high-contrast features. Compared to searches based solely on grayscale or edge intensity, this method reduces interference from erroneous branches at vessel bifurcation and curvature changes, keeping candidate points within the extension path of the current vessel segment and adapting to continuous changes in vessel width and orientation.
[0016] A set of candidate guidewire segments is extracted within a local search window around the candidate point. The overlap degree between each candidate segment and the vessel centerline is calculated, and the candidate segment with the highest overlap degree is selected as the guidewire segment for the current frame. The overlap degree metric eliminates segments that are inconsistent with the centerline, reducing the probability of vessel wall, bifurcation ridges, and other linear artifacts being mistakenly selected as guidewires. In areas where the gray levels of the guidewire and vessel are similar and the edges are weak, the overlap degree screening still uses the centerline as a reference to avoid selecting vessel wall or noisy segments based solely on local gray level continuity. The displacement vector is obtained based on the offset between the endpoint of the guidewire segment away from the candidate point and the tracking start point. This displacement vector is then summed with the motion velocity vector of the previous frame to perform motion compensation on the head position of the current frame, obtaining the initial search position for the next frame. This prediction method integrates the current frame displacement and historical motion trends, ensuring that the search start point of the next frame is close to the actual direction of guidewire movement, reducing the initialization of erroneous branches at bifurcation points, and maintaining inter-frame tracking continuity. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0018] Figure 1 This is a flowchart of a tumor interventional guidewire visual tracking method based on vascular imaging features; Figure 2 This is a flowchart of the guidewire candidate segment extraction and screening process; Figure 3 This is a flowchart of the initial search position prediction for the guidewire tip in the next frame image; Figure 4 It is the response curve of the gradient magnitude and direction angle deviation of the pixel points on the forward search path of the guidewire; Figure 5 It is a pixel point statistical analysis and blood vessel centerline coincidence analysis after candidate guidewire segments are eliminated. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] See Figure 1This invention provides a method for visual tracking of interventional guidewires in tumor treatment based on vascular image features, comprising: acquiring a sequence of digital subtraction angiography images; extracting the vascular centerline from the current frame image of the sequence; identifying vascular bifurcation points based on the curvature changes of the vascular centerline; dividing the vascular centerline into multiple vascular segments using the bifurcation points as segmentation boundaries; calculating the orientation angle sequence and width change sequence of each vascular segment; combining these to form the topological feature vector of the vascular segment; using the predicted position of the guidewire tip in the previous frame image as the tracking starting point; performing a forward search along the orientation angle sequence of the vascular segment where the tracking starting point is located; and calculating the topological feature vector of each vascular segment along the search path. The product of the gradient magnitude and the directional angle deviation of a pixel is used to mark the pixel with the largest product as a candidate point for the guidewire tip in the current frame. A local search window is constructed with this candidate point as the center, and a set of candidate guidewire segments is extracted within this local search window. The overlap degree between each candidate segment in the set and the center line of the blood vessel is calculated, and the candidate segment with the largest overlap degree is selected as the guidewire segment for the current frame. Based on the endpoint position of the guidewire segment and the tracking starting point, the displacement vector of the guidewire segment is calculated. Using the displacement vector and the motion velocity vector of the guidewire tip in the previous frame, the initial search position of the guidewire tip in the next frame is predicted.
[0021] In a specific implementation, the step of performing multi-scale Gaussian filtering on the current frame image is as follows: Multiple Gaussian kernels with different standard deviations are convolved with the current frame image to obtain filtered response images corresponding to multiple standard deviations. In some embodiments, the Gaussian kernel standard deviation set is {1.0, 2.0, 3.0, 4.0} pixels. The basis for setting the Gaussian kernel standard deviation set to {1.0, 2.0, 3.0, 4.0} pixels is that the diameter distribution of the vessels involved in the tumor intervention guidewire in the digital subtraction angiography image covers the vessel scale range corresponding to the above standard deviations.
[0022] In practice, the Hessian matrix of each pixel in the filtered response image corresponding to each standard deviation is calculated. For each pixel position in the filtered response image corresponding to each standard deviation, the second derivative value in the horizontal direction, the second derivative value in the vertical direction, and the mixed second derivative value of the pixel position are calculated using a second-order partial derivative convolution kernel. The 2×2 Hessian matrix corresponding to the pixel position is composed of the horizontal second derivative value, the vertical second derivative value, and the mixed second derivative value.
[0023] In the specific implementation, the eigenvalues of the Hessian matrix are solved. The Jacobi method is used to decompose the 2×2 Hessian matrix corresponding to each pixel position into eigenvalues, resulting in two eigenvalues. These two eigenvalues are then sorted in descending order of their absolute values, and the eigenvalue with the larger absolute value is denoted as . The eigenvalue with the smaller absolute value is denoted as .
[0024] In practice, whether a pixel belongs to a blood vessel region is determined based on the ratio between feature values, and the determination criteria are as follows:
[0025] in, These are the eigenvalues of the Hessian matrix with larger absolute values. These are the eigenvalues of the Hessian matrix with smaller absolute values. express The absolute value, express The absolute value, The ratio threshold, Set it to 0.5. The basis for setting it to 0.5 is that the two eigenvalues of the Hessian matrix in the vascular region have significant differences, while the two eigenvalues of the Hessian matrix in the non-vascular region have similar amplitudes.
[0026] If the two feature values corresponding to a pixel position satisfy If the condition is met, the pixel location is marked as a blood vessel region; otherwise, it is marked as a non-blood vessel region. The same judgment is performed on the filtered response image corresponding to each standard deviation, resulting in a binary blood vessel region candidate image for each standard deviation. A pixel-by-pixel logical OR operation is performed on the binary blood vessel region candidate images corresponding to multiple standard deviations to obtain a blood vessel region segmentation image.
[0027] In the specific implementation, morphological skeletonization is performed on the blood vessel region segmentation map. A morphological thinning algorithm based on 3×3 neighborhood is used to examine each foreground pixel in the blood vessel region segmentation map. For each foreground pixel, it is determined whether deleting the foreground pixel changes the connectivity of the foreground region, and whether the foreground pixel is an endpoint. If deleting the foreground pixel does not change the connectivity of the foreground region and the foreground pixel is not an endpoint, then the foreground pixel is deleted. The judgment and deletion operations are repeated until no foreground pixels are deleted, resulting in an initial centerline skeleton with a width of one pixel.
[0028] In practice, the initial centerline skeleton is broken and connected. All endpoints in the initial centerline skeleton are detected. For each endpoint, another endpoint or skeleton segment is detected within a 5-pixel range. If another endpoint or skeleton segment is detected, and the connecting line segment does not cross non-vascular areas, the endpoint is connected to the detected other endpoint or skeleton segment. The endpoint detection distance threshold of 5 pixels is set because the breaks in the vascular centerline in digital subtraction angiography images are caused by discontinuities in the segmentation of local vascular regions, and the break interval does not exceed 5 pixels.
[0029] In practice, spiking is performed on the initial centerline skeleton. The length of each branch in the initial centerline skeleton is calculated. If the branch length is less than 5 pixels, the branch is deleted as a spiking element. The branch length threshold of 5 pixels is set based on the fact that the length of skeleton branches caused by noise in digital subtraction angiography images is less than 5 pixels.
[0030] In practice, the vascular segment is sampled at equal intervals along its extension direction. The sampling step size is set to 5 pixels. The rationale for setting the sampling step size to 5 pixels is that the local directional change scale of the vascular centerline in digital subtraction angiography images is greater than 5 pixels. Using a step size of 5 pixels can capture directional changes while avoiding noise interference.
[0031] Multiple sampling points are obtained in sequence. For three adjacent sampling points, the directional angle between the two vectors formed by the three adjacent sampling points is calculated sequentially. Specifically, the coordinates of the first, second, and third sampling points are taken. The first directional vector is formed by pointing from the first sampling point coordinates to the second sampling point coordinates, and the second directional vector is formed by pointing from the second sampling point coordinates to the third sampling point coordinates. The angle between the first and second directional vectors is calculated. This angle is used as the local directional angle value of the second sampling point. The local directional angle values of all sampling points are arranged in the order of the sampling points to form a directional angle sequence. For the endpoints of the vessel segment that lack three adjacent sampling points, the local directional angle value is not calculated. The length of the directional angle sequence is 2 less than the number of sampling points in the vessel segment.
[0032] In practice, the blood vessel segment is sampled at equal intervals along its extension direction to obtain sampling points on the segment. The sampling step size is the same as that used in the direction angle sequence calculation, which is 5 pixels. The coordinates of the sampling points are consistent with those used in the direction angle sequence calculation.
[0033] For each sampling point, a perpendicular line is drawn at the sampling point, perpendicular to the tangent direction of the vessel segment. The tangent direction of the vessel segment is determined by the local direction of the centerline of the vessel segment adjacent to the sampling point. The direction of the straight line connecting one adjacent sampling point before and after the sampling point is used as the tangent direction of the vessel segment, and a straight line segment perpendicular to the tangent direction of the vessel segment is drawn. The perpendicular line intersects the boundary of the vessel region segmentation map, obtaining two intersection points. The distance between the two intersection points of the perpendicular line and the boundary of the vessel region segmentation map is calculated using the following formula:
[0034] in, Indicates the first The blood vessel width value at each sampling point The sampling point number, The value range is from 1 to the total number of sampling points; Indicates the first The horizontal coordinate of the first intersection point between the vertical line at each sampling point and the boundary of the blood vessel region segmentation map. Indicates the first The vertical coordinates of the first intersection point between the vertical line at each sampling point and the boundary of the blood vessel region segmentation map; Indicates the first The horizontal coordinate of the second intersection point between the vertical line at each sampling point and the boundary of the blood vessel region segmentation map. Indicates the first The vertical coordinates of the second intersection point between the vertical line at each sampling point and the boundary of the blood vessel region segmentation map are determined by sorting the first and second intersection points in ascending order of their vertical pixel coordinates.
[0035] The distance between two intersection points is taken as the vessel width value at the sampling point. All vessel width values at the sampling points are arranged in order to form a width variation sequence. The length of the width variation sequence is the same as the number of sampling points on the vessel segment.
[0036] In practice, the predicted position of the guidewire tip in the previous frame image is used as the tracking starting point. The coordinates of the tracking starting point are the corresponding coordinates of the predicted position of the guidewire tip in the previous frame image in the current frame image. Starting from the tracking starting point, a forward search is performed along the extension direction indicated by the direction angle sequence of the blood vessel segment where the tracking starting point is located. The direction angle sequence of the blood vessel segment where the tracking starting point is located is calculated in Example 2. The local direction angle values in the direction angle sequence are arranged according to the sampling order, which is the extension direction of the blood vessel segment where the tracking starting point is located.
[0037] During the forward search, the starting point is taken as the current traversal position. Moving forward one pixel step according to the pixel order of the centerline of the vessel segment where the starting point is located, the coordinates of the currently traversed pixel are obtained. The direction angle sequence indicates the extension direction along the centerline of the vessel segment where the starting point is located, pointing from the starting point to the end point of the vessel segment. It continuously checks whether the currently traversed pixel is the end point or a bifurcation point of the vessel segment where the starting point is located. If the coordinates of the currently traversed pixel coincide with the coordinates of any bifurcation point in the set of vessel bifurcation point coordinates, or if the currently traversed pixel is the last centerline pixel on the vessel segment where the starting point is located, the traversal stops, and one forward search cycle is completed.
[0038] During the traversal, the gradient magnitude of the currently traversed pixel is read. The gradient magnitude of the currently traversed pixel is obtained by calculating the first-order difference in the horizontal and vertical directions at the position of the currently traversed pixel in the current frame image. Specifically, a horizontal Sobel convolution kernel is performed with the current frame image to obtain a horizontal gradient map; a vertical Sobel convolution kernel is performed with the current frame image to obtain a vertical gradient map; the horizontal gradient value at the position of the currently traversed pixel is read from the horizontal gradient map; the vertical gradient value at the position of the currently traversed pixel is read from the vertical gradient map; and the square root of the sum of the squares of the horizontal and vertical gradient values is calculated to obtain the gradient magnitude of the currently traversed pixel.
[0039] During the traversal, the orientation angle deviation of the currently traversed pixel is calculated. The local orientation angle of the currently traversed pixel is obtained by reading the local orientation angle value corresponding to the sampling point closest to the currently traversed pixel position in the orientation angle sequence of the blood vessel segment where the tracking start point is located. The principal orientation angle of the blood vessel segment where the tracking start point is located at the currently traversed pixel position is determined by the tangent direction of the blood vessel centerline at the currently traversed pixel position. The tangent direction is calculated by the vector direction formed by the two centerline points adjacent to the currently traversed pixel on the blood vessel centerline. The absolute value of the difference between the local orientation angle of the currently traversed pixel and the principal orientation angle of the blood vessel segment where the tracking start point is located at the currently traversed pixel position is taken as the orientation angle deviation of the currently traversed pixel.
[0040] During the traversal, the gradient magnitude of the currently traversed pixel is multiplied by the direction angle deviation to obtain the response intensity value of the currently traversed pixel. The response intensity value is calculated using the following formula:
[0041] in, Indicates the first The response intensity value of each pixel. This represents the index of the pixel encountered during the forward search. The value range is from 1 to the total number of pixels traversed during the forward search; Indicates the first Gradient magnitude of each pixel; Indicates the first The orientation angle deviation of the nth pixel is the orientation angle deviation of the nth pixel. The local orientation angle of each pixel and the blood vessel segment where the tracking starting point is located at the [number]th [pixel ... The absolute value of the difference between the principal direction angles at each pixel.
[0042] During the traversal, the response intensity value of each pixel is recorded in the response intensity list, along with the coordinates of each pixel. After the traversal is complete, the maximum value is found in the response intensity list, and the pixel coordinates corresponding to the maximum value are used as candidate point coordinates for the current frame's guide wire tip. If the maximum value in the response intensity list corresponds to multiple pixel coordinates, the pixel coordinates closest to the tracking start point coordinates are selected as candidate point coordinates for the current frame's guide wire tip.
[0043] See Figure 4 In the graph, the horizontal axis represents the index of the pixel on the forward search path, the left side of the vertical axis corresponds to the gradient magnitude and response intensity value, and the right side of the vertical axis corresponds to the directional angle deviation (in degrees). The curves include the gradient magnitude curve (blue solid line with dots), the response intensity value curve (orange dashed line with squares), and the directional angle deviation curve (green dotted line with triangles).
[0044] As the pixel number increases, the gradient amplitude curve remains relatively low and stable, ranging from approximately 1 to 3, indicating that the gradient amplitude is small in most areas of the vascular segment and the edge features are not obvious. The orientation angle deviation curve and the response intensity curve, however, show significant fluctuations, reflecting the impact of changes in the vascular centerline orientation on the angle deviation and response intensity.
[0045] At approximately position 200, the orientation angle deviation curve shows its first significant peak, approaching 75 degrees. Simultaneously, the response intensity value also rises significantly to over 20, indicating a substantial deflection of the blood vessel orientation at that location, leading to localized angle deviation and enhanced response. Subsequently, both the orientation angle deviation and response intensity decrease, entering a relatively stable phase.
[0046] At approximately position 300, the directional angle deviation reaches its peak, exceeding 35 degrees. Simultaneously, the response intensity value reaches its maximum peak, exceeding 100. The gradient amplitude also shows a slight increase at this point, indicating that this is a vascular bifurcation point or a region of significant structural change, exhibiting strong gradient and directional angle deviation responses, which is beneficial for determining candidate points at the guidewire tip.
[0047] After exceeding sequence number 350, all three curves gradually decreased to a lower level, indicating that the vascular structure tends to be straighter and the gradient response weakens after the forward search path moves away from the vascular bifurcation point. The directional angle deviation also decreases accordingly, and the response intensity value decreases as a result.
[0048] In specific implementation, please refer to Figure 2 A local search window is constructed centered on the candidate point at the tip of the guidewire in the current frame. The size of the local search window is set to 40×40 pixels. The reason for setting the size of the local search window to 40×40 pixels is that the extension length of the candidate guidewire segment in the image does not exceed 40 pixels, the local search window can completely contain the candidate segment, and at the same time suppress interference from distant blood vessel areas.
[0049] Within the local search window, the image region is statistically analyzed using histograms of directional gradients. The image region within the local search window is divided into 16 units (4 rows, 4 columns), each unit measuring 10×10 pixels. For each pixel within each unit, the first-order difference in the horizontal and vertical directions is calculated, yielding the pixel's gradient magnitude and direction. The pixel gradient direction is quantized into 9 directional intervals, each 20 degrees wide. For all pixels within each unit, the gradient magnitude is accumulated into the corresponding histogram bar based on the directional interval where the pixel's gradient direction falls. The 16 units are combined into one block, and the histogram within the block is normalized to obtain the statistical results of the histogram of directional gradients. The center angle corresponding to the directional interval with the largest histogram bar height in the histogram of directional gradients is taken as the main direction of the guidewire.
[0050] Along the main direction of the guidewire, starting from the candidate point at the guidewire tip in the current frame, consecutive pixels with gradient magnitudes exceeding a preset gradient threshold are searched in both the forward and reverse directions of the main direction of the guidewire. The preset gradient threshold set is set to... ,in This represents the maximum gradient magnitude within the local search window. The preset gradient threshold set is set to the above 5 values based on the fact that the gradient magnitude in the guidewire edge region is concentrated in the range of 30% to 70% of the maximum local gradient magnitude. Different preset gradient thresholds can extract guidewire candidate segments with different response intensities.
[0051] For each preset gradient threshold in the preset gradient threshold set, perform the following operations: Starting from the candidate point at the head of the current frame guide wire, move pixel by pixel along the positive direction of the guide wire, checking whether the gradient magnitude of each pixel exceeds the current preset gradient threshold. If it exceeds the current preset gradient threshold, continue moving until a pixel with a gradient magnitude not exceeding the current preset gradient threshold is encountered or the local search window boundary is reached. Record the set of continuous pixels from the candidate point at the head of the current frame guide wire to the termination pixel as a continuous pixel segment in the positive direction; Starting from the candidate point at the head of the current frame guide wire, move pixel by pixel along the positive direction... The guide wire moves pixel by pixel in the opposite direction of the main direction, checking whether the gradient magnitude of each pixel exceeds the current preset gradient threshold. If it exceeds the current preset gradient threshold, it continues to move until it encounters a pixel whose gradient magnitude does not exceed the current preset gradient threshold or reaches the boundary of the local search window. A set of consecutive pixels from the candidate point at the beginning of the guide wire in the current frame to the terminal pixel is recorded as a consecutive pixel segment in the opposite direction. This consecutive pixel segment in the opposite direction is reversed and then sequentially concatenated with the consecutive pixel segment in the forward direction to obtain a candidate line segment composed of consecutive pixels. This candidate line segment is used as a guide wire candidate line segment. The above operation is repeated for each preset gradient threshold in the preset gradient threshold set, resulting in a total of 5 guide wire candidate line segments, forming a guide wire candidate line segment set.
[0052] In practice, each candidate line segment in the guide wire candidate segment set is discretized into a sequence of line segment pixels arranged in order. Specifically, starting from one endpoint of a candidate line segment, the coordinates of each pixel on the candidate line segment are extracted sequentially according to the pixel connection order, forming a line segment pixel sequence. The first element in the line segment pixel sequence is the pixel coordinate of one endpoint of the candidate line segment, the last element is the pixel coordinate of the other endpoint of the candidate line segment, and the intermediate elements are arranged in order according to the extension direction of the candidate line segment.
[0053] For each candidate line segment, obtain the direction angle of the candidate line segment. The direction angle of the candidate line segment is calculated from the coordinates of the two endpoints of the candidate line segment: calculate the vector between the coordinates of the endpoint of the candidate line segment away from the current frame guide wire head and the coordinates of the endpoint of the candidate line segment close to the current frame guide wire head, and calculate the angle between this vector and the horizontal direction, which is taken as the direction angle of the candidate line segment.
[0054] For each pixel in the line segment pixel sequence, find the blood vessel centerline pixel closest to the line segment pixel coordinates in the set of pixel positions occupied by the blood vessel centerline. The set of pixel positions occupied by the blood vessel centerline is the set of coordinates of all pixels of the blood vessel centerline obtained in Example 1. Read the local direction angle value corresponding to the found nearest blood vessel centerline pixel. The local direction angle value corresponding to the nearest blood vessel centerline pixel is obtained from the blood vessel segment direction angle sequence obtained in Example 2: determine the blood vessel segment to which the nearest blood vessel centerline pixel belongs, find the sampling point closest to the position of the nearest blood vessel centerline pixel in the direction angle sequence of the blood vessel segment, and read the local direction angle value corresponding to the sampling point as the local direction angle of the line segment pixel.
[0055] Calculate the absolute value of the difference between the orientation angle of the candidate line segment and the local orientation angle of each pixel in the line segment's pixel sequence. If the absolute value of the difference exceeds a preset angle threshold, the pixel is removed from the line segment's pixel sequence. The preset angle threshold is set to 30 degrees. The reason for setting the preset angle threshold to 30 degrees is that when the deviation between the guidewire and the blood vessel centerline exceeds 30 degrees, the guidewire and the blood vessel centerline do not have directional consistency at that pixel, and that pixel is not included in the overlap statistics.
[0056] After the removal process, the remaining pixels in the line segment pixel sequence are counted. For each pixel coordinate in the remaining pixel sequence, it is determined whether the pixel coordinate exists in the pixel position set occupied by the vessel centerline. If it exists, the number of pixels falling into the pixel position set occupied by the vessel centerline is incremented by 1. The total number of pixels in the remaining pixel sequence after removal is counted. The number of pixels falling into the pixel position set occupied by the vessel centerline is divided by the total number of pixels in the remaining pixel sequence after removal to obtain the overlap degree between the candidate line segment and the vessel centerline. The overlap degree is calculated using the following formula:
[0057] in, Indicates the first The degree of overlap between the candidate line segments and the center line of the blood vessel. The candidate line segment number. The value range is from 1 to the total number of candidate segments in the guide wire candidate segment set; Indicates the first The number of pixels that fall into the set of pixel positions occupied by the center line of the blood vessel after the candidate line segments are removed; Indicates the first The number of pixels remaining after candidate line segments are removed.
[0058] In practice, each candidate segment in the guidewire candidate segment set is discretized, eliminated, and statistically analyzed to obtain the overlap degree between each candidate segment and the vessel centerline. The overlap degree values of all candidate segments in the guidewire candidate segment set are compared, and the candidate segment with the highest overlap degree value is selected as the guidewire segment for the current frame. If there are multiple candidate segments with the highest overlap degree value, the longest candidate segment among them is selected as the guidewire segment for the current frame.
[0059] See Figure 5 The figure shows the pixel statistics of 5 candidate segments in the candidate guidewire segment set constructed in the above embodiment. The horizontal axis represents the sequence number of the candidate segment, ranging from 1 to 5; the vertical axis represents the number of pixels, in units of total pixels. The blue solid bars correspond to the total number of pixels remaining after removing those with angle deviations exceeding a preset threshold, and the orange striped bars correspond to the number of pixels that fall into the pixel position set occupied by the blood vessel centerline after removal.
[0060] As shown in the figure, the total number of remaining pixels after elimination gradually decreases as the candidate line segment number increases from 1 to 5, from approximately 460 to approximately 300, indicating that the length or continuity of the extracted guidewire segments varies under different gradient thresholds. The number of pixels falling within the vessel centerline also decreases synchronously, from approximately 420 to approximately 270, indicating that shorter candidate line segments correspond to fewer pixels overlapping with the vessel centerline.
[0061] In the figure, the total number of pixels after removing each candidate line segment is greater than the number of pixels that fall within the vessel centerline, which conforms to the logic that the numerator should not exceed the denominator in the overlap calculation. Candidate line segment 1 has the highest overlap, indicating that its line segment pixels have the best directional consistency with the vessel centerline. The overlap gradually decreases and the trend is stable, verifying that the method of using the direction angle threshold to remove non-overlapping pixels effectively improves the matching accuracy between the guidewire candidate line segments and the vessel centerline.
[0062] In specific implementation, please refer to Figure 3 In the current frame image, the endpoint of the guide wire segment in the current frame that is furthest from the candidate point at the guide wire tip is extracted, and this extracted endpoint is taken as the end point of the guide wire segment. The guide wire segment in the current frame is the candidate segment with the highest overlap in the above embodiment. The guide wire segment in the current frame has two endpoints, one of which is close to the candidate point at the guide wire tip, and the other endpoint is furthest from the candidate point at the guide wire tip. The coordinates of the endpoint furthest from the candidate point at the guide wire tip are taken as the coordinates of the end point of the guide wire segment.
[0063] In practice, the position of the tracking starting point in the current frame image is extracted. The tracking starting point is the predicted position of the guidewire tip in the previous frame image, and the coordinates of the corresponding position of the tracking starting point in the current frame image are the same as the predicted position coordinates of the guidewire tip in the previous frame image. The horizontal and vertical coordinates of the tracking starting point are read.
[0064] In practice, the coordinate offset of the end point of the guide wire segment relative to the tracking start point in the current frame image is calculated. The horizontal component of the coordinate offset is the horizontal coordinate of the end point of the guide wire segment minus the horizontal coordinate of the corresponding position of the tracking start point in the current frame image. The vertical component of the coordinate offset is the vertical coordinate of the end point of the guide wire segment minus the vertical coordinate of the corresponding position of the tracking start point in the current frame image. The coordinate offset is used as a displacement vector.
[0065] In practice, the velocity vector of the guidewire tip in the previous frame image is obtained. This velocity vector is calculated and saved at the end of the previous frame processing. Specifically, the velocity vector is obtained as follows: the velocity vector of the guidewire tip in the previous frame image is equal to the position coordinates of the guidewire tip in the previous frame image minus the position coordinates of the guidewire tip in the frame before that. Subtraction is performed on both the horizontal and vertical coordinate components to obtain the horizontal and vertical velocity components. If no previous frame image exists, the velocity vector of the guidewire tip in the previous frame image is set to zero, with both the horizontal and vertical velocity components set to 0.
[0066] In practice, the sum of the displacement vector and the velocity vector of the guidewire tip in the previous frame is obtained, and this sum is used as the motion compensation vector. The calculation method for the sum is as follows: the horizontal component of the motion compensation vector equals the horizontal component of the displacement vector plus the horizontal component of the velocity vector of the guidewire tip in the previous frame; the vertical component of the motion compensation vector equals the vertical component of the displacement vector plus the vertical component of the velocity vector of the guidewire tip in the previous frame.
[0067] In practice, the position coordinates of the guidewire tip in the current frame image are read. These position coordinates are the candidate point coordinates for the guidewire tip in the current frame. The position coordinates of the guidewire tip in the current frame image are added to the motion compensation vector to obtain the coordinates of the initial search position of the guidewire tip in the next frame image. The addition method is as follows: the horizontal component of the initial search position coordinates of the guidewire tip in the next frame image is equal to the horizontal component of the position coordinates of the guidewire tip in the current frame image plus the horizontal component of the motion compensation vector; the vertical component of the initial search position coordinates of the guidewire tip in the next frame image is equal to the vertical component of the position coordinates of the guidewire tip in the current frame image plus the vertical component of the motion compensation vector.
[0068] The coordinates of the initial search position of the guidewire tip in the next frame image are predicted using the following formula:
[0069] in, The coordinate vector representing the initial search position of the guidewire tip in the next frame image is composed of the horizontal and vertical coordinate components of the initial search position of the guidewire tip in the next frame image. It represents the position coordinate vector of the guide wire tip in the current frame image, which is composed of the horizontal and vertical coordinate components of the candidate point coordinates of the guide wire tip in the current frame image; The coordinate vector representing the end point of the guide wire segment is composed of the horizontal and vertical coordinate components of the end point of the guide wire segment. The coordinate vector representing the position of the tracking start point in the current frame image is composed of the horizontal and vertical coordinate components of the corresponding position of the tracking start point in the current frame image. This represents the displacement vector, and the horizontal component of the displacement vector is... Subtract the horizontal coordinate components The horizontal coordinate components are obtained from the vertical components of the displacement vector. Subtract the vertical coordinate components The vertical coordinate components are obtained; This represents the velocity vector of the guidewire tip in the previous frame image, which consists of the horizontal and vertical velocity components of the velocity vector of the guidewire tip in the previous frame image. In the formula, the vectors are added in the manner of adding horizontal components to horizontal components and vertical components to vertical components respectively.
[0070] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for visual tracking of interventional guidewires in tumor intervention based on vascular imaging features, characterized in that, include: Acquire a sequence of digital subtraction angiography images, extract the vessel centerline from the current frame image of the sequence, and identify vessel bifurcation points based on the curvature change of the vessel centerline; Using the bifurcation point of the blood vessel as the dividing boundary, the centerline of the blood vessel is divided into multiple segments. The direction angle sequence and width change sequence of each segment are calculated and combined to form the topological feature vector of the segment. The predicted position of the guidewire tip in the previous frame image is used as the starting point for tracking. A forward search is performed along the direction angle sequence of the blood vessel segment where the tracking starting point is located. The product of the gradient magnitude and the direction angle deviation of each pixel on the search path is calculated. The pixel with the largest product is marked as the candidate point of the guidewire tip in the current frame. A local search window is constructed with the candidate point as the center. Within the local search window, a set of candidate guidewire segments is extracted. The overlap between each candidate segment in the set and the center line of the blood vessel is calculated. The candidate segment with the largest overlap is selected as the guidewire segment of the current frame. Based on the endpoint position of the guidewire segment and the tracking start point, the displacement vector of the guidewire segment is calculated. Using the displacement vector and the velocity vector of the guidewire tip in the previous frame image, the initial search position of the guidewire tip in the next frame image is predicted.
2. The method for visual tracking of tumor interventional guidewires based on vascular imaging features according to claim 1, characterized in that, In the step of acquiring a digital subtraction angiography image sequence, extracting the vessel centerline from the current frame image of the sequence, and identifying vessel bifurcation points based on the curvature change of the vessel centerline, the specific method for extracting the vessel centerline is as follows: Multi-scale Gaussian filtering is applied to the current frame image to generate filtered response images at each scale. The Hessian matrix of each pixel in each filtered response image is calculated, and the eigenvalues of the Hessian matrix are solved. Based on the ratio relationship between the eigenvalues, it is determined whether the pixel belongs to the blood vessel region, and a binarized blood vessel region segmentation map is obtained. The morphological skeletonization process was performed on the segmented image of the blood vessel region. An initial centerline skeleton with a single pixel width was extracted. Then, the initial centerline skeleton was connected by breakpoints and trimmed by burrs to obtain the centerline of the blood vessel.
3. The method for visual tracking of interventional guidewires for tumor intervention based on vascular imaging features according to claim 1, characterized in that, In the step of calculating the orientation angle sequence and width change sequence of each blood vessel segment separately and combining them to form the topological feature vector of that blood vessel segment, the specific method for calculating the orientation angle sequence is as follows: The blood vessel segment is sampled at equal intervals along its extension direction to obtain multiple sampling points arranged in sequence. The directional angle between the two vectors formed by every three adjacent sampling points is calculated in turn. This directional angle is used as the local directional angle value of the sampling point. The local directional angle values of all sampling points are arranged in the sampling order to form the directional angle sequence.
4. The method for visual tracking of tumor interventional guidewires based on vascular imaging features according to claim 3, characterized in that, In the step of calculating the orientation angle sequence and width change sequence of each blood vessel segment separately and combining them to form the topological feature vector of that blood vessel segment, the specific method for calculating the width change sequence is as follows: The blood vessel segment is sampled at equal intervals along its extension direction to obtain sampling points on the segment. A perpendicular line is drawn at each sampling point to the tangent of the blood vessel segment. The distance between the two intersection points of the perpendicular line and the boundary of the blood vessel region segmentation map is calculated. This distance is used as the blood vessel width value at the sampling point. The blood vessel width values of all sampling points are arranged in the sampling order to form the width variation sequence.
5. The method for visual tracking of interventional guidewires for tumor intervention based on vascular imaging features according to claim 1, characterized in that, In the step of calculating the product of the gradient magnitude and the direction angle deviation of each pixel on the search path, and marking the pixel with the largest product as a candidate point at the guide wire head of the current frame, the specific method for performing the forward search is as follows: Starting from the tracing starting point, following the extension direction indicated by the direction angle sequence of the blood vessel segment where the tracing starting point is located, traverse each pixel point on the blood vessel segment in turn until the end point of the blood vessel segment or the blood vessel bifurcation point is reached, thus completing one forward search process. During the traversal, the gradient magnitude of the currently traversed pixel is read, and the absolute value of the difference between the local direction angle of the currently traversed pixel and the main direction angle of the blood vessel segment at the pixel is calculated. This absolute value of the difference is taken as the direction angle deviation, and the product of the gradient magnitude and the direction angle deviation is taken as the response intensity value of the pixel. After the traversal is completed, the response intensity values of all pixels are compared, and the pixel with the largest response intensity value is taken as the candidate point.
6. The method for visual tracking of interventional guidewires for tumor treatment based on vascular imaging features according to claim 1, characterized in that, In the step of constructing a local search window centered on the candidate point and extracting the set of candidate guidewire segments within the local search window, the specific method for extracting the set of candidate guidewire segments is as follows: Within this local search window, the image of this window area is subjected to orientation gradient histogram statistics, and the direction with the strongest amplitude response in the orientation gradient histogram is taken as the main direction of the guidewire. Starting from the candidate point, search for consecutive pixels along the main direction of the guidewire in both the positive and negative directions where the gradient magnitude exceeds a preset threshold. The line segment formed by the consecutive pixels is taken as a candidate line segment of the guidewire. Repeat the process multiple times by changing the value of the preset threshold to obtain the set of candidate line segments of the guidewire.
7. The method for visual tracking of interventional guidewires for tumor intervention based on vascular imaging features according to claim 6, characterized in that, In the step of calculating the overlap degree between each candidate segment in the candidate guidewire segment set and the centerline of the blood vessel, and selecting the candidate segment with the largest overlap degree as the guidewire segment of the current frame, the specific method for calculating the overlap degree is as follows: Each candidate line segment in the candidate line segment set is discretized into a sequence of line segment pixels arranged in order. The number of pixels in the line segment pixel sequence that fall within the set of pixels occupied by the blood vessel centerline is counted. The number of pixels is divided by the total number of pixels in the line segment pixel sequence to obtain the overlap between the candidate line segment and the blood vessel centerline.
8. The method for visual tracking of interventional guidewires for tumor intervention based on vascular imaging features according to claim 1, characterized in that, In the step of calculating the displacement vector of the guidewire segment based on the endpoint position of the guidewire segment and the tracking starting point, the specific method for calculating the displacement vector of the guidewire segment is as follows: In the current frame image, the endpoint of the guide wire segment away from the candidate point is extracted as the end point of the guide wire segment. The corresponding position of the tracking start point in the current frame image is extracted. The coordinate offset of the end point relative to the corresponding position is calculated, and the coordinate offset is used as the displacement vector.
9. The method for visual tracking of interventional guidewires for tumor intervention based on vascular imaging features according to claim 8, characterized in that, In the step of predicting the initial search position of the guidewire tip in the next frame image using the displacement vector and the motion velocity vector of the guidewire tip in the previous frame image, the specific method for predicting the initial search position is as follows: Obtain the vector sum of the displacement vector and the motion velocity vector of the guidewire tip in the previous frame image. Use this vector sum as the motion compensation vector. Read the position coordinates of the guidewire tip in the current frame image. Add the position coordinates to the motion compensation vector to obtain the coordinates of the initial search position of the guidewire tip in the next frame image.
10. The method for visual tracking of tumor interventional guidewires based on vascular imaging features according to claim 7, characterized in that, In the step of discretizing each candidate line segment in the candidate line segment set into a sequence of line segment pixels arranged in order, pixels whose absolute value of the difference between the direction angle of the candidate line segment and the local direction angle of each pixel in the line segment pixel sequence exceeds a preset angle threshold are removed from the line segment pixel sequence, and then the number of pixels remaining after removal is counted.
