Method, device and computer equipment for calculating C-arm image error
By performing image calibration and matrix decomposition on the C-arm image, automated analysis of the C-arm image error is realized, solving the problems of error analysis accuracy and three-dimensional error acquisition in the existing technology, and improving the accuracy and safety of the analysis. .
Patent Information
- Application Number
- CN202311333290.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-13
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2043-10-13
AI Technical Summary
Existing technology relies on human eye judgment in C-arm image error analysis, which is difficult to guarantee accuracy and cannot obtain error values in three-dimensional space. Traditional methods require reference images or manual annotation of data, and automated methods are limited.
By controlling the C-arm to radiate the small ball device, using image calibration and decomposition matrix technology, the two-dimensional projection matrix is obtained and decomposed into a three-dimensional matrix, the error of the C-arm image is calculated, and automated two-dimensional and three-dimensional error analysis is realized .
It improves the accuracy and detail of error analysis, reduces the number of radiations to the patient, reduces radiation damage, obtains more accurate plane and spatial error values, and enhances intraoperative planning and analysis reference.
Smart Images

Figure CN117522780B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application belong to the field of medical technology, and in particular, relate to a method, device and computer equipment for calculating C-arm image errors. Background Art
[0002] The C-arm is a medical device that can be used for imaging. It is called a C-arm because its frame resembles the shape of the letter "C". At present, the two-dimensional C-arms widely used for X-ray imaging mainly include barrel type and flat type. Take the flat C-arm as an example. It consists of a flat detector and a C-arm, which can provide real-time X-ray imaging during surgery to help doctors better complete the surgery. However, in actual applications, there are errors in the X-ray images obtained by C-arm imaging. These errors may lead to inaccurate surgical results and may even bring unnecessary risks to patients. Therefore, accurate analysis and measurement of C-arm image errors is a very important part of the surgical process.
[0003] Traditional error analysis mainly relies on the doctor's human eye to judge the X-ray image. This method is affected by the doctor's experience and subjectivity, and its accuracy is difficult to guarantee. In recent years, with the development of computer vision and image processing technology, more and more automated methods have been used to analyze C-arm image errors. For example, methods based on feature points, methods based on shape matching, methods based on neural networks, etc., have all been applied to the analysis of C-arm image errors. However, most of these methods need to be used for error analysis with the help of reference images or manually annotated data. Moreover, the analysis of C-arm image errors using these methods can only obtain error values in two-dimensional (2D) images, and cannot obtain error values in three-dimensional (3D) space. Summary of the invention
[0004] In view of this, an embodiment of the present application provides a method, device and computer equipment for calculating C-arm image errors, so as to analyze C-arm image errors and obtain accurate error analysis results.
[0005] A first aspect of an embodiment of the present application provides a method for calculating a C-arm image error, comprising:
[0006] Controlling the C-arm to irradiate the small ball device to obtain a C-arm image, wherein the small ball device is provided with multiple rows of small balls, each row includes a plurality of small balls of equal number, and the multiple rows of small balls are distributed in a trapezoidal shape;
[0007] By performing image calibration on the C-arm image, a two-dimensional projection matrix is obtained, where the two-dimensional projection matrix is a calibration matrix in the image calibration process;
[0008] Decomposing the two-dimensional projection matrix into a three-dimensional matrix;
[0009] The error of the C-arm image is calculated according to the two-dimensional projection matrix and the three-dimensional matrix.
[0010] A second aspect of an embodiment of the present application provides a C-arm image error calculation device, comprising:
[0011] A radiation module, used for controlling the C-arm to radiate the small ball device to obtain a C-arm image, wherein the small ball device is provided with a plurality of rows of small balls, each row includes a plurality of small balls of equal number, and the plurality of rows of small balls are distributed in a trapezoidal shape;
[0012] A calibration module, used for obtaining a two-dimensional projection matrix by performing image calibration on the C-arm image, wherein the two-dimensional projection matrix is a calibration matrix in the image calibration process;
[0013] A decomposition module, used for decomposing the two-dimensional projection matrix into a three-dimensional matrix;
[0014] A calculation module is used to calculate the error of the C-arm image according to the two-dimensional projection matrix and the three-dimensional matrix.
[0015] A third aspect of an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for calculating the C-arm image error as described in the first aspect above is implemented.
[0016] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for calculating the C-arm image error as described in the first aspect above is implemented.
[0017] A fifth aspect of an embodiment of the present application provides a computer program product. When the computer program product is run on a computer, the computer executes the method for calculating the C-arm image error described in the first aspect.
[0018] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0019] By applying the error calculation method provided in the embodiment of the present application, a special small ball device can be used as the object to be irradiated, and the C-arm can be controlled to irradiate the small ball device to obtain the corresponding radiological image. Then, based on automated image processing methods such as image calibration, the C-arm image is processed and analyzed to obtain accurate error analysis results including two-dimensional error and three-dimensional error, providing doctors with more detailed intraoperative planning and analysis references. Secondly, by applying this method, a special small ball device with multiple small balls can be irradiated before or during surgery to perform error analysis, which can reduce the number of radiations to the patient and reduce the radiation damage to the patient during the radiation process. Third, combined with a specially made small ball device, this method can obtain radiological images at multiple angles, and the radiological images at each angle can be used for image processing and analysis. Through multiple error analyses, more accurate error values in planes and spaces can be obtained, further improving the accuracy of the error analysis results. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 is a schematic diagram of a method for calculating a C-arm image error provided in an embodiment of the present application;
[0022] Figure 2 is a schematic diagram of a possible implementation of S102 in a method for calculating a C-arm image error provided in an embodiment of the present application;
[0023] Figure 3 is a schematic diagram of a possible implementation of S104 in a method for calculating a C-arm image error provided in an embodiment of the present application;
[0024] Figure 4 is a schematic diagram of another possible implementation of S104 in a method for calculating a C-arm image error provided in an embodiment of the present application;
[0025] Figure 5 is a schematic diagram of a calculation process of a C-arm image error provided in an embodiment of the present application;
[0026] Figure 6 is a schematic diagram of a C-arm image error calculation device provided in an embodiment of the present application;
[0027] Figure 7It is a schematic diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] In the following description, specific details such as specific system structures, technologies, etc. are proposed for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from hindering the description of the present application.
[0029] The technical solution of the present application is described below through specific embodiments.
[0030] Reference Figure 1 , shows a schematic diagram of a method for calculating a C-arm image error provided by an embodiment of the present application, which may specifically include the following steps:
[0031] S101, controlling the C-arm to irradiate the small ball device to obtain a C-arm image, wherein the small ball device is provided with multiple rows of small balls, each row includes a plurality of small balls of equal number, and the multiple rows of small balls are distributed in a trapezoidal shape.
[0032] This method can be applied to computer equipment, that is, the executor of this method is a computer equipment. By executing the various steps of the embodiments of the present application, the computer equipment can analyze the errors of the C-arm image and obtain accurate two-dimensional and three-dimensional errors of the C-arm image.
[0033] The computer device in the embodiment of the present application can be a component unit of the C-arm, that is, the computer device is installed on the C-arm as a functional unit or module. When the C-arm radiates and obtains an image, the computer device as a functional unit or module of the C-arm can immediately perform error analysis on the image and output corresponding analysis results. Alternatively, the computer device can also be an independent device that can communicate with the C-arm via wired or wireless means. When the C-arm radiates and obtains an image, the C-arm can send the image to the computer device, which performs error analysis on the image and outputs corresponding analysis results.
[0034] Before analyzing the C-arm image, the computer device can control the C-arm to radiate the target object to obtain the C-arm image. The C-arm in the embodiment of the present application can be a two-dimensional flat C-arm, and accordingly, the C-arm image obtained by radiation can be a two-dimensional X-ray image.
[0035] In the embodiment of the present application, the target object may be a specially arranged small ball device, in which multiple rows of small balls may be arranged, each row may include multiple small balls of the same size, and the number of the multiple small balls included in each row may be equal. For example, 13 rows of small balls may be arranged in the small ball device, each row may include 13 small balls, and the diameter of each small ball may be 1.5 millimeters (mm). In this way, the entire small ball device may include 13*13=169 small balls with a diameter of 1.5 mm.
[0036] As an example of a small ball device, the distances between small balls in each row may be different. For example, the distances between small balls in the same row may be equal, but the distances between small balls in different rows may be different, and the distances between small balls in the next row are greater than the distances between small balls in the previous row. In this way, the small balls in multiple rows in the small ball device may be distributed in a trapezoidal shape. Alternatively, the distances between small balls in the same row may be different, and the sum of the distances between small balls in the next row is greater than the sum of the distances between small balls in the previous row. In this way, the small balls in multiple rows in the small ball device may also be distributed in a trapezoidal shape.
[0037] By placing the small ball device within the radiation range of the C-arm and controlling the C-arm to radiate the small ball device, a two-dimensional X-ray image including the small ball image can be obtained. The computer device can perform error analysis on the two-dimensional X-ray image and output the two-dimensional error and three-dimensional error of the image.
[0038] In a possible implementation of the embodiment of the present application, in order to obtain multiple C-arm images, when controlling the C-arm to radiate the small ball device, the C-arm can be controlled to radiate the small ball device at multiple angles, so that C-arm images at multiple angles can be obtained respectively. The computer device can perform error analysis on the C-arm image at any angle to obtain errors at different angles.
[0039] Usually, in actual clinical applications, the C-arm is used to irradiate the patient by collecting the patient's anteroposterior or lateral film. The anteroposterior film is oriented from the patient's back to the front, and the lateral film is oriented from the patient's left side to the right side. Therefore, when the C-arm is controlled to irradiate the small ball device at multiple angles, the angles corresponding to the anteroposterior and lateral films can be fine-tuned to obtain C-arm images at multiple angles.
[0040] The computer device can use the same method to analyze the error of C-arm images at different angles. Since each row of balls in the ball device is distributed in a trapezoidal shape, images obtained at different angles of the C-arm can avoid the occurrence of overlapping of ball images in the C-arm images due to different radiation angles.
[0041] S102, performing image calibration on the C-arm image to obtain a two-dimensional projection matrix, where the two-dimensional projection matrix is a calibration matrix in the image calibration process.
[0042] For C-arm images obtained by radiology, computer equipment can perform image enhancement processing on the C-arm images before processing, so as to improve the efficiency and accuracy of subsequent processing.
[0043] In a possible implementation of the embodiment of the present application, the image enhancement processing performed by the computer device on the C-arm may include at least one of image denoising, threshold segmentation, histogram transformation and / or image sharpening. Among them, image denoising can remove some noise in the C-arm image; image sharpening can compensate for the contour of the image, enhance the edge of the image and the grayscale jump part, so that the image becomes clear; by performing histogram transformation processing on the C-arm image, the grayscale histogram of the image can be changed and adjusted, and the distribution and structural relationship of the image value can be changed. The edge and contour of the ball in the C-arm image can be highlighted by using histogram transformation, and the probability of the circle in the image being detected is increased; threshold segmentation can be performed in combination with the ball diameter, and can be used to segment out the area containing the ball image in the image.
[0044] For the enhanced image, the computer device can perform image calibration on it, and the corresponding calibration matrix can be obtained through image calibration. The calibration matrix can be used as a two-dimensional projection matrix for subsequent error analysis.
[0045] In a possible implementation of the embodiment of the present application, as Figure 2 As shown, in S102, by calibrating the C-arm image, obtaining the two-dimensional projection matrix may specifically include the following steps S1021-S1023:
[0046] S1021. Identify a target circle in the C-arm image corresponding to a plurality of small balls in the small ball device.
[0047] To calibrate the C-arm image, it is necessary to determine which images in the C-arm image are obtained by irradiating each ball in the ball device.
[0048] In the embodiment of the present application, since each ball in the ball device is spherical, the image obtained by radiating each ball in the two-dimensional C-arm image should be circular or approximately circular. Therefore, the computer device can first perform circle detection on the C-arm image to obtain multiple candidate circles in the C-arm image. The circle detection of the C-arm image can be completed using the Hough algorithm. Then, according to the radius of each ball in the ball device and the distance between the centers of each ball, the computer device can screen multiple candidate circles, eliminate circular images with too large or too small diameters in the image, filter out most of the noise images, and obtain multiple target circles that can represent each ball in the ball device.
[0049] S1022: Determine the position information of each target circle.
[0050] The multiple target circles obtained in the previous step are disordered circular images. In order to determine the position information of each target circle, the multiple disordered target circles can be sorted to obtain ordered target circles. In this way, the sorted target circular images can correspond to each ball in the ball device one by one. The computer device can obtain the position information of each target circle by determining the two-dimensional center coordinates of the sorted multiple target circles.
[0051] S1023. Perform image calibration on the C-arm image based on the position information to obtain the two-dimensional projection matrix.
[0052] After each circular image in the C-arm image is matched one by one with each small ball in the small ball device, the computer device can calibrate the image based on the actual position information of each small ball and the position information of the corresponding circular image in the image to obtain the corresponding calibration matrix.
[0053] Specifically, the three-dimensional center coordinates of each ball can be used as the actual position information of each ball, and the two-dimensional center coordinates of each target circle in the C-arm image can be used as the position information of the corresponding circular image. Therefore, the computer device can obtain the three-dimensional center coordinates of each ball in the ball device, and then perform image calibration according to the two-dimensional center coordinates of multiple target circles in the C-arm image and the corresponding three-dimensional center coordinates of each ball to obtain a calibration matrix, which can be used as a two-dimensional projection matrix for subsequent error analysis.
[0054] S103: Decompose the two-dimensional projection matrix into a three-dimensional matrix.
[0055] In an embodiment of the present application, an orthogonal triangle QR decomposition method may be used to decompose a two-dimensional projection matrix to obtain a three-dimensional matrix.
[0056] The QR decomposition method is the most effective and widely used method in linear algebra to find all eigenvalues of a general matrix. It is often used to decompose the projection matrix in the process of camera calibration or image calibration to obtain the intrinsic and extrinsic parameters of the camera. The QR decomposition method can decompose a matrix into a normal orthogonal matrix Q and an upper triangular matrix R.
[0057] S104. Calculate the error of the C-arm image according to the two-dimensional projection matrix and the three-dimensional matrix.
[0058] In the embodiment of the present application, based on the two-dimensional projection matrix and the three-dimensional matrix calculated in the above steps, the computer device can analyze the error of the C-arm image and output the corresponding analysis result, which may include a two-dimensional error and a three-dimensional error. Among them, the two-dimensional error can be used to represent the error of the image obtained by radiation using the current C-arm in the plane, and the three-dimensional error can be used to represent the error of the C-arm in space.
[0059] In a possible implementation of the embodiment of the present application, as Figure 3 As shown, calculating the error of the C-arm image according to the two-dimensional projection matrix and the three-dimensional matrix in S104 may specifically include the following steps S1041-S1043. The following steps S1041-S1043 introduce the process of calculating the two-dimensional error of the C-arm image using the two-dimensional projection matrix.
[0060] S1041. Calculate theoretical values of the centers of target circles in the C-arm image corresponding to the plurality of small balls in the small ball device based on the two-dimensional projection matrix.
[0061] S1042: Determine the actual value of the center of each target circle in the C-arm image.
[0062] S1043. Calculate the two-dimensional error of the C-arm image according to the theoretical value of the circle center and the actual value of the circle center.
[0063] In the embodiment of the present application, the calculation of the two-dimensional error is similar to the reprojection error, and the error can be obtained by calculating the distance between the theoretical value and the actual value, and then accumulating and averaging. Therefore, in the specific implementation process, the computer device can calculate the theoretical value Points2D of the center of each target circle corresponding to the multiple balls in the ball device in the C-arm image based on the two-dimensional projection matrix. pred, That is, the theoretical center of each target circle. Then, calculate the actual value of the center of each target circle in the C-arm image Points2D image , that is, the actual coordinates of each target circle in the C-arm image. When calculating the theoretical center value of each target circle Points2D pred Points2D with the actual value of the center of the circleimage After calculating the difference between the two, the sum of the differences corresponding to all target circles can be accumulated and then averaged to obtain the two-dimensional error of the C-arm image.
[0064] Specifically, the two-dimensional error of the C-arm image can be calculated using the following formula:
[0065]
[0066] Among them, Error 2D is the two-dimensional error, N is the number of target circles, that is, the number of balls in the ball device.
[0067] In another possible implementation of the embodiment of the present application, as Figure 4 As shown, the calculation of the error of the C-arm image according to the two-dimensional projection matrix and the three-dimensional matrix in S104 may specifically include the following steps S1044-S1046: Figure 4 Steps S1044-S1046 describe the process of calculating the three-dimensional error of the C-arm image using a three-dimensional matrix.
[0068] S1044. Calculate the camera focus based on the three-dimensional matrix, wherein the camera focus, the center of each small ball in the small ball device, and the center of each target circle in the corresponding C-arm image are located on the same straight line.
[0069] S1045, respectively calculating the distance between the center of each small ball in the small ball device and the line connecting the center of the target circle in the corresponding C-arm image and the camera focus.
[0070] S1046. Calculate a three-dimensional error of the C-arm based on the distance.
[0071] Usually, in camera projection, the points on the image, the points on the actual object and the camera focus are on the same straight line. By obtaining the straight line between the points on the image and the camera focus, the distance between the points on the actual object and the straight line can be calculated. This distance can be used as the three-dimensional error value of the points on the actual object. For multiple points in the actual object, the error values corresponding to each point are added up and then averaged to obtain the corresponding three-dimensional error.
[0072] In the embodiment of the present application, the C-arm can be regarded as a camera, and the C-arm image obtained during the radiation process can be used as the image taken by the camera, so that the camera focus can be calculated based on the three-dimensional matrix. Therefore, the camera focus, the center of each ball in the ball device and the center of each target circle in the corresponding C-arm image are located on the same straight line.
[0073] Then, by calculating the distance d between the center of each ball in the ball device and the line connecting the center of the target circle in the corresponding C-arm image and the camera focus, Points3D , this distance can be regarded as the three-dimensional error value of each ball. In this way, the three-dimensional error of the C-arm can be calculated based on this distance.
[0074] Specifically, the three-dimensional error of the C-arm can be calculated using the following formula:
[0075]
[0076] Among them, Error 3D is the three-dimensional error, and N is the number of balls in the ball device.
[0077] It should be noted that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0078] For ease of understanding, the following is an introduction to the calculation method of the C-arm image error provided by the embodiment of the present application in conjunction with a complete example. Figure 5 , which is a schematic diagram of a calculation process of a C-arm image error provided in an embodiment of the present application. Figure 5 The calculation flow shown may include:
[0079] (1) C-arm image acquisition
[0080] The C-arm image can be obtained by controlling the C-arm to radiate the small ball device in the aforementioned method embodiment. The C-arm image is a two-dimensional X-ray image.
[0081] (2) C-arm image enhancement processing
[0082] Right now Figure 5 The image denoising, threshold segmentation, histogram transformation and image sharpening methods shown in . For the enhancement of C-arm images, the following can be used: Figure 5 One or more of the processing methods shown in the figure. The image output after processing is the enhanced image.
[0083] (3) Image calibration
[0084] The computer equipment can perform image calibration on the enhanced image, that is, Figure 5 After 2D / 3D calibration, the computer device can obtain a calibration matrix, that is, Figure 5 The 2D matrix shown in , which is the projection matrix used for error analysis later.
[0085] (4)QR decomposition
[0086] Based on the 2D matrix obtained by image calibration, the corresponding 3D matrix can be obtained by performing QR decomposition on it. The 3D matrix can be used for error analysis to output the three-dimensional error of the C-arm.
[0087] (5) Error calculation
[0088] According to the calculated 2D matrix and 3D matrix, the computer device can perform error analysis and output the corresponding 2D error and 3D error.
[0089] By applying the error calculation method provided in the embodiment of the present application, a special small ball device can be used as the object to be irradiated, and the C-arm can be controlled to irradiate the small ball device to obtain the corresponding radiological image. Then, based on automated image processing methods such as image calibration, the C-arm image is processed and analyzed to obtain accurate error analysis results including two-dimensional error and three-dimensional error, providing doctors with more detailed intraoperative planning and analysis references. Secondly, by applying this method, a special small ball device with multiple small balls can be irradiated before or during surgery to perform error analysis, which can reduce the number of radiations to the patient and reduce the radiation damage to the patient during the radiation process. Third, combined with a specially made small ball device, this method can obtain radiological images at multiple angles, and the radiological images at each angle can be used for image processing and analysis. Through multiple error analyses, more accurate error values in planes and spaces can be obtained, further improving the accuracy of the error analysis results.
[0090] Reference Figure 6 , shows a schematic diagram of a C-arm image error calculation device provided in an embodiment of the present application, which may specifically include a radiation module 601, a calibration module 602, a decomposition module 603 and a calculation module 604, wherein:
[0091] The radiation module 601 is used to control the C-arm to radiate the small ball device to obtain a C-arm image, wherein the small ball device is provided with multiple rows of small balls, each row includes a plurality of small balls of equal number, and the multiple rows of small balls are distributed in a trapezoidal shape;
[0092] A calibration module 602 is used to obtain a two-dimensional projection matrix by performing image calibration on the C-arm image, where the two-dimensional projection matrix is a calibration matrix in the image calibration process;
[0093] A decomposition module 603, used to decompose the two-dimensional projection matrix into a three-dimensional matrix;
[0094] The calculation module 604 is used to calculate the error of the C-arm image according to the two-dimensional projection matrix and the three-dimensional matrix.
[0095] In a possible implementation of an embodiment of the present application, the calibration module 602 can be specifically used to: identify target circles in the C-arm image corresponding to the multiple balls in the ball device; determine the position information of each of the target circles; and perform image calibrating on the C-arm image based on the position information to obtain the two-dimensional projection matrix.
[0096] In an embodiment of the present application, the calibration module 602 can also be used to: perform circle detection on the C-arm image to obtain multiple candidate circles in the C-arm image; screen the multiple candidate circles according to the radius of each small ball in the small ball device and the distance between the centers of each small ball to obtain multiple target circles.
[0097] In the embodiment of the present application, the calibration module 602 may also be used to: sort the plurality of target circles; and determine the two-dimensional center coordinates of the sorted plurality of target circles.
[0098] In an embodiment of the present application, the calibration module 602 can also be used to: obtain the three-dimensional center coordinates of each small ball in the small ball device; perform image calibration according to the two-dimensional center coordinates of multiple target circles in the C-arm image and the corresponding three-dimensional center coordinates of each small ball to obtain the two-dimensional projection matrix.
[0099] In an embodiment of the present application, the calibration module 602 can also be used to: perform image enhancement processing on the C-arm image, and the image enhancement processing includes at least one processing method of image denoising, threshold segmentation, histogram transformation and / or image sharpening.
[0100] In a possible implementation manner of the embodiment of the present application, the decomposition module 603 may be specifically configured to: decompose the two-dimensional projection matrix using an orthogonal triangle QR decomposition method to obtain a three-dimensional matrix.
[0101] In a possible implementation of an embodiment of the present application, the calculation module 604 can be specifically used to: calculate the theoretical value of the center of each target circle in the C-arm image corresponding to the multiple small balls in the small ball device based on the two-dimensional projection matrix; determine the actual value of the center of each target circle in the C-arm image; calculate the two-dimensional error of the C-arm image according to the theoretical value of the center and the actual value of the center; calculate the camera focus based on the three-dimensional matrix, and the camera focus, the center of each small ball in the small ball device and the center of each target circle in the corresponding C-arm image are located on the same straight line; calculate the distance between the center of each small ball in the small ball device and the line connecting the center of the target circle in the corresponding C-arm image and the camera focus; and calculate the three-dimensional error of the C-arm according to the distance.
[0102] In a possible implementation of an embodiment of the present application, the radiation module 601 can be specifically used to: control the C-arm to radiate the small ball device at multiple angles to obtain the C-arm images at multiple angles; the C-arm image at any angle is used to calculate the error at that angle.
[0103] An embodiment of the present application provides a device for calculating a C-arm image error. By using the device, each step in the aforementioned method embodiments can be implemented.
[0104] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment part.
[0105] Reference Figure 7 , shows a schematic diagram of a computer device provided by an embodiment of the present application. Figure 7 As shown, the computer device 700 in the embodiment of the present application includes: a processor 710, a memory 720, and a computer program 721 stored in the memory 720 and executable on the processor 710. When the processor 710 executes the computer program 721, the steps in each embodiment of the above-mentioned C-arm image error calculation method are implemented, for example Figure 1 Alternatively, when the processor 710 executes the computer program 721, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 6 Functions of modules 601 to 604 are shown.
[0106] Exemplarily, the computer program 721 may be divided into one or more modules / units, which are stored in the memory 720 and executed by the processor 710 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which may be used to describe the execution process of the computer program 721 in the computer device 700. For example, the computer program 721 may be divided into a radiation module, a calibration module, a decomposition module, and a calculation module, and the specific functions of each module are as follows:
[0107] A radiation module, used for controlling the C-arm to radiate the small ball device to obtain a C-arm image, wherein the small ball device is provided with a plurality of rows of small balls, each row includes a plurality of small balls of equal number, and the plurality of rows of small balls are distributed in a trapezoidal shape;
[0108] A calibration module, used for obtaining a two-dimensional projection matrix by performing image calibration on the C-arm image, wherein the two-dimensional projection matrix is a calibration matrix in the image calibration process;
[0109] A decomposition module, used for decomposing the two-dimensional projection matrix into a three-dimensional matrix;
[0110] A calculation module is used to calculate the error of the C-arm image according to the two-dimensional projection matrix and the three-dimensional matrix.
[0111] The computer device 700 may be a device for implementing the steps in the above-mentioned method embodiments, and the computer device 700 may be a computing device such as a desktop computer, a cloud server, etc. The computer device 700 may include, but is not limited to, a processor 710 and a memory 720. Those skilled in the art will understand that Figure 7 This is only an example of the computer device 700 and does not constitute a limitation of the computer device 700. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device 700 may also include input and output devices, network access devices, buses, etc.
[0112] The processor 710 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0113] The memory 720 may be an internal storage unit of the computer device 700, such as a hard disk or memory of the computer device 700. The memory 720 may also be an external storage device of the computer device 700, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 700. Further, the memory 720 may also include both an internal storage unit of the computer device 700 and an external storage device. The memory 720 is used to store the computer program 721 and other programs and data required by the computer device 700. The memory 720 may also be used to temporarily store data that has been output or is to be output.
[0114] An embodiment of the present application also discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for calculating the C-arm image error as described in the aforementioned embodiments is implemented.
[0115] An embodiment of the present application further discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for calculating the C-arm image error as described in the aforementioned embodiments is implemented.
[0116] An embodiment of the present application further discloses a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the method for calculating the C-arm image error described in the aforementioned embodiments.
[0117] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application is described in detail with reference to the above-mentioned embodiments, a person skilled in the art should understand that the technical solutions described in the above-mentioned embodiments can still be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A method for calculating a C-arm image error, characterized in that: include: Controlling the C-arm to radiate the small ball device to obtain a C-arm image, wherein the small ball device is provided with multiple rows of small balls, each row includes multiple small balls of the same size and the same number, the multiple rows of small balls are distributed in a trapezoidal shape, and the distances between the small balls in the same row are equal; By performing image calibration on the C-arm image, a two-dimensional projection matrix is obtained, where the two-dimensional projection matrix is a calibration matrix in the image calibration process; Decomposing the two-dimensional projection matrix into a three-dimensional matrix; Calculate the theoretical value of the center of each target circle corresponding to the plurality of small balls in the small ball device in the C-arm image based on the two-dimensional projection matrix; Determine the actual value of the center of each target circle in the C-arm image; calculate the two-dimensional error of the C-arm image according to the theoretical value of the center and the actual value of the center; The camera focus is calculated based on the three-dimensional matrix, and the camera focus, the center of each small ball in the small ball device and the center of each target circle in the corresponding C-arm image are located on the same straight line; the distance between the center of each small ball in the small ball device and the line connecting the center of the target circle in the corresponding C-arm image and the camera focus is calculated respectively; and the three-dimensional error of the C-arm is calculated according to the distance.
2. The method according to claim 1, characterized in that: The method of obtaining a two-dimensional projection matrix by performing image calibration on the C-arm image includes: identifying a target circle in the C-arm image corresponding to a plurality of balls in the ball device; Determine the position information of each target circle; The C-arm image is calibrated based on the position information to obtain the two-dimensional projection matrix.
3. The method according to claim 2, characterized in that The identifying a target circle in the C-arm image corresponding to a plurality of small balls in the small ball device comprises: Performing circle detection on the C-arm image to obtain a plurality of candidate circles in the C-arm image; According to the radius of each small ball in the small ball device and the distance between the centers of each small ball, a plurality of candidate circles are screened to obtain a plurality of target circles.
4. The method according to claim 2 or 3, characterized in that: The step of determining the position information of each target circle includes: sorting the plurality of target circles; Determine the two-dimensional center coordinates of the sorted plurality of target circles.
5. The method according to claim 4, characterized in that The performing image calibration on the C-arm image based on the position information to obtain the two-dimensional projection matrix includes: Obtaining the three-dimensional coordinates of the center of each ball in the ball device; Image calibration is performed according to the two-dimensional center coordinates of the plurality of target circles in the C-arm image and the three-dimensional center coordinates of the corresponding small balls to obtain the two-dimensional projection matrix.
6. The method according to claim 2, characterized in that Before identifying the target circle corresponding to the plurality of balls in the ball device in the C-arm image, the method further includes: The C-arm image is subjected to image enhancement processing, wherein the image enhancement processing includes at least one processing method of image denoising, threshold segmentation, histogram transformation and / or image sharpening.
7. The method according to any one of claims 1-3 or 5-6, characterized in that: Decomposing the two-dimensional projection matrix into a three-dimensional matrix includes: The two-dimensional projection matrix is decomposed by using an orthogonal triangle QR decomposition method to obtain a three-dimensional matrix.
8. The method according to any one of claims 1-3 or 5-6, characterized in that: The controlling the C-arm to radiate the small ball device to obtain a C-arm image includes: The C-arm is controlled to radiate the small ball device at multiple angles to obtain the C-arm images at multiple angles respectively; the C-arm image at any angle is used to calculate the error at the angle respectively.
9. A device for calculating a C-arm image error, characterized in that: include: A radiation module, used for controlling the C-arm to radiate the small ball device to obtain a C-arm image, wherein the small ball device is provided with multiple rows of small balls, each row includes multiple small balls of the same size and the same number, the multiple rows of small balls are distributed in a trapezoidal shape, and the distances between the small balls in the same row are equal; A calibration module, used for obtaining a two-dimensional projection matrix by performing image calibration on the C-arm image, wherein the two-dimensional projection matrix is a calibration matrix in the image calibration process; A decomposition module, used for decomposing the two-dimensional projection matrix into a three-dimensional matrix; A calculation module, used for calculating the theoretical value of the center of each target circle corresponding to the plurality of small balls in the small ball device in the C-arm image based on the two-dimensional projection matrix; Determine the actual value of the center of each target circle in the C-arm image; calculate the two-dimensional error of the C-arm image according to the theoretical value of the center and the actual value of the center; calculate the camera focus based on the three-dimensional matrix, the camera focus, the center of each small ball in the small ball device and the center of each target circle in the corresponding C-arm image are located on the same straight line; calculate the distance between the center of each small ball in the small ball device and the line connecting the center of the target circle in the corresponding C-arm image and the camera focus; calculate the three-dimensional error of the C-arm according to the distance.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for calculating the C-arm image error according to any one of claims 1 to 8 is implemented.
11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for calculating the C-arm image error according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
C-shaped arm imaging parameter calibration system and method
CN114404041A
Structured light 3D camera calibration method and device
CN114913241A
Automatic registration method and device, electronic equipment and medium
CN116269828A
