Recognition positioning method and device for surgical robot scale
By combining Canny edge detection and Hough circle transform with multiple recognition conditions, the surgical robot ruler can be automatically identified, solving the problem of reliance on manual intervention in existing technologies, improving the robustness and efficiency of recognition, and reducing surgical time and patient radiation.
Patent Information
- Application Number
- CN202310465227.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-26
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2043-04-26
AI Technical Summary
Existing surgical robot ruler recognition and positioning methods rely on manual intervention, which cannot be compatible with different models of C-arm imaging equipment or adapt to images of different qualities, resulting in inaccurate recognition, increased operation time and patient radiation exposure.
The Canny edge detection algorithm and Hough circle transform are used to identify the sphere of the marker. By setting multiple recognition conditions to filter candidate points and combinations, the marker structure is automatically identified, including combinations of candidate points, quadrilaterals and five-point structures. The radius threshold of the marker sphere is adjusted to ensure accuracy.
It enables automatic and accurate ruler recognition under different models of C-arm equipment and image quality conditions, reducing the number of intraoperative X-ray image retakes, shortening operation time and reducing patient radiation exposure.
Smart Images

Figure CN116580089B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of robot navigation and positioning, and more particularly relates to a surgical robot scale recognition and positioning method and device. BACKGROUND
[0002] When a robot performs image navigation surgery, it needs to use the X-ray images taken by a C-arm to perform surgical positioning, establish the coordinate mapping relationship between the surgical robot and the surgical space, and then guide the robot system to perform precise surgical planning and operation. The positioning process needs to take X-ray images from multiple angles with the patient's surgical area and the scale, and identify and sort the steel balls on the scale. If the identification is unsuccessful, it needs to be re-taken, increasing the surgery time and radiation dose. Therefore, efficiently and accurately identifying the scale in the X-ray image is the key to affecting the surgery time and quality.
[0003] The current surgical robot scale recognition and positioning method includes a semi-automatic recognition and positioning method and an automatic recognition and positioning method; the semi-automatic recognition and positioning method first sets a circular radius threshold by hand, detects all circles with a required circular radius in the image by a Hough circle transformation algorithm, finds the points corresponding to the scale steel balls by manual screening and manual sorting, and if there are unrecognized steel balls, the threshold is adjusted again for re-identification, but this method directly relies on manual steel ball positioning or image positioning scale steel ball region through manual framing, which cannot guarantee the accuracy and efficiency;
[0004] The automatic recognition and positioning method segments the foreground with steel balls by a single fixed threshold, then detects the connected regions of the binary image, screens out points with required area, circular radius, and ratio of inscribed circle to circumscribed circle as steel ball candidate points, and finally further screens and sorts these points according to the scale geometric structure; this method binarizes the image by a single threshold, which is easily disturbed by the image gray scale distribution, background such as surgical instruments and bones in the image, resulting in failure to detect some steel balls or detect too many candidate points and ultimately fail to correctly identify the scale as a whole; in addition, different C-arm models have different parameters and qualities of X-ray images, and the existing method usually needs to manually adjust the parameters for each model of equipment, limiting the portability;
[0005] Therefore, a method is needed that can be compatible with different models of C-arm imaging devices without manual intervention and adjustment, can adapt to different quality images, can automatically, efficiently and accurately identify the scale structure, can improve robustness and recognition rate, can reduce the number of intraoperative X-ray image retakes, and can further reduce the surgery time and the radiation dose received by the patient.
[0006] The information disclosed in the Background section of the present invention is only intended to enhance the understanding of the general background of the present invention and should not be taken as an acknowledgement or any form of suggestion that this information forms prior art that is already known to those skilled in the art. SUMMARY
[0007] The purpose of the present invention is to provide a surgical robot scale recognition positioning method and device, which can automatically complete the recognition and positioning of the surgical robot scale, efficiently and accurately recognize the scale structure, improve the robustness and recognition rate, reduce the number of re-shooting of intraoperative X-ray images, and further reduce the operation time and the radiation dose received by the patient.
[0008] To achieve the above purpose, the present invention provides a surgical robot scale recognition positioning method and device.
[0009] According to the first aspect of the present invention, a surgical robot scale recognition positioning method is provided, comprising:
[0010] S1, reading an intraoperative X-ray image containing a scale;
[0011] S2, performing image edge detection on the intraoperative image based on a Canny edge detection algorithm with a set edge detection threshold, and then identifying a circle within a set marker ball radius threshold range through a Hough circle transformation to obtain data of the circle;
[0012] S3, identifying the data of the circle according to a first identification condition to obtain all candidate points, which form a candidate point set;
[0013] S4, traversing all combinations of four candidate points in the candidate point set according to a second identification condition to obtain all quadrilaterals, which form a quadrilateral set;
[0014] S5, traversing all candidate points except the quadrilateral set according to a third identification condition to obtain all reference points, which form a five-point structure set with the corresponding quadrilaterals;
[0015] S6, traversing all combinations of two five-point structures in the five-point structure set according to a fourth identification condition to obtain a suspected scale, and jumping to S8; if the suspected scale is not identified, jumping to S7;
[0016] S7, adjusting the set marker ball radius threshold range and returning to S2;
[0017] S8, outputting the coordinates of the suspected scale.
[0018] Optionally, the set edge detection threshold is 60;
[0019] 3 ≦ set sign ball circle radius threshold range ≦ 10;
[0020] The data of the circle includes: the number of the circles and the coordinates corresponding to each of the circles.
[0021] Optionally, the first identification condition includes:
[0022] 10 ≦ the number of the circles ≦ 40.
[0023] Optionally, the S3 specifically includes:
[0024] According to the data of the circle, it is judged whether the number of the circles meets the first identification condition. If yes, the coordinates of each of the circles are the candidate points, and the candidate point set is formed. If not, the set edge detection threshold is adjusted in the set edge detection threshold adjustment range, and the S2 is returned.
[0025] If the number of the circles does not meet the first identification condition in the set adjustment range, the S7 is jumped to.
[0026] Wherein, 20 ≦ the set edge detection threshold adjustment range ≦ 200.
[0027] Optionally, the second identification condition includes:
[0028] Four of the candidate points can form a convex quadrilateral.
[0029] The modulus length of the opposite side vectors of the quadrilateral is less than 15 pixels.
[0030] 60° ≦ the adjacent side angle of the quadrilateral ≦ 120°.
[0031] 60° ≦ the diagonal angle of the quadrilateral ≦ 120°.
[0032] Optionally, the third identification condition includes:
[0033] The distance between the candidate point and the coordinates of the 16 possible positions of the reference point is less than 3 pixels.
[0034] Optionally, the S5 specifically includes:
[0035] According to the coordinates of each of the candidate points of the quadrilateral, the coordinates of the 16 possible positions of the reference point are calculated.
[0036] According to the third identification condition and the coordinates of the 16 possible positions of the reference point, all the reference points are obtained by traversing all the candidate points except the quadrilateral set, the corresponding quadrilateral of each reference point is sorted counterclockwise, and then the reference point forms the five-point structure, and all the five-point structures form the five-point structure set;
[0037] The five-point structure includes a first five-point structure and a second five-point structure.
[0038] The first five-point structure includes a first reference point and a corresponding first quadrilateral.
[0039] The second five-point structure includes a second reference point and a corresponding second quadrilateral.
[0040] In the first five-point structure, the coordinates of the first reference point are set as No. 9, the sorting of the first quadrilateral is that the upper left corner of the first quadrilateral is No. 1, the lower left corner of the first quadrilateral is No. 2, the lower right corner of the first quadrilateral is No. 3, the upper right corner of the first quadrilateral is No. 4, the No. 9 is located on the left side of the No. 2 and on the extension line between the No. 3 and the No. 2.
[0041] In the second five-point structure, the coordinates of the second reference point are set as No. 10, the sorting of the second quadrilateral is that the upper left corner of the second quadrilateral is No. 5, the lower left corner of the second quadrilateral is No. 6, the lower right corner of the second quadrilateral is No. 7, the upper right corner of the second quadrilateral is No. 8, and the No. 10 is located between the No. 5 and the No. 8 and on the line segment formed by the No. 5 and the No. 8.
[0042] Optionally, the fourth identification condition includes:
[0043] The coordinates of all candidate points of the two five-point structures are different;
[0044] The reference points of the two five-point structures correspond to the No. 9 and the No. 10 respectively;
[0045] The included angle between the line segment between the No. 9 and the No. 3 and the line segment between the No. 10 and the No. 5 is less than 10°;
[0046] The included angle between the line segment between the No. 1 and the No. 2 and the line segment between the No. 8 and the No. 7 is less than 10°;
[0047] The length of the line segment between the No. 1 and the No. 3 is greater than the length of the line segment between the No. 5 and the No. 7;
[0048] The intersection points of the lines formed by positions 1 and 5, 2 and 6, 3 and 7, and 4 and 8 are obtained by fitting using the least squares method. The mean square error of the distance between the intersection point and the four lines is less than 3 pixels.
[0049] Optionally, S8 specifically includes:
[0050] If only one suspected ruler is identified, the coordinates of the suspected ruler are directly output.
[0051] If multiple suspected rulers are identified, the coordinates of the suspected ruler with the smallest mean square error in step S6 are output.
[0052] If the upper limit of the set threshold range for the radius of the marker sphere exceeds the set upper limit, then the output "No suspected ruler detected" will be displayed.
[0053] The upper limit of the threshold range for the radius of the marker sphere is set to 20.
[0054] According to a second aspect of the present invention, a surgical robot scale identification and positioning device is provided for performing the surgical robot scale identification and positioning method according to any one of the first aspects, comprising:
[0055] The reading module is used to read intraoperative X-ray images containing scales;
[0056] The detection and recognition module is used to perform image edge detection on the intraoperative image based on the Canny edge detection algorithm with a set edge detection threshold, and then identify circles within the set radius threshold range of the marker sphere through Hough circle transform, and obtain the data of the circles;
[0057] The first identification module is used to identify the circular data according to the first identification condition, obtain all candidate points, and form a candidate point set;
[0058] The second identification module is used to traverse all combinations of four candidate points in the candidate point set according to the second identification conditions, obtain all quadrilaterals, and form a quadrilateral set.
[0059] The third identification module is used to traverse all candidate points except the quadrilateral set according to the third identification condition, obtain all reference points, and the reference points and the corresponding quadrilaterals form a five-point structure, thereby forming a five-point structure set.
[0060] The fourth identification module is used to traverse all combinations of two of the five-point structures in the five-point structure set according to the fourth identification condition, obtain the suspected ruler, and jump to the output module; if the suspected ruler is not identified, jump to the adjustment and execution module.
[0061] The adjustment and execution module is used to adjust the set threshold range of the radius of the marker sphere and then return to the first identification module for execution.
[0062] The output module is used to output the coordinates of the suspected ruler.
[0063] The beneficial effects of this invention are as follows: This invention identifies all circles within a set threshold range of the radius of a marker sphere by setting an edge detection threshold. If the number of all circles does not meet the first identification condition, the set edge detection threshold is adjusted until it meets the first identification condition. Then, the ruler is identified through the second, third, and fourth identification conditions, and the coordinates of the ruler are obtained. If the ruler is not identified, the identification is re-performed by adjusting the set threshold range of the marker sphere radius. This invention can automatically identify and position the robot ruler without manual intervention and is compatible with different models of C-arm imaging equipment. It can adapt to images of different qualities, efficiently and accurately identify the ruler structure, improve robustness and recognition rate, reduce the number of retakes of intraoperative X-ray images, and thus reduce the operation time and the radiation dose received by the patient.
[0064] The system of the present invention has other features and advantages that will be apparent from or will be set forth in detail in the accompanying drawings and following detailed description, which together serve to explain the particular principles of the invention. Attached Figure Description
[0065] The above and other objects, features and advantages of the present invention will become more apparent from the accompanying drawings, in which like reference numerals generally denote like parts.
[0066] Figure 1 A flowchart illustrating the steps of a surgical robot ruler identification and positioning method according to the present invention is shown.
[0067] Figure 2 A schematic diagram showing the possible locations of reference points corresponding to each quadrilateral in a surgical robot scale identification and positioning method according to the present invention is provided.
[0068] Figure 3 A schematic diagram of the structure of a suspected ruler is shown in the method for identifying and locating a ruler for a surgical robot according to the present invention.
[0069] Figure 4 A flowchart illustrating the steps of a surgical robot ruler identification and positioning method according to Embodiment 1 of the present invention is shown.
[0070] Figure 5 A schematic diagram of a surgical robot ruler identification and positioning device according to Embodiment 2 of the present invention is shown. Detailed Implementation
[0071] The invention will now be described in more detail with reference to the accompanying drawings. While preferred embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that the invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
[0072] like Figure 1 As shown, a method for identifying and locating a scale on a surgical robot according to the present invention includes:
[0073] S1. Read the intraoperative X-ray image containing the scale;
[0074] S2. Based on the Canny edge detection algorithm, image edge detection is performed on the intraoperative image with a set edge detection threshold. Then, the Hough circle transform is used to identify circles within the set threshold range of the marker sphere radius and obtain the circle data.
[0075] S3. Identify the circular data according to the first identification condition, obtain all candidate points, and form a candidate point set;
[0076] S4. According to the second identification condition, traverse all combinations of four candidate points in the candidate point set to obtain all quadrilaterals and form a quadrilateral set.
[0077] S5. According to the third recognition condition, traverse all candidate points except the quadrilateral set to obtain all reference points. The reference points and the corresponding quadrilaterals form a five-point structure, and then form a five-point structure set.
[0078] S6. Based on the fourth identification condition, traverse all combinations of two five-point structures in the five-point structure set to obtain the suspected ruler and jump to S8; if no suspected ruler is identified, jump to S7.
[0079] S7. Adjust the set threshold range for the radius of the marker sphere, then return to S2;
[0080] S8. Output the coordinates of the suspected ruler.
[0081] Specifically, S1, read the intraoperative X-ray image containing the scale, set the threshold range of the radius of the marker sphere of the scale, and set the edge detection threshold, for example, initialize the upper and lower limits of the marker sphere radius to 3 to 10, and initialize the edge detection threshold to 60;
[0082] S2. Based on the Canny edge detection algorithm, image edge detection is performed on intraoperative X-ray images using a set edge detection threshold to extract edge information. Then, Hough circle transform is used to find circles whose radii fall within the threshold range of the radius of a marker sphere on a set scale, obtaining circle data. The circle data includes the number of circles and their corresponding coordinates. Hough circle transform is the process of converting a circle in two-dimensional image space into a point in three-dimensional parameter space determined by the radius and center coordinates of that circle. For example, image edge detection is performed on intraoperative X-ray images using the Canny edge detection algorithm with a set edge detection threshold. The algorithm calculates the gradient of all pixels using the Sobel operator, iterates through all non-zero pixels after the Canny image, draws lines along the gradient direction, and assigns an accumulator to each point. When a line passes through a point, the accumulator is incremented by 1. All accumulators are sorted. Based on the set edge detection threshold, all possible circle centers are found. The distances of all non-zero pixels in the Canny image from the circle centers are calculated and sorted from smallest to largest. Radius within the threshold range of the radius of the marker sphere on the set scale is selected. An accumulator is set for the selected radius. For accumulators that satisfy radius r, the accumulator is incremented by 1. The final value of the accumulator is the number of detected circles.
[0083] S3. Determine whether the number of all circles obtained in S2 meets the first recognition condition. If it meets the first recognition condition, the coordinates of each circle are candidate points, and the coordinates of these circles are combined into a candidate point set. If it does not meet the condition, adjust the set edge detection threshold and return to S2. If the number of circles obtained within the set edge detection threshold adjustment range does not meet the first recognition condition, jump to S7.
[0084] For example, the first recognition condition is 10 ≤ number of circles ≤ 40, the set edge detection threshold is 60, and the set edge detection threshold adjustment range is 20-200. If the number of circles detected in S2 is 30, then the coordinates of these 30 circles are used as candidate points to form a candidate point set. If the number of circles detected in S2 is 5, then the set edge detection threshold is adjusted to 40, and then S2 is returned to re-acquire the circle data. If the number of circles obtained in S2 by adjusting the set edge detection threshold within the range of 20-200 does not meet the first recognition condition, then the process jumps to S7.
[0085] S4. According to the second recognition condition, traverse all combinations of four candidate points in the candidate point set. The combination of four candidate points that meet the second recognition condition is a quadrilateral. All quadrilaterals form a quadrilateral set. Record the coordinates of each candidate point in the set.
[0086] S5. According to the third recognition condition, traverse all candidate points except the quadrilateral set. Candidate points that meet the third recognition condition are reference points. All reference points and their corresponding quadrilaterals form a five-point structure. All five-point structures form a five-point structure set. Record the coordinates of all candidate points in the five-point structure.
[0087] S6. According to the fourth identification condition, traverse all combinations consisting of two five-point structures in the five-point structure set. If there is a combination consisting of two five-point structures that meets the fourth identification condition, then determine that the combination is a suspected ruler, obtain the coordinates of the ruler, and jump to S8; if no combination that meets the fourth identification condition is identified, then jump to S7.
[0088] S7. Adjust the set threshold range of the marker sphere radius, return to S2, until a suspected ruler is detected or the upper limit of the set threshold range of the marker sphere radius is reached;
[0089] S8. Output the coordinates of the suspected ruler.
[0090] In one example, the edge detection threshold is set to 60;
[0091] 3≦The set threshold range for the radius of the marker sphere is ≦10;
[0092] The circular data includes: the number of circles and the coordinates of each circle.
[0093] Specifically, the initial edge detection threshold is 60. The smaller the threshold, the more sensitive the edge detection, and the easier it is to detect image edges, but it is also easier to detect noise interference. The initial threshold range for the radius of the marker sphere is 3-10. The data for the sphere includes the number of spheres and the coordinates of each sphere.
[0094] In one example, the first identification criteria include:
[0095] 10 ≤ Number of circles ≤ 40.
[0096] Specifically, the number of circles ranges from 10 to 40, which is used to identify whether the number of circles obtained in S2 is within this range. This range can be adjusted according to the actual situation.
[0097] In one example, S3 specifically includes:
[0098] Based on the data of the circles, determine whether the number of circles meets the first recognition condition. If it does, the coordinates of each circle are candidate points, forming a candidate point set. If it does not meet the condition, adjust the set edge detection threshold within the set adjustment range and return to S2.
[0099] If the number of circles within the set adjustment range does not meet the first recognition condition, then proceed to S7;
[0100] Among them, 20≦ is the set edge detection threshold adjustment range≦200.
[0101] Specifically, the first identification condition is used to identify whether the circles obtained in S2 are candidate points. If the number of circles obtained in S2 meets the first identification condition, the coordinates of each circle are candidate points, and all the obtained circles form a candidate point set. If they do not meet the condition, the set edge detection threshold is adjusted, and the process returns to S2 until a candidate point set is obtained or the adjusted edge detection threshold exceeds the set edge detection threshold adjustment range. If the number of circles within the set adjustment range does not meet the first identification condition, the process jumps to S7. The set edge detection threshold adjustment range is 20-200.
[0102] In one example, the second identification condition includes:
[0103] The four candidate points can form a convex quadrilateral;
[0104] The magnitude of the difference between the opposite side vectors of a quadrilateral is less than 15 pixels;
[0105] 60° ≦ the included angle between adjacent sides of a quadrilateral ≦ 120°;
[0106] 60° ≦ The included angle between the diagonals of a quadrilateral ≦ 120°.
[0107] Specifically, if a combination of four candidate points in the candidate point set satisfies the following four conditions: the four candidate points can form a convex quadrilateral; the magnitude of the difference between the opposite side vectors of the quadrilateral is less than 15 pixels; 60° ≦ the included angle between adjacent sides of the quadrilateral ≦ 120°; 60° ≦ the included angle between the diagonals of the quadrilateral ≦ 120°; then the combination of these four candidate points is a quadrilateral, and all quadrilaterals form a quadrilateral set.
[0108] In one example, the third identification condition includes:
[0109] The distance between the coordinates of the 16 possible locations of the candidate point and the reference point is less than 3 pixels.
[0110] Specifically, if the distance between a candidate point in the candidate point set and a non-quadrilateral set and the coordinates of all 16 possible locations of the reference point is less than 3 pixels, then this candidate point is the reference point.
[0111] In one example, S5 specifically includes:
[0112] Calculate the coordinates of 16 possible locations for the reference point based on the coordinates of each candidate point of the quadrilateral; for example... Figure 2 As shown, the white circle represents the coordinates of the 16 possible positions of the reference point, and the black circle represents the coordinates of the four candidate points of the quadrilateral.
[0113] Based on the third identification condition and the coordinates of the 16 possible locations of the reference point, traverse all candidate points except the quadrilateral set to obtain all reference points. Sort the quadrilaterals corresponding to each reference point counterclockwise, and then form a five-point structure with the reference point. All five-point structures form a five-point structure set.
[0114] The five-point structure includes: the first five-point structure and the second five-point structure;
[0115] The first five-point structure includes: the first reference point and the corresponding first quadrilateral;
[0116] The second five-point structure includes: the second reference point and the corresponding second quadrilateral.
[0117] like Figure 3 As shown, in the first five-point structure, the coordinates of the first reference point are set to position 9. Then the order of the first quadrilateral is as follows: the upper left corner of the first quadrilateral is position 1, the lower left corner of the first quadrilateral is position 2, the lower right corner of the first quadrilateral is position 3, the upper right corner of the first quadrilateral is position 4, and position 9 is located to the left of position 2 and on the extension line of the line segment between position 3 and position 2.
[0118] In the second five-point structure, the coordinates of the second reference point are set to position 10. Then the arrangement of the second quadrilateral is as follows: the upper left corner of the second quadrilateral is position 5, the lower left corner of the second quadrilateral is position 6, the lower right corner of the second quadrilateral is position 7, the upper right corner of the second quadrilateral is position 8, and position 10 is located between positions 5 and 8, and is located on the line segment formed by positions 5 and 8.
[0119] In one example, the fourth identification condition includes:
[0120] The coordinates of all candidate points in the two five-point structures are different;
[0121] like Figure 3 As shown, the reference points for the two five-point structures correspond to positions 9 and 10, respectively;
[0122] The angle between the line segment between position 9 and position 3 and the line segment between position 10 and position 5 is less than 10°;
[0123] The angle between the line segment between position 1 and position 2 and the line segment between position 8 and position 7 is less than 10°;
[0124] The length of the line segment between position 1 and position 3 is greater than the length of the line segment between position 5 and position 7;
[0125] The intersection points of the lines formed by positions 1 and 5, 2 and 6, 3 and 7, and 4 and 8 were obtained by fitting the least squares method. The mean square error of the intersection points with the distance from the four lines was less than 3 pixels.
[0126] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but this is not intended to limit the invention. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present invention can be combined with each other.
[0127] Example 1
[0128] like Figure 4 As shown, this embodiment provides a method for identifying and locating a scale on a surgical robot, including:
[0129] Step 1. Read intraoperative images; initialize the upper and lower limits of the steel ball radius to 3 to 10;
[0130] Step 2. Initialize the Canny edge detector threshold to 60;
[0131] Step 3. Based on the Canny edge detection algorithm, extract edge information from the intraoperative image, and then use Hough circle transform to find circles whose radii are within the upper and lower limits of the steel ball's radius from the edge information and obtain their position coordinates.
[0132] Step 4. Determine if the number of detected circles is between 10 and 40; if it exceeds the range, increase or decrease the Canny edge detector threshold accordingly and repeat steps 3-4; if it is within the range, use the coordinates of these circles as a candidate point set; if the edge detector threshold exceeds the set edge detector threshold range, i.e., 20 to 200, go to step 8.
[0133] Step 5. Iterate through all combinations of four points in the candidate point set, and determine if any combination can construct a quadrilateral that meets the requirements. If so, store the compliant combination in the candidate quadrilateral set; the judgment criteria are as follows:
[0134] a) The four points in the combination can form a convex quadrilateral;
[0135] b) The magnitude of the difference between the opposite side vectors of the quadrilateral formed is less than 15 pixels;
[0136] c) The included angle between the adjacent sides of the quadrilateral formed is in the range of 60-120 degrees;
[0137] d) The included angle of the diagonals of the quadrilateral formed is in the range of 60-120 degrees;
[0138] Step 6. For each quadrilateral in the candidate quadrilateral set, iterate through all points in the candidate point set after removing the four points of the quadrilateral, and determine if there is a reference point that meets the requirements. If so, sort the reference point and the four points of the corresponding quadrilateral as a whole and store them in the candidate five-point structure set; the specific steps are as follows:
[0139] a) Calculate the coordinates of the 16 possible positions of the reference point corresponding to the quadrilateral; for example... Figure 2 As shown, the white circles represent the coordinates of the 16 possible locations of the reference point, and the black circles represent the four points of the quadrilateral.
[0140] b) For all other points in the candidate point set, determine in turn whether the distance between each point and the 16 locations is less than 3 pixels;
[0141] c) If so, sort the four points of the quadrilateral accordingly, with two cases: if the reference point corresponds to point 9, then the quadrilateral corresponds to points 1-4; if the reference point corresponds to point 10, then the quadrilateral corresponds to points 5-8, and so on. Figure 3 As shown;
[0142] Step 7. For all pairwise combinations in the candidate five-point structure set, determine whether the resulting 10 points conform to the scale 3D structure. If so, store them in the candidate result set; Figure 3 As shown, the judgment criteria are as follows:
[0143] a) There are no overlapping points between the two five-point structures;
[0144] b) The two five-point structures correspond to points 9 and 10 respectively, with no overlap;
[0145] c) The angle between line segment 10-5 and line segment 9-3 is less than 10 degrees;
[0146] d) The angle between line segment 1-2 and line segment 8-7 is less than 10 degrees;
[0147] e) The length of line segment 1-3 is greater than that of line segment 5-7;
[0148] f) The intersection point of the four lines 1-5, 2-6, 3-7 and 4-8 is fitted by the least squares method. The mean square error of the distance between the intersection point and the four lines is less than 3 pixels.
[0149] Step 8. If there is only one result in the candidate result set, output that result and end; if there is more than one result, output the result with the smallest mean square error in step 7, and indicate that multiple rulers have been detected, and end; if there is no candidate result, it is determined that the radius of the steel ball in the image exceeds the upper limit initialized in step 1, increase the upper and lower limits of the steel ball radius, and repeat steps 2-8; if the upper limit of the steel ball radius exceeds the set allowable range, that is, the upper limit exceeds 20, indicate that no ruler has been detected, and end.
[0150] Example 2
[0151] like Figure 5 As shown, this embodiment provides a surgical robot ruler identification and positioning device for performing the surgical robot ruler identification and positioning method described in any one of Embodiment 1, including:
[0152] The reading module is used to read intraoperative X-ray images containing scales;
[0153] The detection and recognition module is used to perform image edge detection on intraoperative images based on the Canny edge detection algorithm with a set edge detection threshold, and then identify circles within the set radius threshold range of the marker sphere through Hough circle transform to obtain circle data.
[0154] The first recognition module is used to recognize circular data according to the first recognition conditions, obtain all candidate points, and form a candidate point set;
[0155] The second recognition module is used to traverse all combinations of four candidate points in the candidate point set according to the second recognition conditions, obtain all quadrilaterals, and form a quadrilateral set.
[0156] The third recognition module is used to traverse all candidate points except the quadrilateral set according to the third recognition condition, obtain all reference points, and form a five-point structure with the reference points and the corresponding quadrilaterals, thereby forming a five-point structure set.
[0157] The fourth identification module is used to traverse all combinations of two five-point structures in the five-point structure set according to the fourth identification condition, obtain the suspected ruler, and jump to the output module; if no suspected ruler is identified, jump to the adjustment and execution module.
[0158] The adjustment and execution module is used to adjust the set threshold range of the marker sphere radius and then return to the first recognition module for execution.
[0159] The output module is used to output the coordinates of the scale.
[0160] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments.
Claims
1. A method for identifying and locating a scale on a surgical robot, characterized in that, The method comprises: S1, reading an intraoperative X-ray image containing a scale; S2, performing image edge detection on the X-ray image based on a Canny edge detection algorithm with a set edge detection threshold, and then identifying a circle within a set marker ball circle radius threshold range through a Hough circle transformation to obtain data of the circle; S3, identifying the data of the circle according to a first identification condition to obtain all candidate points to form a candidate point set; S4, traversing all combinations of four candidate points in the candidate point set according to a second identification condition to obtain all quadrilaterals to form a quadrilateral set; S5, traversing all candidate points other than the quadrilateral set according to a third identification condition to obtain all reference points, the reference points and the corresponding quadrilaterals forming a five-point structure, and then forming a five-point structure set; S6, traversing all combinations of two five-point structures in the five-point structure set according to a fourth identification condition to obtain a suspected scale, and jumping to S8; If the suspected scale is not identified, jumping to S7; S7, adjusting the set marker ball circle radius threshold range, and returning to S2; S8, outputting the coordinates of the suspected scale.
2. The identification positioning method of a surgical robot scale according to claim 1, characterized by, The set edge detection threshold is 60; 3≤ the set marker ball circle radius threshold range ≤10; The data of the circle comprises: the number of the circles and the coordinates corresponding to each circle.
3. The identification positioning method of a surgical robot scale according to claim 2, characterized by, The first identification condition comprises: 10≤ the number of the circles ≤40.
4. The identification positioning method of a surgical robot scale according to claim 3, characterized by, S3 specifically comprises: determining whether the number of the circles meets the first identification condition according to the data of the circles, if yes, the coordinates of each circle are the candidate points to form the candidate point set, if not, adjusting the set edge detection threshold within a set edge detection threshold adjustment range, and returning to S2; if the number of the circles does not meet the first identification condition within the set adjustment range, jumping to S7; wherein 20≤ the set edge detection threshold adjustment range ≤200.
5. The identification positioning method of a surgical robot scale according to claim 1, characterized by, The second identification condition comprises: four candidate points can form a convex quadrilateral; the modulus of the difference between the opposite side vectors of the quadrilateral is less than 15 pixels; 60°≤ the adjacent side angle of the quadrilateral ≤120°; 60°≤ the diagonal angle of the quadrilateral ≤120°.
6. The identification positioning method of a surgical robot scale according to claim 1, characterized by, The third identification condition comprises: the distance between the candidate point and the coordinates of the 16 possible positions of the reference point is less than 3 pixels.
7. The identification positioning method of a surgical robot scale according to claim 6, characterized by, S5 specifically comprises: calculating the coordinates of the 16 possible positions of the reference point according to the coordinates of each candidate point of the quadrilateral; traversing all candidate points other than the quadrilateral set according to the third identification condition and the coordinates of the 16 possible positions of the reference point to obtain all reference points, sorting the corresponding quadrilaterals of each reference point counterclockwise, and then forming the five-point structure with the reference point, all five-point structures forming the five-point structure set; wherein the five-point structure comprises: a first five-point structure and a second five-point structure; the first five-point structure comprises: a first reference point and a corresponding first quadrilateral; The second five-point structure comprises a second reference point and a corresponding second quadrangle In the first five-point structure, the coordinate of the first reference point is set as No. 9, and the order of the first quadrangle is that the upper left corner of the first quadrangle is No. 1, the lower left corner of the first quadrangle is No. 2, the lower right corner of the first quadrangle is No. 3, the upper right corner of the first quadrangle is No. 4, the No. 9 is located on the left side of the No. 2 and on the extension line of the line segment between the No. 3 and the No. 2; In the second five-point structure, the coordinate of the second reference point is set as No. 10, and the order of the second quadrangle is that the upper left corner of the second quadrangle is No. 5, the lower left corner of the second quadrangle is No. 6, the lower right corner of the second quadrangle is No. 7, the upper right corner of the second quadrangle is No. 8, and the No. 10 is located between the No. 5 and the No. 8 and on the line segment formed by the No. 5 and the No.
8.
8. The identification positioning method of a surgical robot scale according to claim 7, characterized by, The fourth identification condition comprises: The coordinates of all candidate points of the two five-point structures are different; The reference points of the two five-point structures correspond to the No. 9 and the No. 10 respectively; The included angle between the line segment between the No. 9 and the No. 3 and the line segment between the No. 10 and the No. 5 is less than 10°; The included angle between the line segment between the No. 1 and the No. 2 and the line segment between the No. 8 and the No. 7 is less than 10°; The length of the line segment between the No. 1 and the No. 3 is greater than the length of the line segment between the No. 5 and the No. 7; The intersection point of the straight line formed by the No. 1 and the No. 5, the straight line formed by the No. 2 and the No. 6, the straight line formed by the No. 3 and the No. 7 and the straight line formed by the No. 4 and the No. 8 is fitted by the least square method, and the mean square error of the distance between the intersection point and the above four straight lines is less than 3 pixels.
9. The identification positioning method of a surgical robot scale according to claim 8, characterized by, The S8 specifically comprises: If the suspected scale is one, the coordinates of the suspected scale are directly outputted; If the suspected scale is multiple, the coordinates of the suspected scale with the minimum mean square error in the S6 are outputted; If the upper limit of the set threshold range of the marker ball radius exceeds the set upper limit, it is outputted that the suspected scale is not detected. The upper limit of the set threshold range of the marker ball radius is 20.
10. A surgical robot scale identification positioning apparatus, characterized by, A surgical robot scale identification positioning method for performing any one of claims 1-9, comprising: a reading module for reading an intraoperative X-ray image containing a scale; a detection and identification module for performing image edge detection on the X-ray image based on a Canny edge detection algorithm with a set edge detection threshold, and then identifying a circle within a set marker ball radius threshold range through a Hough circle transformation to obtain data of the circle; a first identification module for identifying the data of the circle according to a first identification condition to obtain all candidate points to form a candidate point set; The second identification module is configured to traverse all combinations of four candidate points in the candidate point set according to a second identification condition, to obtain all quadrilaterals, and to form a quadrilateral set; The third identification module is configured to traverse all candidate points except the quadrilaterals in the quadrilateral set according to a third identification condition, to obtain all reference points, and to form a five-point structure set, wherein each reference point and a corresponding quadrilateral form a five-point structure; The fourth identification module is configured to traverse all combinations of two five-point structures in the five-point structure set according to a fourth identification condition, to obtain a suspected scale, and to jump to an output module; if the suspected scale is not identified, jump to an adjustment and execution module; The adjustment and execution module is configured to adjust the set scale ball radius threshold range, and return to the first identification module for execution; The output module is configured to output the coordinates of the scale.
Citation Information
Patent Citations
Automatic identification method of positioning mark points of surgical robot
CN104123540A
Endoscope measurement method and device based on image recognition
CN115345851A