A method for automatically extracting the position of metal balls used for positioning in C-arm DR images

Through the template matching method based on grayscale values ​​and edge features, the metal ball position in the C-arm DR image is automatically extracted, solving the problems of cumbersome time-consuming and low accuracy in manual clicking in the prior art, and achieving efficient and accurate metal ball positioning.

CN116030281BActive Publication Date: 2025-08-19LANCET ROBOTICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211386044.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-07
Publication Date
2025-08-19
Estimated Expiration
2042-11-07

AI Technical Summary

Technical Problem

In the prior art, manually selecting the center of the metal ball image in the DR image is time-consuming and the accuracy is difficult to ensure. The template matching method based on grayscale values ​​and image geometric features is inefficient and the order of the metal ball image cannot be guaranteed.

Method used

The template matching method based on grayscale values ​​and edge features is adopted. By calculating the distribution characteristics of metal spheres, creating an image template, extracting candidate spherical center images, and filtering through the hysteresis threshold method and similarity integral value, the position correspondence between the metal sphere and the DR image is determined.

Benefits of technology

The spherical center position of the metal ball image is automatically extracted during the operation without manual operation, improving positioning efficiency and accuracy, ensuring the correct order of the spherical center position.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116030281B_ABST
    Figure CN116030281B_ABST
Patent Text Reader

Abstract

The present invention proposes a method for automatically extracting the position of metal balls used for positioning in C-arm DR images, comprising the following steps: S1, calculating the distribution characteristics of the metal balls; obtaining the coordinate values of five metal balls in close contact with the flat-panel sensor in the engineering design drawing of the image calibrator, calculating the distance between the centers of any two metal balls, and obtaining a 5×5 matrix M0; S2, extracting candidate center images of the five metal balls; S3, screening the image centers of the metal balls, eliminating noise points in the image centers of the metal balls, and finally determining the positional correspondence between the metal balls and the DR images. The present invention uses a template matching method based on grayscale values and edge features to determine the positional correspondence between the DR images and the metal balls. It can automatically extract the center positions of the metal ball images in close contact with the flat-panel sensor during surgery without manual operation, thereby improving positioning efficiency and accuracy. The order of the obtained center positions can correspond one-to-one with the actual order of the metal balls, eliminating the need for manual sorting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of C-arm positioning, and in particular to a method for automatically extracting the position of a metal ball used for positioning in a C-arm DR image. Background Art

[0002] C-arms are widely used in navigation-based spinal surgery due to their small size and high spatial mobility. Figure 1 As shown, in the navigation surgery system, an image calibrator needs to be installed on the flat sensor end of the C-arm. The device has a double-layer structure, and both layers are attached with a number of metal balls for positioning.

[0003] One layer of the image calibrator is positioned closely against the flat-panel sensor. The metal balls attached to this layer have the same diameter d1 and are all located on the same horizontal plane. Because the centers of these metal balls are close to the flat-panel sensor, their X-ray projections on the flat-panel sensor are approximately circular, with a diameter equal to the diameter d1 of the metal balls. The other layer is positioned farther from the flat-panel sensor. The metal balls on this layer all have a diameter d2. Because the distance between the metal balls and the flat-panel sensor is much smaller than the distance between the X-ray source and the flat-panel sensor, the X-ray projections of these metal balls are approximately circular, and the diameter of the circle is kd2 (k is the magnification, k>1) due to the projection magnification. In practice, kd2 ≠ d1 is guaranteed, meaning that the DR images of the two layers of metal balls can be distinguished by their size.

[0004] During image calibration, the image positions of each metal ball in close contact with the flat sensor layer must be first identified and extracted in the DR (otherwise, subsequent calibration steps cannot be performed). The existing methods for extracting the image positions of metal balls in close contact with the flat sensor layer still have the following drawbacks:

[0005] 1) Manually selecting the center of the metal ball image in the DR image is tedious and time-consuming, and the accuracy of manual selection (selecting the center exactly) is difficult to guarantee;

[0006] 2) The grayscale-based template matching search method is prone to failure when the metal ball image is partially obscured. Each pixel in the template image must be correlated with each pixel in the DR image, resulting in low computational efficiency. Furthermore, the order of the metal ball images obtained during the search cannot be guaranteed (i.e., it is impossible to determine which metal ball on the image calibrator the image corresponds to).

[0007] 3) The search method based on template matching of image geometric features generally requires traversing all edges, which has low computational efficiency and the order of the metal ball images obtained by the search cannot be guaranteed. Summary of the Invention

[0008] The present invention proposes a method for automatically extracting the position of a metal ball used for positioning in a C-arm DR image, which solves the problem in the prior art that the accuracy of manual selection is difficult to ensure when the center of the metal ball image is manually selected in sequence in the DR image.

[0009] The technical solution of the present invention is achieved as follows:

[0010] A method for automatically extracting the position of a metal ball used for positioning in a C-arm DR image comprises the following steps:

[0011] Step S1, calculating the distribution characteristics of metal balls;

[0012] Obtain the coordinates of n metal balls placed against the flat panel sensor in the engineering design of the image calibrator. Calculate the distance between the centers of any two metal balls to obtain an n×n matrix M0.

[0013] Step S2, extracting n candidate center images of metal balls;

[0014] In step S3 , the image center of the metal ball is screened, noise points at the image center of the metal ball are removed, and the positional correspondence between the metal ball and the DR image is finally determined.

[0015] As a preferred solution of the present invention, step S2 specifically includes the following steps:

[0016] Step S21, making a preoperative image template of a single metal ball;

[0017] Step S22, extracting edge features of the image template and the intraoperative DR image respectively;

[0018] Step S23 , performing feature matching between the image template and the intraoperative DR image to obtain candidate center images of n metal balls.

[0019] As a preferred solution of the present invention, in step S21, the method for making an image template of a single metal ball is:

[0020] Before surgery, a C-arm DR image was taken. A rectangular area was manually selected on the DR image as the image template for a single metal ball. The rectangular area met the following conditions:

[0021] The rectangular area only contains a complete image of a metal ball that is close to the flat sensor;

[0022] The rectangular area is the minimum circumscribed rectangle of the complete image of the metal ball.

[0023] As a preferred solution of the present invention, step S22 specifically includes the following steps:

[0024] Step S221, calculating the image grayscale gradient;

[0025] The Sobel operator is used to perform convolution calculation on the image template to obtain the x-axis grayscale value change gradient value of each pixel position on the image template. And the gradient value of gray value change on the y-axis

[0026] use Calculate the gradient value G of each pixel position on the image template respectively T And the gradient direction A, and the maximum value of the gradient value of all pixel positions is

[0027] The gradient value G of each pixel position on the image template T and the gradient direction A are stored in the gradient value matrix M1 and the gradient direction matrix O1 respectively;

[0028] The maximum gradient value of the intraoperative DR image is obtained by sampling in the same way as the image template. Gradient value matrix M2 and gradient direction matrix O2;

[0029] Step S222, gradient value non-maximum suppression;

[0030] At the same time, traverse each element in the M1 and O1 matrices of the image template and update the matrix M1 as follows:

[0031] If M1[i, j]<L or M1[i, j]<R, the value of M1[i, j] is 0;

[0032] Otherwise, update the value of M1[i, j] to:

[0033] The gradient value matrix M2 of the intraoperative DR image is updated using the same method as the image template;

[0034] Where L and R are a pair of adjacent elements of the matrix;

[0035] Step S223, extracting image edges using a hysteresis threshold method;

[0036] Select two thresholds t1 and t2, where 0 <t1<t2<1;

[0037] Traverse each element in the matrix M1. If M1[i, j] ≥ t2, the value of M1[i, j] remains unchanged; if M1[i, j] ≤ t1, the value of M1[i, j] is set to 0; if t1 < M1[i, j] < t2, further check whether there is an element greater than or equal to t2 among the elements adjacent to M1[i, j]. If so, the value of M1[i, j] remains unchanged, otherwise the value of M1[i, j] is set to 0;

[0038] The same method as the image template is used to traverse and update each element in M2.

[0039] As a preferred solution of the present invention, step S23 specifically includes the following steps:

[0040] Step S231, initializing an empty point set P for storing the pixel coordinates of the candidate sphere center image obtained by template matching;

[0041] Step S232: for the element [u, v] of M2, overlap the central element of M1 with [u, v];

[0042] Traverse the elements on M1 and calculate the similarity between M1 and M2;

[0043] When the similarity meets the preset conditions, stop the traversal of M1 and update the coordinate q of the target sphere center image in the DR image to [u, v];

[0044] Step S233, traverse the elements on M2, obtain the coordinates of n target sphere center images and store them in the point set P.

[0045] As a preferred solution of the present invention, step S3 specifically includes the following steps:

[0046] Step S31, converting the pixel coordinate system to the space coordinate system;

[0047] Using the pixel size of the DR image, the pixel coordinates of the candidate centers of the n metal balls obtained in step S2 are converted into spatial length coordinates, and the spatial length coordinates of the candidate centers of the n metal balls form a point set P0;

[0048] Step S32, removing noise points in the point set P0;

[0049] Step S33, determining the position correspondence between each metal ball and the DR image;

[0050] For each point ai in P0, calculate the distance between the point and the rest of the points in P0, form an array Ki of all distances, and compare the array Ki with the columns of the matrix M0. If the corresponding elements of the two are all located in the jth column of M0, then the point ai is the actual metal ball p. j The corresponding element is defined as the absolute value of the difference between two elements in the two matrices is less than a preset value;

[0051] Traverse each element in the point set P0 and determine the image center coordinates corresponding to the center of each metal ball.

[0052] As a preferred solution of the present invention, in step S32, the method for removing noise points is:

[0053] For each point ai in P0, calculate the distance between the point and the rest of the points in P0, form an array Di of all distances, compare the array Di with the columns of the matrix M0, if there are s groups of corresponding elements between the array Di and a column of the matrix M0, then add the point ai to the point set P tmp , of which 2 <s<n;

[0054] If P tmp If the number of elements of is equal to the number of elements of P0, the noise point removal step ends; otherwise, P tmp Assign the value to P0 and remove the noise points from the updated P0.

[0055] Beneficial effects

[0056] Compared with the prior art, the present invention has the following beneficial effects:

[0057] (1) The present invention uses a template matching method based on grayscale values and edge features to determine the positional correspondence between the DR image and the metal ball. This method can automatically extract the center position of the metal ball image that is close to the flat-panel sensor during surgery without manual operation, thereby improving positioning efficiency and accuracy. The order of the center positions obtained can correspond one-to-one with the order of the actual metal balls, eliminating the need for manual sorting.

[0058] (2) In the process of searching for the candidate sphere center image position, the present invention detects the similarity in real time by setting a double threshold value. If the similarity is not met, the traversal can be terminated in advance, thereby improving the calculation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0060] Figure 1 It is a structural diagram of the navigation surgery system mentioned in the background technology of the present invention;

[0061] Figure 2 Schematic diagram of a flow chart of a method for automatically extracting the position of a metal ball used for positioning in a C-arm DR image according to the present invention;

[0062] Figure 3 is a schematic diagram of five metal balls in close contact with a flat panel sensor in a rectangular coordinate system according to an embodiment of the present invention;

[0063] Figure 4 Schematic diagram of the principle of determining adjacent elements of matrix M1 according to the value of matrix O1 in an embodiment of the present invention;

[0064] Figure 5 Schematic diagram of the superposition of the central element of the matrix M1 and an element of the matrix M2 in an embodiment of the present invention;

[0065] Figure 6 Schematic diagram of the principle of converting a pixel coordinate system into a space coordinate system in an embodiment of the present invention. DETAILED DESCRIPTION

[0066] The following will clearly and completely describe the technical solutions of the present invention in conjunction with the embodiments of the present invention. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.

[0067] Reference Figure 2 As shown, this embodiment provides a method for automatically extracting the position of a metal ball used for positioning in a C-arm DR image, comprising the following steps:

[0068] Step S1, calculating the distribution characteristics of metal balls;

[0069] like Figure 3 As shown in the figure, assume that there are five metal balls in close contact with the flat panel sensor (the centers of the balls are denoted as p1, p2, p3, p4, and p5 respectively). Obtain the coordinates of the five metal balls in close contact with the flat panel sensor (the specific number can be adjusted according to actual conditions) in the engineering design drawing of the image calibrator. Calculate the distance between the centers of any two metal balls to obtain a 5×5 matrix M0. The element in the i-th row and j-th column of matrix M0 represents the distance between pi and pj (if i and j are equal, the element is 0).

[0070] Step S2, extracting the candidate center image of the metal ball, specifically includes the following steps:

[0071] Step S21, making a preoperative image template of a single metal ball;

[0072] Before surgery, a C-arm DR image (without the patient, only the image calibrator) was taken. A rectangular area was manually selected on the DR image as the image template for a single metal ball. The rectangular area met the following conditions:

[0073] The rectangular area only contains a complete image of a metal ball that is close to the flat panel sensor, and no images of objects other than the metal ball exist;

[0074] The rectangular region is the minimum circumscribed rectangle of the complete image of the metal ball. The area of the rectangular region is as small as possible, and the center of the rectangular region coincides with the center of the image of the metal ball.

[0075] Step S22, extract the edge features of the image template and the intraoperative DR image respectively, which specifically includes the following steps:

[0076] Step S221, calculate the gradient of the image gray value;

[0077] Perform convolution calculation on the image template using the Sobel operator to obtain the gradient value of the gray value change in the x-axis direction at each pixel position on the image template and the gradient value of the gray value change in the y-axis direction

[0078] Use to calculate the gradient value G at each pixel position on the image template respectively T and the gradient direction A, and record the maximum value of the gradient values at all pixel positions as The calculation formula is as follows:

[0079]

[0080]

[0081] To improve the calculation efficiency, classify and reassign the gradient direction A at each pixel position:

[0082] If 0 < A < 22.5° or 157.5° < A < 202.5° or 337.5° < A < 360°, assign A as 0;

[0083] If 22.5° < A < 67.5° or 202.5° < A < 247.5°, assign A as 45°;

[0084] If 67.5° < A < 112.5° or 247.5° < A < 292.5°, assign A as 90°;

[0085] If 112.5° < A < 157.5° or 292.5° < A < 337.5°, assign A as 135°;

[0086] If A does not fall within the above four intervals, assign A as 0;

[0087] Store the gradient value G T and the gradient direction A at each pixel position on the image template into the gradient value matrix M1 and the gradient direction matrix O1 respectively;

[0088] Obtain the maximum gradient value of the intraoperative DR image using the same method as the image template Gradient value matrix M2 and gradient direction matrix O2.

[0089] Step S222, non-maximum suppression of gradient values;

[0090] At the same time, traverse each element in the M1 and O1 matrices of the image template and update the matrix M1 as follows:

[0091] If M1[i, j]<L or M1[i, j]<R, the value of M1[i, j] is 0;

[0092] Otherwise, update the value of M1[i, j] to:

[0093] Among them, L and R are a pair of adjacent elements of the matrix, and L and R are determined by the value of O1, as follows Figure 4 As shown;

[0094] If the adjacent elements L and R of M1[i, j] do not exist at the same time (i.e., when it is located at the boundary of the image), set the value of M1[i, j] to 0;

[0095] The gradient value matrix M2 of the intraoperative DR image is updated using the same method as the image template;

[0096] The M1 and M2 matrices store the edge information (normalized gradient values) of the template image and the intraoperative DR image. After the gradient value non-maximum suppression operation, only the edges at the extreme points are retained, and the gradient values at the remaining positions are set to 0, thereby sharpening the edge information.

[0097] Step S223, extracting image edges using a hysteresis threshold method;

[0098] Select two thresholds t1 and t2, where 0 <t1<t2<1;

[0099] Traverse each element in the matrix M1. If M1[i, j] ≥ t2, the value of M1[i, j] remains unchanged; if M1[i, j] ≤ t1, the value of M1[i, j] is set to 0; if t1 < M1[i, j] < t2, further check whether there is an element greater than or equal to t2 in the 8 elements adjacent to M1[i, j] (M1[i+1, j], M1[i, j+1], M1[i-1, j], M1[i, j-1], M1[i+1, j-1], M1[i-1, j+1], M1[i+1, j+1], M1[i-1, j-1]). If so, the value of M1[i, j] remains unchanged, otherwise the value of M1[i, j] is set to 0;

[0100] Use the same method as the image template to traverse and update each element in M2;

[0101] Pixels at the edge of an image have larger gradient values. Two thresholds, one large and one small, are selected in the above operation. Pixels with gradient values greater than the larger threshold in the image can be determined to be true edges and thus retained. Pixels with gradient values less than the smaller threshold have a low probability of being image edges, so they are excluded (the corresponding matrix elements are set to 0). For pixels p with gradient values between the two thresholds, it is impossible to determine whether they are image edges based solely on their own gradient values. Therefore, their neighboring pixels are checked. If any of the neighboring pixels have a gradient value greater than or equal to the larger threshold, p is considered an edge; otherwise, p is excluded from the edge extraction. This step removes pseudo-edges generated by noise points with higher gradient values in the image, thereby optimizing the quality of the extracted edges.

[0102] Step S23, feature matching is performed between the image template and the intraoperative DR image to obtain candidate center images of the five metal balls;

[0103] Step S23 specifically includes the following steps:

[0104] S231, initialize an empty point set P to store the pixel coordinates of the candidate sphere center image obtained by template matching; initialize a similarity integral value S = 0, initialize the pixel coordinates q of the target sphere center image in the DR image to [0, 0], set a minimum similarity integral value S min , 0<S min <1; set a search constant g, 0 <g<1;

[0105] S232, such as Figure 5 As shown, for the element [u,v] of M2, the central element of M1 is overlapped with [u,v] (if the number of rows or columns of M1 is even and the central element is not unique, then any central element is taken), the elements on M1 are M1[x1,y1], M2[x2,y2], ..., M1[xn,yn], and the corresponding elements on M2 are M2[u+X1,v+Y1], M2[u+X2,v+Y2], ..., M2[u+Xn,v+Yn], where n is the total number of elements in M1;

[0106] Traverse the elements on M1. For the element M1[xi,yi] on M1, the corresponding element on M2 is M2[u+Xi,v+Yi]. Calculate the similarity si between M1[xi,yi] and M2[u+Xi,v+Yi].

[0107] If M1[xi,yi]·M2[u+Xi,v+Yi]≠0, then

[0108] si=cos(O1[xi,yi])·cos(O,[u+Xi,v+Yi])+sin(O1[xi,yi])·sin(O2[u+Xi,v+Yi])

[0109] Otherwise, si=0;

[0110] For the first m elements on M1, the similarity integral value is calculated as follows:

[0111]

[0112] If S m If the following two equations are satisfied at the same time, the traversal of M1 elements is stopped;

[0113]

[0114]

[0115] Here we test S m Is the value less than the two S min The threshold value determined by g, if S m If the value of falls below both thresholds at the same time, the traversal of the M1 element can be terminated in advance (without traversing all n positions in M1), thereby improving the computational efficiency;

[0116] After stopping the traversal of M1, if S m > S, assign the value of S and update the coordinates of q to [u, v], otherwise keep S and q unchanged;

[0117] Traverse each element in M2 and add the coordinate values of the multiple q obtained in the end to the point set P;

[0118] If there are less than 5 elements in the point set P, make the center element of M1 coincide with point q on M2, set all elements on M2 corresponding to M1 to 0, and repeat the above steps;

[0119] After the template matching is completed, there will be 5 points in the point set P. These 5 points will be used as candidate sphere center images for subsequent screening.

[0120] Step S3, screening the image center of the metal ball, removing the noise points in the image center of the metal ball, and finally determining the position correspondence between the metal ball and the DR image; specifically includes the following steps:

[0121] Step S31, converting the pixel coordinate system to the space coordinate system;

[0122] Using the pixel size of the DR image (assuming the pixel size of the C-arm DR is a×b, this parameter can be directly obtained from the C-arm system), the pixel coordinates of the n candidate centers of the metal balls obtained in step S2 are converted into spatial length coordinates, and the spatial length coordinates of the n candidate centers of the metal balls form a point set P0;

[0123] The method for converting pixel coordinates to spatial length coordinates is as follows:

[0124] As Figure 6 shown, taking a vertex pixel O of the image as the starting point, a spatial length coordinate system is established at the vertex of this pixel. For the pixel point [m, n] located in the m-th row and n-th column of the image pixel array, the spatial length coordinate of this pixel is the coordinate of its center point in the spatial length coordinate system, and it is easy to obtain as [a×(m - 0.5), b×(n - 0.5)];

[0125] Because the metal balls are closely attached to the flat panel sensor, the actual spatial distance between the centers of their images (X-ray projections) is very close to the spatial distance between the centers of the metal balls. If two points are the centers of the images of metal balls, after converting their coordinates from the pixel coordinate system to the actual spatial length coordinate system, the distance between them will be very close to the distance between the corresponding metal ball centers.

[0126] Step S32, removing the noise points in the point set P0;

[0127] For each point ai in P0, calculate the distance between this point and the rest of the points in P0, and form an array Di of all the distances. Compare the array Di with each column of the matrix M0. If there are s groups of corresponding elements between the array Di and a certain column of the matrix M0 (the corresponding elements are defined as the absolute value of the difference between two elements in the two arrays being less than 0.3), then add the point ai to the point set P tmp ;

[0128] If the number of elements in P tmp is equal to the number of elements in P0, then the noise point removal step ends; otherwise, assign P tmp to P0, and perform noise point removal on the updated P0;

[0129] In each round of iteration, the number of elements in P0 will gradually decrease until all the noise points (the points whose distance array Di and M0 do not have enough corresponding elements) are removed. The value of s here can be defined by the user, but s needs to satisfy 2 < s < 5. If the initial P0 contains the centers of all 5 metal balls, there may be 4 groups of corresponding elements between Di and M0, and s = 4 can be used for screening. However, if the initial P0 only contains the centers of 4 metal balls (that is, one of the five extracted candidate ball center images is false and one of the real ball centers is not extracted), then n = 4 will cause the real metal ball center image points to be removed as well. Therefore, appropriately relaxing the value of s can ensure that when the initial P0 does not contain all the metal ball centers, there are still ball center image points remaining after noise point removal; s > 2 because at least 3 metal balls closely attached to the flat panel sensor are required for subsequent image calibration.

[0130] Step S33, determining the position correspondence between each metal ball and the DR image;

[0131] Assume that the number of elements remaining in P0 is m. For each point ai in P0, calculate the distance between the point and the rest of the points in P0. All distances are formed into an array Ki. Compare the array Ki with the columns of the matrix M0. If the (m-1) groups of corresponding elements of the two are all located in the jth column of M0, then the point ai is the actual metal ball p. j In this way, we traverse each element in the point set P0 and determine the image center coordinates corresponding to the center of each metal ball.

[0132] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for automatically extracting the position of a metal ball used for positioning in a C-arm DR image, characterized in that: The following steps are involved: Step S1, calculating the distribution characteristics of metal balls; Get the sensor close to the tablet n The coordinate values of the metal balls in the engineering design drawing of the image calibrator are calculated, and the distance between the centers of any two metal balls is obtained. n × n Matrix M 0; Step S2, extraction n Candidate center images of metal balls; Step S3, screening the image center of the metal ball, removing noise points in the image center of the metal ball, and finally determining the position correspondence between the metal ball and the DR image; Step S3 specifically includes the following steps: Step S31, converting the pixel coordinate system to the space coordinate system; Using the pixel size of the DR image, the image obtained in step S2 is converted to n The pixel coordinates of the candidate centers of the metal balls are converted into spatial length coordinates, and n The spatial length coordinates of the candidate centers of the metal balls constitute a point set P 0; Step S32: remove the point set P Noise points in 0; Step S33, determining the position correspondence between each metal ball and the DR image; for P Every point in 0 ai , calculate the point and P The distances of the remaining points in 0, all distances form an array Ki , compare arrays Ki With the matrix M 0, if the corresponding elements of the two are in M 0 in all in j Column, then point ai For actual metal balls p j The corresponding element is defined as the absolute value of the difference between two elements in the two array matrices is less than a preset value; Traverse the point set P For each element in 0, determine the image center coordinates corresponding to the center of each metal ball; In step S32, the method for removing noise points is: for P Every point in 0 ai , calculate the point and P The distances of the remaining points in 0, all distances form an array Di , compare arrays Di With the matrix M 0 columns, if the array Di With the matrix M 0 If there are s corresponding elements in a column, then the point ai Join the dot set P tmp , where 2 < s < n; like P tmp The number of elements is equal to P 0, the noise point removal step ends; otherwise P tmp Assign to P 0, for the updated P 0 for noise removal.

2. The method for automatically extracting the position of a metal ball used for positioning in a C-arm DR image according to claim 1, wherein: Step S2 specifically includes the following steps: Step S21, making a preoperative image template of a single metal ball; Step S22, extracting edge features of the image template and the intraoperative DR image respectively; Step S23, feature matching is performed between the image template and the intraoperative DR image to obtain n Candidate center images of a metal sphere.

3. The method for automatically extracting the position of a metal ball used for positioning in a C-arm DR image according to claim 2, wherein: In step S21, the method for making an image template of a single metal ball is: Before surgery, a C-arm DR image was taken. A rectangular area was manually selected on the DR image as the image template for a single metal ball. The rectangular area met the following conditions: The rectangular area only contains a complete image of a metal ball that is close to the flat sensor; The rectangular area is the minimum circumscribed rectangle of the complete image of the metal ball.

4. The method for automatically extracting the position of a metal ball used for positioning in a C-arm DR image according to claim 2, wherein: Step S22 specifically includes the following steps: Step S221, calculating the image grayscale gradient; The Sobel operator is used to perform convolution calculation on the image template to obtain the position of each pixel on the image template. x Axial grayscale value change gradient value and y Axial grayscale value change gradient value ; use 、 Calculate the gradient value of each pixel position on the image template separately and gradient direction A , and the maximum value of the gradient value of all pixel positions is ; The gradient value of each pixel position on the image template and gradient direction A Stored in the gradient value matrix M 1 and the gradient direction matrix O 1 in; The maximum gradient value of the intraoperative DR image is obtained by sampling in the same way as the image template. , gradient value matrix M 2 and the gradient direction matrix O 2; Step S222, gradient value non-maximum suppression; At the same time, traverse the image template M 1 and O 1 Each element in the matrix and update the matrix as follows M 1: like or ,but The value of is 0; Otherwise, The value of is updated to: ; in, L and R are a pair of adjacent elements of the matrix; The gradient matrix of the intraoperative DR image is updated using the same method as the image template. M 2; Step S223, extracting image edges using a hysteresis threshold method; Select two thresholds t 1. t 2, where 0 < t 1 < t 2 < 1; Traversing the matrix M Each element in 1, if ,but The value of remains unchanged; if , then The value of is set to 0; if , then further check and Are there any adjacent elements greater than or equal to t 2 elements, if any, then The value remains unchanged, otherwise The value of is set to 0; Use the same method as the image template to traverse and update M 2.

5. The method for automatically extracting the position of a metal ball used for positioning in a C-arm DR image according to claim 4, wherein: Step S23 specifically includes the following steps: Step S231, initialize an empty point set P Used to store the pixel coordinates of the candidate sphere center image obtained by template matching; Step S232, for M 2 elements [ u , v ],Will M The central element of 1 and [ u , v ]coincide; Traversal M 1, calculate the elements M 1 and M Similarity of 2; When the similarity meets the preset conditions, stop M 1, and the coordinates of the target sphere center image in the DR image q Updated to [ u , v ]; Step S233, traverse M 2, we get n The coordinates of the target sphere center images are stored in the point set P Inside.

Citation Information

Patent Citations

  • Template matching method based on gradient vector features of edge contour

    CN115131587A

  • Systems and methods for constructing genomic-based phenotypic models

    US20030233218A1