Catheter positioning method and system based on image recognition

By establishing a main orientation angle distribution map and grayscale change trend constraints in catheter images, the problem of insufficient path continuity in catheter identification is solved, and the coherence and structural integrity of catheter localization are improved.

CN121582340APending Publication Date: 2026-02-27TONGXUAN (HANGZHOU) MEDICAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511764079.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing technologies are insufficient in depicting pixel orientation trends and regional direction details in duct recognition, resulting in the duct region being identified as multiple unconnected segments. Path judgment is affected by the fracture zone, leading to deviation in direction and insufficient path continuity, which weakens the overall coherence of duct structure reconstruction.

Method used

By extracting the grayscale variation amplitude of each pixel in the duct image, a main direction angle distribution map is established. Pixel sequences are formed by filtering for directional continuity and angular stability. Edge orientation is classified and linear trajectory is matched. Combined with directional and grayscale trend constraints between adjacent point segments, a duct trajectory set is formed to ensure path continuity and the integrity of the spatial structure.

Benefits of technology

In image regions with complex textures or frequent structural changes, maintaining the coherence of path derivation and the integrity of spatial structure reduces path drift and structural breakpoints, thereby improving the accuracy and continuity of duct localization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121582340A_ABST
    Figure CN121582340A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image recognition, in particular to a catheter positioning method and system based on image recognition, and the method comprises the steps: extracting multi-direction gray changes from a catheter image, generating main direction angle mapping, comparing adjacent pixel directions to form an edge continuous set, recognizing the trend, matching direction textures, and extracting an extension path. And constructing a connected node chain by screening directions and gray features, and connecting node coordinates to generate a catheter positioning path set. According to the method, a main direction angle distribution diagram is constructed through multi-direction gray scale changes, the edge trend with extension features is extracted through direction continuity and angle stability, linear track classification is completed through direction texture comparison, a coherent node link is obtained through synchronous constraint of direction and gray scale trend, and the linear track classification is completed. A conduit track set with direction correlation and node connection is formed through spatial serialization, path derivation continuity and spatial structure integrity are kept in an area with complex texture or frequent structure change, and the phenomena of trend drift and path jump are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image recognition, in particular to a catheter positioning method and system based on image recognition. BACKGROUND

[0002] The technical field of image recognition includes the process of detecting, recognizing and analyzing the target in a static image or video sequence by using computer vision and image processing methods. The core content includes image acquisition, preprocessing, feature extraction, pattern matching and classification decision, and the purpose is to convert the information contained in the image into structured data that can be understood and analyzed by the computer. It is widely used in medical imaging analysis, face recognition, industrial detection, traffic monitoring and biometric identification. In the application of medical image recognition, convolutional neural networks are often used to learn features and recognize targets from images, thereby assisting in diagnosis or navigation operations.

[0003] Among them, the catheter positioning method based on image recognition refers to using the image features of the catheter in the medical image data, acquiring the position image of the catheter in the body through the image acquisition device, using the trained convolutional neural network model to recognize and segment the edge features and morphological features of the catheter in the image, and calculating the spatial position coordinates and orientation information of the catheter according to the recognition result, covering image acquisition, feature extraction based on convolutional neural network, catheter target region segmentation and catheter position calculation based on geometric calculation. Multiple steps. Avoid relying on complex physical models, mainly relying on image feature learning and position mapping strategy to complete automatic positioning of the catheter.

[0004] The prior art relies on overall feature learning for catheter recognition, which is insufficient in describing the direction trend of pixels and the details of the region trend. In the region with dense texture or uneven gray scale distribution, the edge response may be attenuated, causing the catheter region to be recognized as multiple disconnected fragments, affecting the path judgment and causing the trend to deviate, lacking stable support for the local direction relationship in the extension structure of the catheter, and thus the node association is loose and the path continuity is insufficient, weakening the overall coherence of the catheter structure reconstruction. SUMMARY

[0005] In order to solve the technical problems existing in the prior art, the embodiments of the present application provide a catheter positioning method and system based on image recognition. The technical solution is as follows: The catheter positioning method based on image recognition comprises the following steps: S1: Extract the gray scale change amplitude of each pixel in the horizontal, vertical and diagonal directions from the catheter image, replace the direction angle with the highest change amplitude with the main direction angle of the pixel, and place the main direction angle and the pixel coordinates side by side into the direction mapping sequence to obtain the direction dominant pixel distribution map; S2: calling the pixel main direction angle in the direction dominant pixel distribution map, comparing the pixel main direction angle with its adjacent pixel main direction angle item by item, putting the pixels with stable direction angle change amplitude into the same direction sequence to obtain an edge direction continuous pixel set; S3: based on the continuous pixel sequence in the edge direction continuous pixel set, comparing the direction angle change amplitudes of adjacent pixels in turn, comparing the pixel string list with consistent direction with the direction texture of the linear region in the image, extracting the pixel string list with consistent direction, and obtaining a catheter structure extension path group; S4: calling each path direction point in the catheter structure extension path group, comparing the direction vectors between adjacent point positions in segments, putting the point segments with continuous direction vectors into the same path, and cross-checking the point segments with stable gray change trend and the direction continuous point segments to obtain a catheter connected node path chain.

[0006] As a further scheme of the application, the direction dominant pixel distribution map includes pixel main direction angle distribution, direction angle and pixel position mapping relationship, local dominant direction angle information, the edge direction continuous pixel set includes direction angle change stable section, continuous edge response sequence, direction consistency pixel chain, the catheter structure extension path group includes direction consistent trajectory set, linear region corresponding path, direction texture matching result, and the catheter connected node path chain includes continuous direction vector point segment, gray trend stable point segment and structure connected node pair.

[0007] As a further scheme of the application, the S1 acquisition step is: S101: based on the gray value of each pixel in the catheter image, extracting the gray change amplitude between adjacent pixels in the horizontal direction, vertical direction and two diagonal directions respectively, comparing the gray change amplitudes in the four directions, selecting the direction angle with the largest gray change amplitude as the dominant direction angle, and obtaining the dominant direction angle data column; S102: according to each direction angle value in the dominant direction angle data column and the corresponding pixel space coordinates, performing information pairing, mapping and associating the paired direction angle and pixel coordinates according to the image scanning order to obtain a direction angle pixel pairing set; S103: calling the direction angle value and pixel coordinate position in the direction angle pixel pairing set, filling the direction angle value into the corresponding area in the image matrix according to the original pixel space layout of the catheter image, and obtaining a direction dominant pixel distribution map.

[0008] As a further scheme of the application, the S2 acquisition step is: S201: call each group of pixel direction angle data in the direction dominant pixel distribution map, one by one extract the corresponding direction angle and its adjacent pixel direction angle for each pixel position in the image, and arrange the direction angle data of the corresponding pixel position in turn, obtain the direction angle comparison sequence; S202: according to each group of direction angle values in the direction angle comparison sequence, compare the change amplitude between adjacent direction angles item by item, concentrate the direction angle positions with stable continuous change amplitude according to the image space order, output the corresponding pixel position set, and obtain the stable change pixel position column; S203: call the pixel coordinate data in the stable change pixel position column, extract the corresponding direction angle data in each group of pixel positions and divide the boundary according to the space adjacent relationship, extract the pixel set with continuous direction according to the attribution of each group of direction angles, and obtain the edge direction continuous pixel set.

[0009] As a further scheme of the application, the obtaining step S3 is: S301: based on the continuous pixel sequence in the edge direction continuous pixel set, extract the direction angle value on the adjacent pixel position, compare the change amplitude of the front and rear direction angles in turn according to the pixel space distribution order, extract the corresponding pixel index in the section with stable continuous change, and obtain the direction continuous pixel index group; S302: call each index sequence in the direction continuous pixel index group, extract the linear texture direction information of the corresponding position from the image area, compare each group of direction angle values with the corresponding texture direction one by one, screen the pixel sequence with consistent direction, and obtain the strike matching pixel sequence set; S303: according to the space connection relationship and direction feature of each pixel in the strike matching pixel sequence set, expand the connection path in the image space according to the direction sequence, and track the space of the same direction continuous pixel area, and obtain the catheter structure extension path group.

[0010] As a further scheme of the application, the obtaining step S4 is: S401: based on the path direction point position in the catheter structure extension path group, extract the direction vector corresponding to the adjacent point position, compare the direction strike of the front and rear vectors in turn according to the linear order of the path, screen the point position interval with stable direction change in the continuous section, and obtain the direction continuous point section set; S402: call each point section index in the direction continuous point section set, extract the gray value sequence of the corresponding position from the image gray matrix, monitor the gray value change trend according to the point section order, arrange the point sections with stable change trend in parallel, and obtain the gray trend stable point section sequence; S403: According to the point segment data in the gray trend stable point segment sequence and the direction continuous point segment set, bidirectional comparison is performed on the two types of point segments according to the spatial position and index sequence, a path segment sequence with both direction continuity and gray stability is extracted, and a catheter communication node path chain is obtained.

[0011] As a further scheme of the present application, the method further comprises: S5: Based on the node sequence in the catheter communication node path chain, the node coordinates are sequentially connected along the link to form a catheter spatial trajectory, the spatial positions of the nodes in the trajectory are sequentially included in the path set, and a catheter structure positioning path set is obtained. The catheter structure positioning path set comprises a node spatial coordinate sequence, a path chain connection sequence, and a catheter three-dimensional spatial trajectory.

[0012] As a further scheme of the present application, the obtaining step S5 is: S501: Based on the node sequence in the catheter communication node path chain, the coordinate values corresponding to the continuous nodes are extracted, the adjacent coordinates are sequentially connected in the order of the link, the point sequence with spatial continuity is formed by sequentially extending along the coordinate points in the image space, and a catheter spatial trajectory sequence is obtained. S502: The coordinate data in the catheter spatial trajectory sequence is called, the coordinate index is sequentially extracted according to the point connection sequence, the spatial positions of the points are included in the path index set, the path distribution content is extracted in combination with the structure direction information of the corresponding area in the image, and a catheter structure positioning path set is obtained.

[0013] A catheter positioning system based on image recognition, the system comprises: A main direction angle recognition module extracts the gray scale change amplitudes of each pixel in the horizontal, vertical and diagonal directions from the catheter image, replaces the direction angle with the highest change amplitude as the main direction angle of the pixel, and places the main direction angle and the pixel coordinates side by side in the direction mapping sequence to obtain a direction dominant pixel distribution map. An edge pixel extraction module compares the main direction angle of a pixel with the main direction angles of its adjacent pixels one by one, puts the pixels with stable direction angle change amplitudes into the same direction sequence, takes the direction sequence as the edge response source, and obtains an edge direction continuous pixel set. A catheter path extraction module based on the continuous pixel sequence in the edge direction continuous pixel set, compares the direction angles of adjacent pixels, classifies the trajectories with stable direction angle changes into the same trend, compares the trend direction with the direction texture of the linear region in the image one by one, classifies the trajectories with the same trend into the catheter structure path, and obtains a catheter structure extension path group. A node link identification module calls each path direction point in the catheter structure extension path group, compares the direction vectors between adjacent point segments, includes the point segments with continuous direction vectors into the same path, cross-checks the point segments with stable gray change trend and the direction continuous point segments, and obtains a catheter connected node path chain. A catheter trajectory generation module connects the node coordinates along the chain based on the node sequence in the catheter connected node path chain to form a catheter space trajectory, and sequentially includes the spatial positions of each node in the trajectory into a path set to obtain a catheter structure positioning path set.

[0014] The technical scheme provided by the embodiment of the application has at least the following beneficial effects: In the application, the main direction angle distribution map is established through multi-direction gray change, the pixel sequence formed through the filtering of direction continuity and angle stability presents an edge direction with extension characteristics, the linear trajectory is classified through comparison with the direction texture, the node link with coherence is obtained through the common constraint of the direction and gray trend between adjacent point segments, the catheter trajectory set with direction correlation, node connection and path extension characteristics is formed through spatial sequencing, the coherence of path derivation and the integrity of spatial structure are maintained in the image area with complex texture or frequent structure change, and the phenomena of direction drift, structure breakpoint and path jump are reduced. BRIEF DESCRIPTION OF DRAWINGS

[0015] Figure 1 The method flowchart of the application is shown in the following figure. Figure 2 The acquisition flowchart of the direction dominant pixel distribution map of the application is shown in the following figure. Figure 3 The acquisition flowchart of the edge direction continuous pixel set of the application is shown in the following figure. Figure 4 The acquisition flowchart of the catheter structure extension path group of the application is shown in the following figure. Figure 5 The acquisition flowchart of the catheter connected node path chain of the application is shown in the following figure. Figure 6 The acquisition flowchart of the catheter structure positioning path set of the application is shown in the following figure. DETAILED DESCRIPTION

[0016] The technical scheme in the application will be described below with reference to the accompanying drawings.

[0017] In the embodiments of the present application, the words such as "exemplary", "for example", etc. are used to represent an example, illustration, or description. Any embodiment or design scheme described as "exemplary" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the word "exemplary" is intended to present the concept in a specific manner. In addition, in the embodiments of the present application, the meaning expressed by "and / or" can be both, or can be one of the two.

[0018] In the embodiments of the present application, "image" and "picture" can be used interchangeably at times, and it should be pointed out that their meanings are consistent when their distinction is not emphasized. "Of", "corresponding" and "corresponding" can be used interchangeably at times, and it should be pointed out that their meanings are consistent when their distinction is not emphasized.

[0019] In the embodiments of the present application, sometimes the subscript such as W1 can be written in the form of non-subscript such as W1, and their meanings are consistent when their distinction is not emphasized.

[0020] In order to make the technical problems, technical schemes and advantages to be solved by the present application more clear, the following will be described in detail with reference to the drawings and specific embodiments.

[0021] Please refer to Figure 1 The present application provides a technical scheme: a catheter positioning method based on image recognition, comprising the following steps: S1: Extracting the gray level change amplitudes of each pixel in the horizontal, vertical and diagonal directions from the catheter image, replacing the direction angle with the highest change amplitude with the main direction angle of the pixel, and placing the main direction angle and the pixel coordinates side by side into a direction mapping sequence to obtain a direction dominant pixel distribution map; S2: Calling the main direction angle of the pixel in the direction dominant pixel distribution map, comparing the main direction angle of the pixel with the main direction angle of its adjacent pixel item by item, placing the pixels with stable direction angle change amplitudes into the same direction sequence, taking the direction sequence as the edge response source, and obtaining an edge direction continuous pixel set; S3: Based on the continuous pixel sequence in the edge direction continuous pixel set, comparing the direction angles of adjacent pixels, grouping the trajectories with stable direction angle changes into the same trend, comparing the trend direction with the direction texture of the linear region in the image one by one, grouping the trajectories with consistent trends into the catheter structure path, and obtaining a catheter structure extension path group; S4: Calling each path direction point in the catheter structure extension path group, comparing the direction vectors between adjacent point segments, grouping the point segments with continuous direction vectors into the same path, and cross-screening the point segments with stable gray level change trends and the direction continuous point segments to obtain a catheter connected node path chain. S5: Based on the node order in the path chain of the duct connection node, the node coordinates are connected sequentially along the link to form the duct spatial trajectory. The spatial positions of each node in the trajectory are listed in the path set in order to obtain the duct structure positioning path set.

[0022] The dominant pixel distribution map includes the distribution of pixel dominant orientation angles, the mapping relationship between orientation angles and pixel positions, and local dominant orientation angle information. The set of continuous pixels in the edge direction includes stable segments of orientation angle changes, continuous edge response sequences, and orientation-consistent pixel chains. The conduit structure extension path group includes a set of directionally consistent trajectories, corresponding paths of linear regions, and orientation texture matching results. The conduit connected node path chain includes continuous orientation vector point segments, grayscale trend stable point segments, and structural connected node pairs. The conduit structure positioning path set includes node spatial coordinate sequences, path chain connection order, and conduit three-dimensional spatial trajectory.

[0023] Please see Figure 2 The steps to obtain S1 are as follows: S101: Based on the gray value of each pixel in the duct image, extract the gray value change amplitude between adjacent pixels in the horizontal direction, vertical direction and two diagonal directions respectively. Compare the gray value change amplitude in the four directions, select the direction angle with the largest gray value change amplitude as the dominant direction angle, and obtain the dominant direction angle data column. First, the gray value and the corresponding spatial coordinate position of each pixel point are recorded by scanning line by line in the catheter image, and the gray value of the surrounding adjacent pixels of the pixel is extracted. The extraction operation extracts the gray values of the pixels on the left and right sides of the current pixel in the horizontal direction, the gray values of the pixels above and below in the vertical direction, the gray values of the pixels at the upper right and lower left positions in the main diagonal direction, and the gray values of the pixels at the upper left and lower right positions in the sub-diagonal direction. After the gray collection is completed, the gray difference amplitude of each direction between the adjacent pixels and the current pixel is calculated, and the gray change amplitude in the four directions is compared and judged one by one. The numerical value of the gray value change amplitude in the four directions is compared one by one, and the angle corresponding to the direction with the largest numerical value is selected as the dominant direction angle of the current pixel point. For example, when analyzing a catheter image, if the gray difference on the right side of pixel A is 30, the up and down direction is 10, the main diagonal is 25, and the sub-diagonal is 15, the dominant direction angle is determined to be the horizontal direction, and the dominant direction angle value is recorded as 0 degrees. If there are multiple directions with equal gray changes and all are the maximum, further judgment is made on whether the continuous pixels in the direction have consistent characteristics. If there is a continuous region with the same gray jump trend in the direction, the direction is selected as the dominant direction angle. In order to ensure that the noise region does not participate in the dominant angle judgment, the change judgment threshold is set to a fixed value, and when the gray change amplitude is less than the threshold, the direction change is ignored. The value can be set to 20 according to the background and edge contrast sample image of the catheter image. If the gray change amplitude of all directions is less than the threshold value, the pixel is not assigned a dominant direction angle. The dominant direction angle data column is obtained by judging all the pixels in the image one by one.

[0024] S102: According to each direction angle value in the dominant direction angle data column and the corresponding pixel spatial coordinates, the paired direction angle and pixel coordinates are mapped and associated according to the image scanning order to obtain a direction angle pixel pairing set. The dominant direction angle value of each pixel in the image is extracted and combined with the row and column coordinates of the position to form paired information, and a corresponding item with coordinates as index and direction angle as value is formed. The scanning order is according to the pixel arrangement structure in the image, and the scanning is performed row by row from left to right and from top to bottom. When the dominant direction angle of each pixel in the image is paired with the coordinates, a direction angle pixel pairing set is constructed. The set records the specific value of the direction angle at each pixel position in the image. In the process, for the pixel points with missing direction angles, null values are used to mark, and in the subsequent processing, invalid data is skipped. The set can be constructed as a two-dimensional list structure, where each row corresponds to the direction angle record of a row of pixels in the image, and each column corresponds to a column of pixels, ensuring that the mapping of the dominant direction angle data is consistent with the original structure of the image. In practice, for example, when processing a 512x512 resolution catheter image, the final direction angle pixel pairing set is a 512x512 direction angle matrix, where each element is the dominant direction angle value of the current pixel, with a unit of angle degrees, which can take one of 0, 45, 90, and 135.

[0025] S103: The direction angle value in the direction angle pixel pairing set is called, and the direction angle value is filled into the corresponding area of the image matrix according to the original pixel space layout of the catheter image, to obtain a direction dominant pixel distribution map; A blank matrix with the same size as the original image is created as the filling target, and then each group of paired information in the direction angle pixel pairing set is read in turn, and the direction angle value is written into the image matrix at the corresponding coordinate position. If the current paired value is a missing or invalid direction angle, the null value is temporarily retained, and the surrounding known direction angles can be used to complete it later. In the completion process, the null value pixel position is traversed, the direction angle values of the adjacent pixels above, below, left and right are found, and if the adjacent direction angles are not significantly different and the direction consistency meets the preset condition, the average value of the neighborhood direction angles is used as the completion value. If the direction angles are too different, the null value is retained to avoid the propagation of false information. The direction consistency can be set to a maximum allowed difference angle of 10 degrees. If at least three of the four adjacent direction angles fall within a similar angle range, such as between 40 and 50 degrees, they are considered to be consistent in direction, and the average value of the adjacent angles is used to complete the pixel direction angle. For example, pixel B has no direction angle, and the direction angle values of the adjacent pixels above, below, left and right are 42 degrees, 41 degrees, 43 degrees and 40 degrees. Since the differences are within the allowed range, the average value of 41.5 degrees is used as the completion value and written into B point. The filling process continues until each position in the image has a direction angle value, and a complete direction dominant pixel distribution map is finally obtained. The gray value of each pixel in the map is the corresponding direction angle value.

[0026] Please refer to Figure 3 , the acquisition step of S2 is: S201: Call each group of pixel direction angle data in the direction dominant pixel distribution map, and extract the corresponding direction angle and its adjacent pixel direction angle for each pixel position in the image one by one, and arrange the direction angle data of the corresponding pixel position in sequence, and obtain the direction angle comparison sequence; The direction angle information of the current pixel is read one by one in the row and column scanning order in the image, and the spatial position coordinates are located, then the direction angle data of the adjacent pixels in the left, right, up and down directions are extracted respectively on the basis of the position, if there are edge pixels or null positions, the current pixel is skipped and the next pixel point is scanned, for each valid pixel point, the direction angle of the pixel itself is obtained first, then the direction angles of the adjacent four directions are obtained in sequence, and they are arranged in a direction angle sequence from left to right and from top to bottom to form the comparison sequence item corresponding to the pixel, in the actual image, for example, when the pixel position is (150, 250), the direction angle is 90 degrees, the left neighbor is 90 degrees, the right neighbor is 90 degrees, the upper neighbor is 45 degrees, and the lower neighbor is 90 degrees, then the comparison sequence is [90, 90, 90, 45, 90], all such sequence information of the pixel points is extracted continuously according to the scanning order, and the complete direction angle comparison sequence is constructed, and the arrangement order of the elements in the sequence is consistent, so as to ensure the accuracy of the position correlation in the subsequent processing, after the sequence construction is completed, all the direction angle comparison sequences are stored in a group of data sets, which are the basic data sources for subsequent change trend identification, and the direction angle comparison sequence is obtained.

[0027] S202: According to the direction angle values in the direction angle comparison sequence, compare the change amplitudes between adjacent direction angles item by item, and concentrate the direction angle positions with stable continuous change amplitudes according to the image space order, output the corresponding pixel position set, and obtain the stable change pixel position column; The direction angle data items in each group of sequences are read in sequence, and a pair-by-pair comparison operation is performed on adjacent two direction angles in the current sequence. The comparison process is to judge the difference between the latter direction angle value and the former direction angle value. If the absolute value of the angle difference is within the set change tolerance range, it is marked as stable change. The tolerance value is set to 10 degrees. When a plurality of direction angles continuously appear to satisfy the change condition, it is determined as a stable change paragraph. The comparison sequence of each pixel point is executed in the image scanning process, and the number of direction angles that continuously satisfy the condition is counted. When there are three or more adjacent direction angles in the direction angle sequence of a certain group of pixels that satisfy the stable change condition, the pixel position is marked as a stable change pixel. The pixel coordinates of this type are collected in groups according to the original image arrangement order to form a stable change pixel position set. For example, the direction angle comparison sequence of pixel (100, 100) is [90, 90, 90, 85, 90], wherein the difference between 90, 90, 90 and 90 is within 5, which satisfies the stable change condition. Since the continuous number reaches three, the pixel is determined as a stable change point and added to the set. In order to avoid noise interference, if the change of a certain adjacent angle exceeds 20 degrees, the judgment is immediately interrupted, and the current pixel is skipped. After scanning the entire image, the complete stable change pixel position column is obtained.

[0028] S203: Call the pixel coordinate data in the stable change pixel position column, extract the corresponding direction angle data in each group of pixel positions, and divide the boundaries according to the spatial proximity relationship. According to the direction angle belonging, the direction continuous pixel set is extracted to obtain the edge direction continuous pixel set. The direction angle corresponding to each group of pixels is re-extracted, and the relative relationship between it and the adjacent pixels in the image space is judged. In the up, down, left and right directions of each stable pixel point, it is judged whether there is another pixel point belonging to the same stable change column. If there is, it is judged whether the direction angle is within a similar range, for example, the difference is within 15 degrees. According to the judgment result, the adjacent pixel points are classified. If a plurality of continuous pixels have similar direction angles and are directly adjacent in space, the pixels are classified into the same direction continuous set. In order to ensure that the boundary division does not appear to be faulted, the minimum number of continuous pixels is set to 5 during processing. The continuous direction pixel group below this number does not participate in the set construction. For example, the five pixels at positions (200, 300), (200, 301), (200, 302), (200, 303) and (200, 304) in the image have direction angles of 90 degrees and are adjacent. Therefore, the five pixels together constitute a group of edge direction continuous pixel set. If an empty pixel or a pixel point with a large direction angle jump is encountered during the judgment process, the continuous classification judgment of the direction is stopped, and the judgment of a new set area is started from the next position. After all the pixel points in the stable change position column are traversed, the edge direction continuous pixel set is obtained.

[0029] Referring to Figure 4 , the obtaining step of S3 is: S301: Based on the continuous pixel sequence in the edge direction continuous pixel set, the direction angle value at the adjacent pixel position is extracted, the amplitude of the change of the front and rear direction angles is compared in sequence according to the pixel space distribution order, the corresponding pixel index is extracted in the section where the continuous change remains stable, and the direction continuous pixel index group is obtained; Read each group of constructed direction continuous pixel sequence, arrange the pixels in sequence according to their position in the image space, then extract the position coordinates and corresponding direction angle value between each pair of adjacent pixels, judge the extraction order to sort the scanning order of the pixels in the row and column, ensure the continuity of the direction angles of the adjacent pixels, then perform difference value judgment operation on the direction angles of any two adjacent pixels in each group, if the difference value is within the set direction angle change amplitude threshold range, mark the current pixel as a direction consistent item, the threshold is selected according to the angle jump characteristics in the catheter image, generally set to within 15 degrees, if the adjacent direction angle change value in a group is within this range for multiple times in succession, and the continuous number reaches three groups or more, add the index values of the continuous pixel positions to the current direction continuous index group, in actual operation, for example, the direction angles of the pixel points in a certain direction sequence are 45, 45, 50, 50, 55, 60, 60, 60, 75, and 80, the direction angle changes slowly from 45 to 60 in this sequence, which is within the set change range, therefore the indexes corresponding to these positions from the 0th to the 7th can be determined as direction continuous indexes, the index group is saved as a group of results, and the above extraction, comparison, and judgment process is repeated in all edge direction continuous pixel sets, finally forming multiple direction continuous pixel index groups that meet the angle stability condition.

[0030] S302: Call each group of index sequences in the direction continuous pixel index group, extract the linear texture direction information at the corresponding position from the image area, compare each group of direction angle values with the corresponding texture direction one by one, screen out the direction consistent pixel sequence, and obtain the strike matching pixel sequence set; The pixel coordinates corresponding to the recorded index positions in each group are extracted from the original image in turn, and the actual regions of the corresponding image positions are repositioned based on these coordinates, and the linear texture direction information of the positions is extracted from the image regions. The texture direction information is obtained by statistically analyzing the gray arrangement trend in a certain range around the current pixel. For example, if the gray scale is arranged in a certain direction and presents a monotonic change trend in a 5x5 neighborhood around the current pixel, the direction is taken as the texture direction. The judgment of the direction needs to exclude the interference of noise points, so the gray fluctuation limit value is set to 10. If the gray gradient continuously exceeds the range, the direction is invalid. Then, the dominant direction angle value of the current pixel is compared with the extracted texture direction angle, and it is judged whether the angle difference is within the preset consistent direction range. The direction consistency judgment angle threshold is set to 20 degrees. When the difference between the dominant direction of a pixel and the texture direction is within the range, the pixel position is recorded and marked as a direction consistent pixel. The comparison process is continued along the index sequence. When more than three pixels in a sequence satisfy the direction consistency condition, the pixel sequence is saved as a strike matching sequence. For example, in a certain index group, the pixel direction angles of positions 2, 3, 4 and 5 are 90 degrees, and the corresponding texture directions are 92, 88, 90 and 91 degrees. The four are within the error threshold range, so the pixels corresponding to the four indexes constitute a group of strike matching pixel sequence. After processing all index groups, a plurality of direction consistent pixel sequence sets are formed, and a strike matching pixel sequence set is obtained.

[0031] S303: According to the spatial connection relationship and direction characteristics of each group of pixels in the strike matching pixel sequence set, the connection path is expanded in the image space according to the direction sequence, and the spatial tracking is performed on the continuous pixel region with the same direction, so as to obtain a catheter structure extension path group. The spatial coordinates of the pixel points in each group of the matching sequence are extracted one by one, and it is judged whether the position relationship of the pixel points in the image is continuous arrangement. If the coordinates of two adjacent pixels only differ by one unit, it is indicated that the two pixels are directly connected in the image, and it is further judged whether the direction angle values of the two adjacent pixels are in the same direction segment. The same direction segment is defined as the direction angle being in the same quadrant and differing by no more than 15 degrees. When the spatial connection relationship and the direction continuity judgment conditions are satisfied, the connection path between the pixels is established. The path is extended pixel by pixel in the direction indicated by the dominant direction angle. In the extension process, the spatial position difference and the direction angle change of each newly added pixel and the previous pixel are judged. If any of the two does not satisfy the above conditions, the current path extension is terminated, and the current connected pixel is recorded as a path. The path tracking process is repeated when the next group of sequences is processed. In actual application, for example, starting from the position (100, 100) with a direction angle of 90 degrees, the path is extended to (101, 100), (102, 100) and other positions. If the direction angles are 91 and 89 degrees respectively and adjacent to the position of the previous pixel, the path is continuously tracked. If the angle at (104, 100) is 120 degrees, the path is not tracked in this direction, the path segment is terminated, and the path segment is added to the catheter extension path set. Finally, the path results obtained by extending the path according to the direction angle of all the matching pixel sequences in the image space are output, and the catheter structure extension path group is obtained.

[0032] Referring to Figure 5 , the acquisition step S4 is: S401: Based on the path direction points in the catheter structure extension path group, the direction vectors corresponding to adjacent points are extracted. The direction vectors are compared in sequence according to the linear order of the path, and the point intervals with stable direction changes in the continuous segment are screened out to obtain a direction continuous point segment set. The point coordinate and the corresponding direction angle value recorded in each path in the spatial arrangement order are read, and then for each pair of adjacent points, a corresponding direction vector is constructed according to the coordinate difference, the direction vector is pointed from the starting point coordinate to the ending point coordinate, and is combined with the direction angle value one by one to complete the construction of the direction vector of the continuous points in all paths. After the direction vector sequence in each path is compared, the direction angle difference between the two adjacent direction vectors is extracted, and if the angle difference is within the set direction change tolerance range, it is marked as consistent. The tolerance range is set to not more than 20 degrees, which is used to limit the direction jump amplitude. The minimum length threshold of the continuous segment is set to 5 points in the screening process. If the number of points that meet the direction consistency condition is less than 5, the segment is not counted as an effective paragraph. For the point segment that meets the condition, the starting and ending index positions are recorded and included in the direction continuous point segment set. In actual application, if the direction angle of the continuous points in a path is 90, 91, 92, 89, 90, 88, 87, and 86, the angle change is always within the tolerance range, and the continuous length reaches 8 points. Therefore, the segment is completely extracted and saved as a direction continuous point segment. Finally, after the above comparison operation is performed on all path groups, the direction continuous point segment set is obtained.

[0033] S402: Call the point segment index in the direction continuous point segment set, extract the gray value sequence of the corresponding position from the image gray matrix, monitor the gray value change trend according to the point segment order, and output the point segments with stable change trend in parallel to obtain the gray trend stable point segment sequence. For the point index sequence recorded in each segment, the gray value of the corresponding pixel position is read from the original image gray matrix in sequence to construct a gray value sequence. Then, the gray values of any two adjacent pixels in the gray sequence are compared item by item to judge the change amplitude between the adjacent gray values. If the continuous change amplitude is always within the preset gray fluctuation threshold, it is marked as a stable gray change segment. The threshold is set to within 10 gray levels according to the texture characteristics of the catheter edge, and if the number of pixels that meet the stable gray condition continuously exceeds the set threshold, the segment is determined as a gray trend stable segment. The minimum continuous stable segment length is set to 5 pixels. In actual processing, if the gray sequence corresponding to a segment index is 150, 152, 151, 149, 150, 151, 148, 147, and 150, and the difference between any adjacent gray values is not more than 5, and the total length is greater than 5, the stable condition is met. The segment is completely included in the gray trend stable point segment sequence. If a mutation point occurs in a segment, such as a single-point gray jump of more than 20 levels, the current segment is not included in the effective sequence, and the detection starts again from the next point that meets the condition. Finally, multiple gray change stable point segments are extracted from the direction continuous point segment set, output in parallel, and the gray trend stable point segment sequence is obtained.

[0034] S403: According to the gray trend stable point segment sequence and the point segment data in the direction continuous point segment set, bidirectional comparison is performed on the two types of point segments according to the spatial position and index order, the path segment sequence with both direction continuity and gray stability is extracted, and the catheter connected node path chain is obtained; The start and end indexes and spatial coordinate positions of each group of direction continuous point segments and each group of gray stable point segments are extracted, then one-to-one comparison is performed on the two types of point segments, whether there is spatial position overlap in the start and end index range is judged, if the start and end indexes of a direction segment are completely contained in the range of a gray segment, or the overlapping part exceeds 60% of the number of points, the overlapping part is taken as the path segment meeting the bidirectional condition, the position matching judgment is performed based on the spatial coordinates in the screening process, the corresponding coordinate positions of the overlapping part are extracted and a new path segment is constructed, the minimum matching segment length is set to 5 pixels, if it is lower than this length, it is not included in the connected node judgment range, in actual processing, for example, the direction continuous point segment index is [100, 101, 102, 103, 104, 105], the gray stable point segment index is [98, 99, 100, 101, 102, 103, 104, 105, 106], the former is completely contained in the latter, so the segment is determined as a connected segment with double conditions, all point coordinates of the segment are extracted and arranged in index order to form a complete path chain, the path chain is the catheter connected node path chain, finally, through the above bidirectional matching method, the catheter connected node path chain meeting the double conditions of direction continuity and gray stability is obtained.

[0035] Please refer to Figure 6 , the obtaining step of S5 is: S501: Based on the node order in the catheter connected node path chain, the coordinate values corresponding to the continuous nodes are extracted, the adjacent coordinates are connected in turn according to the link order, the point sequence with spatial continuity is formed by sequentially extending along the coordinate points in the image space, and the catheter spatial trajectory sequence is obtained. All pixel coordinate values in the node set are read in order from each path chain, and the physical positions of all coordinate points in the image space are recorded in the order from front to back. For each pair of consecutive nodes, the horizontal and vertical coordinates are extracted in turn, and it is judged whether they differ by only one pixel unit in one direction. If this condition is met, the two points are determined to be directly connected point pairs. Then the connected point pairs are logically connected, and the connection method is in the form of coordinate connection. The terminal coordinates of the first point and the starting coordinates of the second point are directly spliced to construct a complete path segment. Then the splicing process is repeated for all point pairs in the path chain to form a connected chain composed of consecutive pixel coordinate points. The chain extends in order from the starting to the ending in the path chain, and does not allow the existence of jump or broken sections. If more than two pixel units are found between two points during the coordinate splicing process, the connection segment is not included, and the broken position is recorded for subsequent path reconstruction and troubleshooting. In addition, to avoid image edge interference, an image boundary buffer limit is set, and coordinate points located within two pixels of the image edge boundary are not extracted as valid trajectory starting points. In actual operation, if the coordinates in a path chain are (100, 100), (101, 100), (102, 100), and (103, 101), the first three points form a straight line path, and the last point forms an oblique jump with the first point due to direction deviation. At this time, the first three points will form an effective connection segment, and the fourth point will be marked as a path direction starting point due to inconsistent jump direction. After the whole is extended in this way, a set of catheter path point sequences with spatial coherence and accurate coordinate order is obtained, and the catheter spatial trajectory sequence is obtained.

[0036] S502: Call the coordinate data in the catheter spatial trajectory sequence, extract the coordinate index in order according to the point connection order, and include the spatial position of each point in the path index set. Extract the path distribution content in combination with the structure direction information of the corresponding area in the image to obtain the catheter structure positioning path set. The coordinate points arranged in sequence in each track sequence are read, and each point is sequentially assigned a unique index value in the sequence, which is recorded as the logical position of the spatial position in the path, and a mapping relationship between the index value and its corresponding coordinates is established for subsequent tracking processing. Then, the actual coordinate position corresponding to each index value in the image is located, and based on the area position of the coordinate in the original image structure, the structural direction information corresponding to the area is extracted. The structural direction information is looked up in the dominant direction angle matrix obtained through previous calculation. Each coordinate point will correspond to a direction angle value, which is bound and recorded with the track point direction. Then, the direction information of all points in each track is combined to form the structural direction distribution of the entire path segment. If the direction angles of multiple points in a certain track segment are found to be in the same interval, such as all 90 degrees or all 45 degrees, it can be marked as a direction consistent segment. If there are multiple direction mixed areas, they are recorded as direction mixed segments. Further, the path is divided into different structural paragraphs according to the overall trend of the path. The start and end positions of the structural paragraphs are located by the mutation points of the direction angles. In an actual example, if the point indexes in the track sequence are 0 to 19, and the corresponding coordinate direction angles remain 90 degrees from index 0 to index 9, and mutate to 135 degrees after index 10, then 0 to 9 is divided into a first structural segment, and 10 to 19 is divided into a second structural segment. At the same time, all points are uniformly numbered according to the path number and index order, a path index set is constructed, and structural direction data records are attached. After the above steps, the catheter structure positioning path set is obtained.

[0037] The catheter positioning system based on image recognition includes: The main direction angle recognition module extracts the gray scale change amplitude of each pixel in the horizontal, vertical and diagonal directions from the catheter image, replaces the direction angle with the highest change amplitude with the main direction angle of the pixel, and places the main direction angle and the pixel coordinates side by side in the direction mapping sequence to obtain a direction dominant pixel distribution map. The edge pixel extraction module compares the main direction angle of a pixel with the main direction angles of its adjacent pixels one by one, puts the pixels with stable direction angle change amplitude into the same direction sequence, and obtains an edge direction continuous pixel set using the direction sequence as the edge response source. The catheter path extraction module compares the direction angles of adjacent pixels based on the continuous pixel sequence in the edge direction continuous pixel set, classifies the tracks with stable direction angle change into the same trend, compares the trend direction with the direction texture of the linear region in the image one by one, classifies the tracks with consistent trend into the catheter structure path, and obtains a catheter structure extension path group. A node link identification module calls each path direction point in the conduit structure extension path group, compares the direction vectors between adjacent point positions, includes point segments with continuous direction vectors in the same path, cross-checks point segments with stable gray change trends and direction continuous point segments, and obtains a conduit connected node path chain; A conduit trajectory generation module connects node coordinates along the chain based on the node sequence in the conduit connected node path chain to form a conduit space trajectory, and sequentially includes the spatial positions of each node in the trajectory into a path set to obtain a conduit structure positioning path set.

[0038] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A catheter localization method based on image recognition, characterized in that, Includes the following steps: S1: Extract the grayscale variation amplitude of each pixel in the horizontal, vertical and diagonal directions from the duct image, replace the direction angle with the highest variation amplitude with the main direction angle of the pixel, and put the main direction angle and the pixel coordinates into the direction mapping sequence to obtain the direction-dominant pixel distribution map. S2: Call the pixel main direction angle in the dominant pixel distribution map, compare the pixel main direction angle with the main direction angle of its neighboring pixels one by one, and put the pixels whose direction angle changes are stable into the same direction sequence to obtain a set of continuous pixels in the edge direction. S3: Based on the continuous pixel sequence in the continuous pixel set of the edge direction, the change amplitude of the direction angle of adjacent pixels is compared in turn. The pixel string with the same direction direction is compared with the direction texture of the linear region in the image. The pixel string with the same direction direction is extracted to obtain the duct structure extension path group. S4: Call the path direction points in the extended path group of the catheter structure, compare the direction vectors between adjacent points segment by segment, include the point segments with continuous direction vectors into the same path, and cross-screen the point segments with stable gray scale change trends and the point segments with continuous directions to obtain the catheter connection node path chain.

2. The catheter localization method based on image recognition according to claim 1, characterized in that: The dominant pixel distribution map includes the distribution of pixel main orientation angles, the mapping relationship between orientation angles and pixel positions, and local dominant orientation angle information. The set of continuous pixels in the edge direction includes stable segments of orientation angle changes, continuous edge response sequences, and orientation-consistent pixel chains. The conduit structure extension path group includes a set of directionally consistent trajectories, corresponding paths of linear regions, and orientation texture matching results. The conduit connected node path chain includes continuous orientation vector point segments, grayscale trend stable point segments, and structural connected node pairs.

3. The catheter localization method based on image recognition according to claim 1, characterized in that, The steps for obtaining S1 are as follows: S101: Based on the gray value of each pixel in the duct image, extract the gray value change amplitude between adjacent pixels in the horizontal direction, vertical direction and two diagonal directions respectively. Compare the gray value change amplitude in the four directions, select the direction angle with the largest gray value change amplitude as the dominant direction angle, and obtain the dominant direction angle data column. S102: Based on the direction angle value in the dominant direction angle data column and the corresponding pixel spatial coordinate, perform pairing information, map and associate the paired direction angles and pixel coordinates according to the image scanning order, and obtain the direction angle pixel pairing set; S103: Call the directional angle values ​​and pixel coordinate positions in the directional angle pixel pairing set, and fill the directional angle values ​​into the corresponding areas in the image matrix according to their positions, according to the original pixel space layout of the duct image, to obtain the directional dominant pixel distribution map.

4. The catheter localization method based on image recognition according to claim 1, characterized in that, The steps for obtaining S2 are as follows: S201: Call each group of pixel orientation angle data in the orientation-dominant pixel distribution map, extract the orientation angle corresponding to each pixel position in the image and the orientation angle of its adjacent pixels one by one, and arrange the orientation angle data of the corresponding pixel positions in parallel according to the extraction order to obtain the orientation angle comparison sequence. S202: Based on the direction angle values ​​in the direction angle comparison sequence, compare the change range between adjacent direction angles one by one, and process the direction angle positions with stable continuous change ranges in the image space order, output the corresponding pixel position set, and obtain the stable change pixel position column. S203: Call the pixel coordinate data in the stable changing pixel position column, extract the corresponding direction angle data in each group of pixel positions and divide the boundary according to the spatial proximity relationship, extract the set of pixels with continuous direction according to the direction angle of each group, and obtain the set of pixels with continuous edge direction.

5. The catheter localization method based on image recognition according to claim 1, characterized in that, The steps for obtaining S3 are as follows: S301: Based on the continuous pixel sequence in the edge direction continuous pixel set, extract the direction angle value at the position of adjacent pixels, compare the change amplitude of the direction angle before and after in the order of pixel spatial distribution, extract the corresponding pixel index in the section where the continuous change remains stable, and obtain the direction continuous pixel index group. S302: Call each index sequence in the direction continuous pixel index group, extract the linear texture direction information of the corresponding position from the image area, compare each group of direction angle values ​​with the corresponding texture direction one-to-one, filter out the pixel sequences with the same direction, and obtain the direction matching pixel sequence set. S303: Based on the spatial connection relationship and directional features of each group of pixels in the direction matching pixel sequence set, expand the connection path in the image space according to the directional sequence, and perform spatial tracking on the continuous pixel regions in the same direction to obtain the duct structure extension path group.

6. The catheter localization method based on image recognition according to claim 1, characterized in that, The steps for obtaining S4 are as follows: S401: Based on the path direction points in the extended path group of the duct structure, extract the direction vectors corresponding to adjacent points, compare the direction of the vectors in the linear order of the path, and screen out the point intervals in which the direction changes remain stable in the continuous segment to obtain a set of continuous direction point segments. S402: Call the index of each point segment in the set of continuous point segments in the direction, extract the gray value sequence of the corresponding position from the gray value matrix of the image, monitor the gray value change trend in the order of point segments, output the point segments with stable change trends in parallel, and obtain the gray value trend stable point segment sequence. S403: Based on the grayscale trend stable point segment sequence and the point segment data in the directional continuous point segment set, perform a bidirectional comparison of the two types of point segments according to spatial location and index order, extract the path segment sequence that simultaneously possesses directional continuity and grayscale stability attributes, and obtain the duct connected node path chain.

7. The catheter localization method based on image recognition according to claim 1, characterized in that, The method further includes: S5: Based on the node order in the path chain of the duct connection node, the node coordinates are connected sequentially along the link to form the duct spatial trajectory. The spatial positions of each node in the trajectory are listed in the path set in order to obtain the duct structure positioning path set. The catheter structure positioning path set includes a sequence of node spatial coordinates, a path chain connection order, and a three-dimensional spatial trajectory of the catheter.

8. The catheter localization method based on image recognition according to claim 1, characterized in that, The steps for obtaining S5 are as follows: S501: Based on the node order in the path chain of the duct connection node, extract the coordinate values ​​corresponding to the continuous nodes, connect the adjacent coordinates in sequence according to the link order, extend them sequentially along the coordinate points in the image space to form a point sequence with spatial continuity, and obtain the duct spatial trajectory sequence. S502: Call the coordinate data in the spatial trajectory sequence of the catheter, extract the coordinate index in sequence according to the connection order of the points, include the spatial position of each point into the path index set, and extract the path distribution content by combining the structural direction information of the corresponding area in the image to obtain the catheter structure positioning path set.

9. A catheter positioning system based on image recognition, characterized in that, The system is used in the catheter localization method based on image recognition as described in any one of claims 1-8, the system comprising: The main orientation angle recognition module extracts the grayscale variation amplitude of each pixel in the horizontal, vertical and diagonal directions from the duct image, replaces the orientation angle with the highest variation amplitude as the main orientation angle of the pixel, and puts the main orientation angle and the pixel coordinates into the orientation mapping sequence to obtain the orientation-dominant pixel distribution map. The edge pixel extraction module calls the main orientation angle of the pixels in the dominant orientation pixel distribution map, compares the main orientation angle of the pixel with the main orientation angle of its neighboring pixels one by one, puts the pixels whose orientation angle changes are stable into the same orientation sequence, and uses the orientation sequence as the source of edge response to obtain a set of continuous pixels in the edge direction. The duct path extraction module, based on the continuous pixel sequence in the continuous pixel set of the edge direction, compares the direction angles of adjacent pixels, classifies the trajectories with stable direction angle changes into the same direction, compares the direction direction with the direction texture of the linear region in the image one-to-one, and classifies the trajectories with the same direction into the duct structure path to obtain the duct structure extension path group. The node link identification module calls the path direction points in the duct structure extension path group, compares the direction vectors between adjacent points segment by segment, includes the point segments with continuous direction vectors into the same path, and cross-screens the point segments with stable gray scale change trends with the point segments with continuous directions to obtain the duct connected node path chain. The catheter trajectory generation module, based on the node order in the path chain of the catheter connecting nodes, sequentially connects the node coordinates along the link to form the catheter spatial trajectory, and lists the spatial positions of each node in the trajectory into the path set in order to obtain the catheter structure positioning path set.