Coronary angiography blood vessel tracking method and system based on template matching method
By optimizing the template matching method through inference, correction, and rearrangement algorithms, the problems of mismatch and disordered order of sampling points near the edge in coronary angiography vessel tracking were solved, achieving accurate tracking of vessel segments and improving the accuracy of coronary angiography vessel tracking.
Patent Information
- Application Number
- CN202311238779.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-22
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2043-09-22
AI Technical Summary
In existing coronary angiography vessel tracking technology, sampling points near the edge of the angiography frame cannot obtain matching templates, resulting in incorrect tracking positions and disordered sampling point order, which affects the accurate tracking of vessel segments.
By employing inference, correction, and rearrangement algorithms, the template matching method is optimized for blood vessel tracking. Inference processing is performed on sampling points near the edge to correct outliers and rearrange the sampling point order to ensure location accuracy.
It solves the problems of mismatched sampling points near the edge and disordered sampling point order, and realizes accurate tracking of blood vessel segments, improving the accuracy and reliability of coronary angiography vessel tracking.
Smart Images

Figure CN117197492B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of blood vessel image processing, and particularly relates to a coronary angiography blood vessel tracking method and system based on a template matching method. BACKGROUND
[0002] The incidence of cardiovascular diseases is increasing year by year, which is one of the most common causes of death recognized by the world. The mortality rate of coronary heart disease is extremely high, and the main factor inducing coronary heart disease is coronary artery stenosis, which seriously affects the blood supply of the heart and seriously threatens life. The gold standard for the diagnosis of coronary heart disease at present is coronary angiography CAG (Coronary angiography). When medical technical means such as angiography fusion is performed, it is often necessary to continuously track a certain blood vessel segment of interest on the angiography frame sequence.
[0003] The method for tracking the blood vessel segment of interest on the continuous angiography frame in the prior art is usually based on a template matching method, for example, the method disclosed in the prior art CN201380076357.1 is as follows:
[0004] 1. A certain number of sampling points (such as shown in the figure) are collected on the path of the blood vessel segment of interest of a certain frame (Nth frame) of the angiography frame sequence, to form a sampling point sequence; Figure 1
[0005] 2. A rectangular region of a certain size around each sampling point of the frame (Nth frame) is taken as the matching template of the sampling point;
[0006] 3. A region of a certain size on the next frame (N+1th frame) is taken as a search box region, and each sampling point is subjected to a template matching operation by means of the matching template, to find the most similar region, so as to find the tracking position corresponding to each sampling point on the next frame (N+1th frame).
[0007] 4. The sampling points for which the tracking positions are found on the next frame (N+1th frame) are subjected to optimization, fitting and other operations, to mark the position of the blood vessel segment of interest on the next frame (N+1th frame), so as to realize the tracking of the blood vessel segment.
[0008] Defects of the prior art:
[0009] Firstly, the sampling points close to the edge of the angiography frame cannot obtain the matching template, and thus cannot find the corresponding tracking position on the next frame. As shown in the figure, the sampling point 2 is too close to the edge of the angiography frame, and the size of the matching template exceeds the boundary of the angiography frame. Figure 2
[0010] Secondly, due to the reasons such as heart beating, change of contrast agent concentration, deviation of the blood vessel segment of interest to the outside of the field of view, irregular overlapping and migration of branch blood vessels, the matching tracking of the sampling points on the next frame often appears to be wrong.
[0011] Finally, although each sampling point on the interested vessel segment is successfully tracked on the vessel segment in the next frame, the order of a few of the sampling points is disordered, and the disorder of the order will cause serious errors in later curve fitting or path planning using these points (such as Figure 3 As shown in FIG. 4, due to the wandering of the coronary branch, the matching tracking results of the sampling point 2 and the sampling point 3 are disordered. SUMMARY
[0012] Therefore, the purpose of the present application is to provide a coronary angiography vessel tracking method and system based on template matching method, which optimizes the vessel tracking technology based on template matching method through reasoning, correction and rearrangement.
[0013] In one embodiment of the present application, a coronary angiography vessel tracking method based on template matching method is provided, comprising the following steps:
[0014] S1, acquiring any Nth frame and N+1th frame angiography images in an angiography sequence;
[0015] S2, acquiring a sampling point sequence, marking the sampling points located at the edges of the angiography frames in the sampling point sequence as to-be-reasoned points; and performing template matching on the other sampling points in the sampling point sequence;
[0016] In the N+1th frame angiography image, matching is performed on each sampling point using the template to realize sampling point tracking, and it is judged whether there is an abnormal point in the tracking process, and when there is an abnormal point, the abnormal point is marked as a to-be-corrected point;
[0017] S3, correcting the tracking result of the to-be-corrected point on the N+1th frame based on the position of the to-be-corrected point in the Nth frame;
[0018] S4, reasoning the tracking result of the to-be-reasoned point on the N+1th frame based on the position of the to-be-reasoned point in the Nth frame;
[0019] S5, performing similarity comparison and rearrangement on the tracked sampling points one by one, and the similarity comparison and rearrangement process comprises: comparing the similarity of the relative positions of the sampling points in the N+1th frame and the Nth frame, if the similarity is the same, keeping the same, if the similarity is different, exchanging the relative positions of the sampling points, and then starting from the first sampling point, re-comparing the similarity; until the rearrangement of all the sampling points is completed, and the final tracking result is obtained.
[0020] Further preferably, in S2, the judgment of whether there is an abnormal point in the tracking process comprises the following process:
[0021] S201, calculate the average or median value mean1 of the overall lateral migration amount of the sampling points tracked in the N+1 frame and the corresponding sampling points in the N frame, and calculate the overall standard deviation std1 of the lateral migration amount;
[0022] S202, calculate the average or median value mean2 of the overall longitudinal migration amount of the sampling points tracked in the N+1 frame and the corresponding sampling points in the N frame, and calculate the overall standard deviation std2 of the longitudinal migration amount;
[0023] S203, traverse each tracked sampling point in the N+1 frame, calculate the deviation dev1 between the lateral migration amount of the current sampling point and the overall average or median value mean1 of the lateral migration amount, and the deviation dev2 between the longitudinal migration amount of the current sampling point and the overall average or median value mean2 of the longitudinal migration amount;
[0024] S204, when dev1 >= k*std1 or dev2 >= k*std2, then determine that this tracked sampling point is an abnormal point; wherein k is a migration coefficient, and the value range is (1, 3).
[0025] Further preferably, it further includes removing the abnormal points in the tracked sampling points in the N+1 frame, and recalculating the average or median value mean_new_1 of the overall lateral migration amount of the other sampling points and the average or median value mean_new_2 of the overall longitudinal migration amount according to the processes of S201 and S202.
[0026] Further preferably, in S3, the tracking result of the to-be-corrected point on the N+1 frame is corrected based on the position of the to-be-corrected point in the N frame of the contrast image, including correcting the tracking result according to the following formula:
[0027]
[0028] Wherein, (x N ,y N ) is the position of the to-be-corrected point in the N frame of the contrast image, and (x N+1 ,y N+1 ) is the position of the tracked to-be-corrected point in the N+1 frame of the contrast image.
[0029] Further preferably, in S4, the tracking result of the to-be-inferred point on the N+1 frame is inferred based on the position of the to-be-inferred point in the N frame of the contrast image; including calculating the tracking result of the to-be-inferred point according to the following formula:
[0030]
[0031] Wherein, (p N ,qN ) is the position of the to-be-reasoned point in the Nth frame of the contrast image, (p N+1 , q N+1 ) is the position of the to-be-reasoned point in the Nth frame of the contrast image after reasoning.
[0032] Further preferably, in S5, the similarity comparison is rearranged, including the following specific process:
[0033] S501, in the Nth frame, the unit vector Base_ori(i) of the vector formed by the current ith sampling point and the i+1th sampling point is calculated;
[0034] S502, in the N+1th frame, the tracked ith sampling point is found, and the unit vector Base_follow(i) of the vector formed by the tracked ith sampling point and the i+1th sampling point is calculated;
[0035] S503, the forward similarity m between Base_ori(i) and Base_follow(i) and the reverse similarity n between Base_ori(i) and Base_follow(i) are calculated; if m>n, the order of the ith point and the i+1th point on the N+1th frame is exchanged;
[0036] S504, in the N+1th frame, from the first sampling point, the similarity comparison is re-performed according to the above steps S501-S503, until the rearrangement of all sampling points is completed, and the final tracking result is obtained.
[0037] The application also provides a coronary angiography blood vessel tracking system based on a template matching method, comprising:
[0038] An image acquisition module is configured to acquire any Nth frame and N+1th frame of contrast images in a contrast sequence;
[0039] A marking module is configured to acquire a sampling point sequence, mark the sampling points located at the edges of the contrast frames in the sampling point sequence as to-be-reasoned points, perform template matching on other sampling points in the sampling point sequence, match each sampling point with the template in the N+1th frame of the contrast image to realize sampling point tracking, and judge whether there is an abnormal point in the tracking process; when there is an abnormal point, the abnormal point is marked as a to-be-corrected point;
[0040] A correction module is configured to correct the tracking result of the to-be-corrected point on the N+1th frame based on the position of the to-be-corrected point in the Nth frame of the contrast image.
[0041] A reasoning module is configured to reason the tracking result of the to-be-reasoned point on the N+1th frame based on the position of the to-be-reasoned point in the Nth frame of the contrast image.
[0042] The rearrangement module rearranges the tracked sampling points one by one according to similarity comparison, and the similarity comparison rearrangement process includes: comparing the similarity of the relative positions of the sampling points in the N+1 frame and the relative positions of the sampling points in the N frame, if the similarity exists, the relative positions of the sampling points are kept unchanged, if the similarity does not exist, the relative positions of the sampling points are exchanged, and then the similarity comparison is performed again from the first sampling point; until the rearrangement of all sampling points is completed, and the final tracking result is obtained.
[0043] Further preferably, it further comprises a migration amount calculation module for calculating the offset amount when judging the abnormal point, including:
[0044] The overall lateral migration amount average mean1 of the sampling points tracked in the N+1 frame and the corresponding sampling points in the N frame is calculated, and the overall standard deviation std1 of the lateral migration amount is calculated;
[0045] The overall longitudinal migration amount average mean2 of the sampling points tracked in the N+1 frame and the corresponding sampling points in the N frame is calculated, and the overall standard deviation std2 of the longitudinal migration amount is calculated;
[0046] The deviation dev1 between the lateral migration amount of the current sampling point and the overall lateral migration amount average mean1, and the deviation dev2 between the longitudinal migration amount of the current sampling point and the overall longitudinal migration amount average mean2 are calculated for each tracked sampling point in the N+1 frame;
[0047] When dev1 >= k*std1 or dev2 >= k*std2, the tracked sampling point is determined to be an abnormal point; wherein k is a migration coefficient, and the value range is (1, 3).
[0048] Further preferably, the tracking result of the to-be-corrected point on the N+1 frame is corrected based on the position of the to-be-corrected point in the N frame of the contrast image, including correcting the tracking result according to the following formula:
[0049]
[0050] Wherein, (x N ,y N ) is the position of the to-be-corrected point in the N frame of the contrast image, and (x N+1 ,y N+1 ) is the position of the tracked to-be-corrected point in the N+1 frame of the contrast image.
[0051] Further preferably, in the rearrangement module, the similarity comparison rearrangement includes the following specific process:
[0052] In the N frame, the unit vector Base_ori(i) of the vector formed by the current i-th sampling point and the i+1-th sampling point is calculated;
[0053] In the N+1 frame, find the i-th sample point tracked, calculate the unit vector Base_follow(i) of the vector formed by the i-th sample point and the i+1-th sample point tracked;
[0054] Calculate the positive similarity m between Base_ori(i) and Base_follow(i) and the negative similarity n between Base_ori(i) and Base_follow(i); if m>n, then exchange the order of the i-th point and the i+1-th point in the N+1 frame;
[0055] In the N+1 frame, from the first sample point, repeat the above similarity comparison process until all sample points are rearranged to obtain the final tracking result.
[0056] The coronary angiography blood vessel tracking method and system based on template matching method disclosed in the application, compared with the prior art, gradually optimizes the blood vessel tracking process based on template matching method through reasoning, correction and rearrangement, uses reasoning algorithm to process the sample points that are too close to the edge of the angiography frame and thus cannot obtain a matching template, and infers the tracking results of these points by considering the tracking results of other sample points. The correction algorithm is used to correct the sample points whose tracking positions are found to be abnormal after being processed by the template matching method.
[0057] The rearrangement algorithm is used to check the order and relative position of all tracked sample points, and the order is exchanged to make the relative position of the tracked sample points consistent with the relative position of the corresponding sample points in the last frame. Thus, the problem that the existing technology cannot achieve accurate matching of sample points by simply relying on template matching, resulting in missing tracking points, inaccurate positions and disorder of the final sample sequence, is solved. BRIEF DESCRIPTION OF DRAWINGS
[0058] Figure 1 is a schematic diagram of obtaining a plurality of sample points on a path of a blood vessel of interest in a certain angiography frame;
[0059] Figure 2 is a schematic diagram of a sample point near the edge of an angiography frame that cannot obtain a matching template;
[0060] Figure 3 is a schematic diagram of the order of the tracking results of the sample points being disordered;
[0061] Figure 4 is the overall flowchart of the coronary angiography blood vessel tracking method based on the template matching method involved in the application;
[0062] Figure 5 is an angiography image of the N-th frame tracking blood vessel information;
[0063] Figure 6 is a blood vessel information map identified based on a traditional method;
[0064] Figure 7 is a blood vessel information map identified based on the method of the present application;
[0065] Figure 8 is a Gaussian distribution graph of the migration coefficient k when determining whether there is an abnormal point in the present application;
[0066] Figure 9 is an Nth frame of a contrast image for tracking blood vessel information;
[0067] Figure 10 is blood vessel information of an abnormal point identified based on a traditional method;
[0068] Figure 11 is blood vessel information identified based on the correction algorithm in the present application;
[0069] Figure 12 is a flowchart of the rearrangement module;
[0070] Figure 13 is an Nth frame of blood vessel information;
[0071] Figure 14 is blood vessel information of a sampling point tracking arrangement identified based on a traditional method;
[0072] Figure 15 is blood vessel information identified based on the rearrangement algorithm in the present application. DETAILED DESCRIPTION
[0073] The present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0074] As shown in Figure 4 , an embodiment of the present application provides a coronary angiography blood vessel tracking method based on a template matching method, comprising the following steps:
[0075] S1, acquiring an Nth frame and an N+1th frame of a contrast image in a contrast sequence;
[0076] S2, acquiring a sampling point sequence, marking a sampling point located at the edge of a contrast frame (or other similar reasons, such as a certain part of the blood vessel segment of the contrast frame being blocked) in the sampling point sequence as a to-be-reasoned point; and performing template matching on other sampling points in the sampling point sequence;
[0077] Specifically, in an embodiment, for other sampling points in the sampling point sequence, a rectangular region of a certain size around the sampling point is selected as the matching template of the sampling point with the sampling point position as the center, and the matching template is stored.
[0078] In the N+1 frame contrast image, template matching is performed on each sampling point other than the to-be-inferred point. Specifically, a sliding window is constructed, and based on a similarity calculation method, a rectangular region most similar to the stored matching template is matched, and the center point of the rectangular region is taken as the tracking result of the sampling point on the N+1 frame. The similarity calculation method includes but is not limited to Sum of Squared Difference (SSD), Normalized Sum of Squared Difference (NSSD), Cross Correlation (CC), Normalized Cross Correlation (NCC), Zero-mean Cross Correlation (ZCC), Zero-mean Normalized Cross Correlation (ZNCC), and the like.
[0079] In addition, the sampling point with an abnormal tracking result is marked as a to-be-corrected point.
[0080] In S2, the determination of whether there is an abnormal point in the tracking process includes the following process:
[0081] S201, calculating the overall lateral migration amount average mean1 of the sampling points tracked in the N+1 frame and the corresponding sampling points in the N frame, and calculating the overall standard deviation std1 of the lateral migration amount;
[0082] S202, calculating the overall longitudinal migration amount average mean2 of the sampling points tracked in the N+1 frame and the corresponding sampling points in the N frame, and calculating the overall standard deviation std2 of the longitudinal migration amount;
[0083] S203, traversing each tracked sampling point in the N+1 frame, calculating the deviation dev1 between the lateral migration amount of the current sampling point and the overall lateral migration amount average mean1, and the deviation dev2 between the longitudinal migration amount of the current sampling point and the overall longitudinal migration amount average mean2;
[0084] S204, when dev1 >= k*std1 or dev2 >= k*std2, it is determined that the tracked sampling point is an abnormal point;
[0085] Wherein, k is a migration coefficient, and the value range is (1, 3).
[0086] Further, in the N+1th frame, the outliers among the tracked sampling points are removed, and the average of the overall lateral migration mean_new_1 and the average of the overall longitudinal migration mean_new_2 of the other sampling points are recalculated according to the processes of S201 and S202.
[0087] In the embodiment, the average of the overall lateral migration or the average of the overall longitudinal migration of the sampling points can be replaced by the lateral median or the longitudinal median, and the calculation is the same as the above process, which will not be described here.
[0088] S3, based on the position of the to-be-corrected point in the Nth frame of the contrast image, the tracking result of the to-be-corrected point in the N+1th frame is corrected; including correcting the tracking result according to the following formula:
[0089]
[0090] Where (x N ,y N ) is the position of the to-be-corrected point in the Nth frame of the contrast image, and (x N+1 ,y N+1 ) is the position of the tracked to-be-corrected point in the N+1th frame of the contrast image.
[0091] S4, based on the position of the to-be-reasoned point in the Nth frame of the contrast image, the tracking result of the to-be-reasoned point in the N+1th frame is reasoned;
[0092] The tracking result of the to-be-reasoned point is calculated according to the following formula:
[0093]
[0094] Where (p N ,q N ) is the position of the to-be-reasoned point in the Nth frame of the contrast image, and (p N+1 ,q N+1 ) is the position of the to-be-reasoned point in the N+1th frame of the contrast image.
[0095] It should be noted that the to-be-corrected point calculation process of S3 and the to-be-reasoned point calculation process of S4 have no order restriction, and the adjustment order can also achieve the technical effects of the present application, and is within the protection scope of the present application.
[0096] S5, the tracked sampling points are compared one by one for similarity rearrangement, and the similarity comparison rearrangement process comprises: comparing the similarity of the relative positions of the sampling points in the N+1 frame and the relative positions of the sampling points in the N frame, if the similarity, then keep unchanged, if not similar, then exchange the relative positions of the sampling points, and then re-perform similarity comparison from the first sampling point; until the rearrangement of all sampling points is completed, and the final tracking result is obtained.
[0097] The similarity comparison comprises:
[0098] S501, in the N frame, the unit vector Base_ori(i) of the vector formed by the current i-th sampling point and the i+1-th sampling point is calculated;
[0099] S502, in the N+1 frame, the tracked i-th sampling point is found, and the unit vector Base_follow(i) of the vector formed by the tracked i-th sampling point and the i+1-th sampling point is calculated;
[0100] S503, the forward similarity m between Base_ori(i) and Base_follow(i) and the reverse similarity n between Base_ori(i) and Base_follow(i) are calculated; if m>n, the order of the i-th point and the i+1-th point in the N+1 frame is exchanged;
[0101] S504, in the N+1 frame, similarity comparison is re-performed according to the above steps S501-S503 from the first sampling point; until the rearrangement of all sampling points is completed, and the final tracking result is obtained.
[0102] The application also provides a coronary angiography blood vessel tracking system based on a template matching method, which is used to implement all steps of the above tracking method, and comprises:
[0103] An image acquisition module is configured to acquire any N frame and N+1 frame angiography images in an angiography sequence;
[0104] A marking module is configured to acquire a sampling point sequence, mark the sampling points located at the edges of the angiography frames in the sampling point sequence as inference points to be inferred, mark the sampling points (such as the sampling point 2 in Figure 2 The matching box exceeds the boundary of the angiography frame) which cannot acquire a matching template due to being too close to the edges of the angiography frames (or other similar reasons, such as a part of the blood vessel segment of the angiography frame being blocked) as inference points to be inferred; in addition, template matching is performed on other sampling points in the sampling point sequence (as shown in Figure 5 , wherein the black circles are inference points to be inferred, and the bright circles are other sampling points).
[0105] Template matching is performed on other sampling points in the sampling point sequence; in the N+1th contrast image, each sampling point other than the to-be-reasoned point is matched using the template to achieve sampling point tracking; using the template matching method, the template of each sampling point other than the to-be-reasoned point is matched on the N+1th contrast image to achieve tracking of the sampling points. However, for the sampling points that have been marked as to-be-reasoned points, since they cannot generate a corresponding matching template, these points cannot be tracked (for example, as shown in FIG. 8, the to-be-reasoned point on the Nth frame cannot be tracked on the N+1th frame). Figure 6
[0106] It is determined whether there is an abnormal point in the tracking process; when there is an abnormal point, the abnormal point is marked as a to-be-corrected point, for example, as shown in FIG. 9, a plurality of sampling points on the Nth frame, Figure 9 Figure 10 are matched and tracked on the N+1th frame, and the abnormal point pointed by the arrow is the matching and tracking result of the sampling points.
[0107] Further comprising a migration amount calculation module for calculating the offset amount to determine whether there is an abnormal point, and eliminating the abnormal point when there is an abnormal point, and recalculating the offset amount, including:
[0108] The overall lateral migration amount average (or median) mean1 of the sampling points tracked on the N+1th frame and the corresponding sampling points in the Nth frame is calculated, and the overall standard deviation std1 of the lateral migration amount is calculated;
[0109] The overall longitudinal migration amount average (or median) mean2 of the sampling points tracked on the N+1th frame and the corresponding sampling points in the Nth frame is calculated, and the overall standard deviation std2 of the longitudinal migration amount is calculated;
[0110] The deviation dev1 between the lateral migration amount of the current sampling point and the overall lateral migration amount average (or median) mean1, and the deviation dev2 between the longitudinal migration amount of the current sampling point and the overall longitudinal migration amount average (or median) mean2 are calculated for each tracked sampling point in the N+1th frame;
[0111] When dev1 >= k*std1 or dev2 >= k*std2, the tracked sampling point is determined to be an abnormal point. Generally, k takes a value between 1 and 3 (wherein k is a migration coefficient, and the distribution of k refers to the three-sigma criterion, for example, as shown in FIG. 10, which conforms to a Gaussian distribution). Figure 8
[0112] After it is determined that there is an abnormal point, the abnormal point in the tracked sampling points is eliminated, and the overall lateral migration amount average mean_new_1 and the overall longitudinal migration amount average mean_new_2 of the other sampling points are recalculated.
[0113] In this embodiment, the average value of the overall lateral migration amount or the average value of the overall longitudinal migration amount of the sampling points can be replaced by the lateral median value or the longitudinal median value, and the calculation is the same as the above process, which will not be described here.
[0114] The correction module corrects the tracking result of the to-be-corrected point on the N+1 frame based on the position of the to-be-corrected point in the N frame of the contrast image, and includes correcting the tracking result according to the following formula:
[0115]
[0116] (x N ,y N ) is the position of the to-be-corrected point in the N frame of the contrast image, (x N+1 ,y N+1 ) is the position of the to-be-corrected point in the N+1 frame of the contrast image. The effect is shown in Figure 9 , which is the correction result.
[0117] The inference module infers the tracking result of the to-be-inferred point on the N+1 frame based on the position of the to-be-inferred point in the N frame of the contrast image.
[0118] The tracking result of the to-be-inferred point is calculated according to the following formula:
[0119]
[0120] (x N ,y N ) is the position of the to-be-inferred point in the N frame of the contrast image, (x N+1 ,y N+1 ) is the position of the to-be-inferred point in the N+1 frame of the contrast image. The effect is shown in Figure 7 , the black circle is the inference result.
[0121] As shown in Figure 12 , the rearrangement module compares the similarity of the tracking sampling points one by one, and the similarity comparison rearrangement process includes: comparing the similarity of the relative positions of the sampling points in the N+1 frame and the relative positions in the N frame, if similar, keeping unchanged, if not similar, exchanging the relative positions of the sampling points, and then starting from the first sampling point, re-comparing the similarity; until all the sampling points are rearranged, and the final tracking result is obtained. Specifically, it includes:
[0122] In the N frame, the unit vector Base_ori(i) of the vector formed by the current i-th sampling point and the i+1-th sampling point is calculated;
[0123] In the N+1th frame, the i-th sample point tracked is found, and a unit vector Base_follow(i) of a vector formed by the i-th sample point and the i+1th sample point is calculated;
[0124] A positive similarity m between Base_ori(i) and Base_follow(i) and a negative similarity n between Base_ori(i) and Base_follow(i) are calculated; if m>n, the order of the i-th point and the i+1th point in the N+1th frame is exchanged;
[0125] In the N+1th frame, starting from the first sample point, the similarity comparison is re-performed according to the foregoing steps; until the rearrangement of all sample points is completed, the final tracking result is obtained.
[0126] Obviously, the above embodiments are only examples for clear illustration, and are not intended to limit the embodiments. Based on the above description, other different forms of changes or variations can be made by those skilled in the art. All the embodiments do not need to be exhausted, and the obvious changes or variations derived therefrom are still within the protection scope of the present application.
Claims
1. A coronary angiogram vessel tracing method based on template matching method, characterized by, The method comprises the following steps: S1, acquiring any Nth frame and N+1th frame contrast image in a contrast sequence; S2, acquiring a sampling point sequence, and marking a sampling point located at an edge of a contrast frame in the sampling point sequence as a to-be-reasoned point; performing template matching on other sampling points in the sampling point sequence; in the N+1th frame contrast image, matching the other sampling points using the template to achieve sampling point tracking, and judging whether an abnormal point exists in the tracking process; when the abnormal point exists, marking the abnormal point as a to-be-corrected point; S3, correcting a tracking result of the to-be-corrected point on the N+1th frame based on a position of the to-be-corrected point in the Nth frame contrast image; S4, reasoning a tracking result of the to-be-reasoned point on the N+1th frame based on a position of the to-be-reasoned point in the Nth frame contrast image; S5, performing similarity comparison and rearrangement on the tracked sampling points one by one, the similarity comparison and rearrangement process comprising: comparing the similarity of relative positions of the sampling points in the N+1th frame and the Nth frame; if the similarity exists, keeping unchanged; if the similarity does not exist, exchanging the relative positions of the sampling points, and starting from the first sampling point, re-performing similarity comparison; until all the sampling points are rearranged, and a final tracking result is obtained; specifically comprising: S501, in the Nth frame, calculating a unit vector Base_ori(i) of a vector formed by a current ith sampling point and an i+1th sampling point; S502, in the N+1th frame, finding the tracked ith sampling point, and calculating a unit vector Base_follow(i) of a vector formed by the tracked ith sampling point and the i+1th sampling point; S503, calculating a forward similarity m between Base_ori(i) and Base_follow(i) and a reverse similarity n between Base_ori(i) and Base_follow(i); if m>n, exchanging the order of the ith point and the i+1th point on the N+1th frame; S504, in the N+1th frame, starting from the first sampling point, re-performing similarity comparison according to the above steps S501-S503, until all the sampling points are rearranged, and a final tracking result is obtained.
2. The template matching method-based coronary angiogram vessel tracing method according to claim 1, characterized by, In S2, the judgment of whether an abnormal point exists in the tracking process comprises the following process: S201, calculating an overall lateral migration average value or median value mean1 of the tracked sampling points in the N+1th frame and the corresponding sampling points in the Nth frame, and calculating an overall standard deviation std1 of the lateral migration; S202, calculating an overall longitudinal migration average value or median value mean2 of the tracked sampling points in the N+1th frame and the corresponding sampling points in the Nth frame, and calculating an overall standard deviation std2 of the longitudinal migration; S203, traversing each tracked sampling point in the N+1th frame, calculating a deviation dev1 between a lateral migration of the current sampling point and the overall lateral migration average value or median value mean1, and a deviation dev2 between a longitudinal migration of the current sampling point and the overall longitudinal migration average value or median value mean2; S204, when dev1 >=k * std1 or dev2>=k * std2, then determine that the tracked sampling point is an abnormal point; wherein, k is a migration coefficient, and the value range is (1, 3).
3. The template matching method-based coronary angiogram vessel tracing method according to claim 2, characterized by, Further comprising: in the N+1 frame, eliminating the abnormal points in the tracked sampling points, and recalculating the average value or the median value mean_new_1 of the overall horizontal migration amount and the average value or the median value mean_new_2 of the overall vertical migration amount of the other sampling points according to the processes of S201 and S202.
4. The template matching method-based coronary angiogram vessel tracing method according to claim 3, characterized by, In S3, the tracking result of the to-be-corrected point on the N+1 frame is corrected based on the position of the to-be-corrected point in the N frame of the contrast image, including correcting the tracking result according to the following formula: wherein (x N , y N ) is the position of the point to be corrected in the Nth frame of the contrast image, and (x N+1 , y N+1 ) is the position of the point to be corrected tracked in the (N+1)th frame of the contrast image.
5. The template matching method-based coronary angiogram vessel tracing method according to claim 3, characterized by, In S4, the tracking result of the to-be-inferred point on the N+1 frame is inferred based on the position of the to-be-inferred point in the N frame of the contrast image. The tracking result of the to-be-inferred point is calculated according to the following formula: wherein (p N , q N ) is the position of the to-be-reasoned point in the Nth frame of the contrast image, and (p N+1 , q N+1 ) is the position of the to-be-reasoned point in the (N+1)th frame of the contrast image after reasoning.
6. A coronary angiogram vessel tracing system based on template matching method, characterized by, Including: An image acquisition module is configured to acquire any Nth and N+1th frame of contrast images in a contrast sequence; A marking module is configured to acquire a sampling point sequence, and mark the sampling points located at the edges of the contrast frames in the sampling point sequence as to-be-inferred points; Template matching is performed on the other sampling points in the sampling point sequence; in the N+1th frame of the contrast image, the other sampling points are matched using the template to realize sampling point tracking; and it is determined whether there is an abnormal point in the tracking process; When the abnormal point exists, the abnormal point is marked as a to-be-corrected point; A correction module is configured to correct the tracking result of the to-be-corrected point on the N+1 frame based on the position of the to-be-corrected point in the N frame of the contrast image. An inference module is configured to infer the tracking result of the to-be-inferred point on the N+1 frame based on the position of the to-be-inferred point in the N frame of the contrast image. A rearrangement module is configured to perform similarity comparison and rearrangement on the tracked sampling points one by one, and the similarity comparison and rearrangement process includes: comparing the similarity of the relative positions of the sampling points in the N+1 frame and the relative positions of the sampling points in the N frame; if the similarity exists, the relative positions of the sampling points are kept unchanged; if the similarity does not exist, the relative positions of the sampling points are exchanged, and then the similarity comparison is performed from the first sampling point; until the rearrangement of all the sampling points is completed, and the final tracking result is obtained; specifically including: In the rearrangement module, the similarity comparison and rearrangement includes the following specific process: In the Nth frame, the unit vector Base_ori(i) of the vector formed by the current ith sampling point and the i+1th sampling point is calculated; In the N+1th frame, the tracked ith sampling point is found, and the unit vector Base_follow(i) of the vector formed by the tracked ith sampling point and the i+1th sampling point is calculated; The forward similarity m between Base_ori(i) and Base_follow(i) and the reverse similarity n between Base_ori(i) and Base_follow(i) are calculated; if m>n, the order of the ith point and the i+1th point on the N+1th frame is exchanged. In the N+1th frame, the similarity comparison process is repeated from the first sampling point until all sampling points are rearranged to obtain the final tracking result.
7. The template matching method based coronary angiogram vessel tracing system according to claim 6, wherein, The migration amount calculation module is further included for calculating the offset amount when the abnormal point is determined, including: The overall lateral migration amount mean1 of the sampling points tracked in the N+1th frame and the corresponding sampling points in the Nth frame is calculated, and the overall standard deviation std1 of the lateral migration amount is calculated. The overall longitudinal migration amount mean2 of the sampling points tracked in the N+1th frame and the corresponding sampling points in the Nth frame is calculated, and the overall standard deviation std2 of the longitudinal migration amount is calculated. The deviation dev1 between the lateral migration amount of the current sampling point and the overall lateral migration amount mean1, and the deviation dev2 between the longitudinal migration amount of the current sampling point and the overall longitudinal migration amount mean2 are calculated for each sampling point tracked in the N+1th frame. When dev1 >= k * std1 or dev2 >= k * std2, the tracked sampling point is determined to be an abnormal point; wherein k is a migration coefficient, and the value range is (1, 3).
8. The template matching method based coronary angiogram vessel tracing system according to claim 7, wherein, The overall lateral migration amount mean_new_1 and the overall longitudinal migration amount mean_new_2 of other sampling points are calculated; and the tracking result of the to-be-corrected point on the N+1th frame is corrected based on the position of the to-be-corrected point in the Nth frame, including correcting the tracking result according to the following formula: wherein (x N , y N ) is the position of the point to be corrected in the Nth frame of the contrast image, and (x N+1 , y N+1 ) is the position of the point to be corrected tracked in the (N+1)th frame of the contrast image.
Citation Information
Patent Citations
Vascular data processing and image registration system, method and device
CN105188550B
Moving target tracking method based on optical flow
CN105761277A
Method, device, apparatus and storage medium for tracking edge of three-dimensional object in video
CN109255801A
Target tracking method and device based on ASMS algorithm
CN113902775A