X-ray SID automatic calibration method based on plane detection and depth camera
By combining RGB cameras and depth camera technology, the SID value of X-ray equipment is measured in real time, and the problem of inaccurate SID determination is solved, precise control of radiation dose is achieved, and the quality of X-rays and radiation safety of patients is improved.
Patent Information
- Application Number
- CN202411626856.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-07
AI Technical Summary
When existing X-ray devices take X-rays, the determination of SID is not accurate enough, resulting in errors in estimation of radiation doses, affecting X-ray quality and patient radiation safety.
Using a method based on plane detection and depth camera, the SID value is measured in real time through a combination of RGB cameras and depth cameras, and the thickness of the SOD and subjects are accurately calculated to determine a reasonable radiation dose.
It realizes real-time and accurate acquisition of SID values during X-ray shooting, ensures the scientific and reasonableness of the radiation dose, improves the quality of X-rays, and reduces radiation exposure to patients.
Smart Images

Figure CN119579701A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of precision control methods for X-ray devices, and in particular to a method for automatically obtaining a precise SID when an X-ray device is performing X-ray photography, and specifically to an automatic X-ray SID calibration method based on plane detection and a depth camera. Background Art
[0002] SID is the source-image distance in the X-ray equipment, that is, the distance between the X-ray source and the detector plate, and SOD is the source-object distance, that is, the distance from the X-ray source to the surface of the object. Mastering the relationship between SID and SOD is one of the main factors in obtaining high-quality X-rays and protecting the patient's body from additional radiation.
[0003] When taking X-rays, it is crucial to control the relationship between the source-image distance (SID) and the radiation dose, because changes in the SID directly affect the clarity and contrast of the image, and are also related to the radiation dose received by the patient. A larger SID can reduce the impact of scattered radiation, thereby improving image quality, but it may also require an increase in radiation dose to ensure adequate exposure. By properly adjusting the SID and radiation dose, the patient's radiation exposure can be minimized while ensuring image quality, achieving a balance between optimizing imaging effects and protecting patient health. Therefore, understanding and controlling the relationship between the two is of great significance for improving the safety and effectiveness of X-ray imaging. The difference between the SID and the SOD can be used to obtain the thickness of the object to be photographed, thereby setting a reasonable radiation dose. For X-ray equipment with adjustable SID, the radiation dose is generally estimated or adjusted by the operator based on experience or the distance value provided by the equipment, and the accuracy of the actual dose used is not high. In order to obtain the SID value of the current shooting condition in real time and accurately during X-ray shooting, and then accurately obtain the SOD and the thickness value of the part of the object to be shot, so as to finally determine the appropriate radiation dose for shooting, and achieve the effect of taking both the quality of the X-ray film and the exposure dose of the object into consideration, the present invention proposes a technical solution for realizing real-time calibration of SID based on photogrammetry technology, and realizes refined measurement of SID based on combining the image content captured by the RGB camera with the depth image data captured by the depth camera, so as to obtain real-time and accurate SID, thereby providing a real and scientific parameter basis for accurately determining the radiation dose. Summary of the invention
[0004] In order to solve the problem of SID determination when X-ray equipment is taking X-ray films, the present application provides an automatic X-ray SID calibration method based on plane detection and depth camera, which is used to measure the real-time SID value of the current X-ray equipment shooting environment, provide accurate parameter basis for setting a reasonable radiation dose, and further solve the problem of dose estimation error caused by inaccurate SID data, avoid the problem of poor X-ray film quality caused by insufficient exposure due to insufficient radiation dose, and avoid the problem of overexposure and harm to the patient's health due to excessive radiation dose.
[0005] In order to achieve the above purpose, the technical solution adopted in this application is:
[0006] The X-ray SID automatic calibration method based on plane detection and depth camera includes the following steps:
[0007] Step STP100, acquisition of the first target pixel: select a rectangular area with a length and width of 50 pixels in the RGB camera imaging image to obtain an RGB image Image RGB1 , a total of 2500 pixel coordinate points, denoted as Point 2d ; The center point of the rectangular area is the imaging point where the central ray of the ray source is located on the detector;
[0008] Step STP200, image pixel three-dimensional space: using the depth camera to collect and RGB image Image RGB The corresponding depth image Image depth , use the back-projection expression and the camera intrinsic parameter IntrinsicsK to calculate each pixel Point in step STP100 2d The corresponding actual space coordinate Point 3d , get a set of three-dimensional points; among them, the camera intrinsics Intrinsics, Among them, f x and f y They represent the focal lengths in the x-axis and y-axis directions, respectively, in pixels; cx and cy represent the offsets between the pixel coordinate system and the camera optical center in the x- and y-directions, respectively, in pixels;
[0009] The back projection expression is:
[0010] In the back projection expression: (X, Y, Z) represents the three-dimensional coordinates of the space point in the RGB camera coordinate system, (u, v) represents the pixel coordinates, and d represents the (u, v) coordinates in the depth image data Image depth The corresponding depth value, K -1 Represents the inverse matrix of the camera intrinsic parameter K;
[0011] Step STP300, planarization of the three-dimensional point set: the three-dimensional point set obtained in step STP200 is decomposed by SVD method to obtain the plane P1 where the three-dimensional point set is located, wherein the plane equation is as follows:
[0012] Ax+By+Cz+D=0
[0013] Among them, A, B, C, and D are all plane fitting parameters, and x, y, and z represent the spatial three-dimensional coordinates of any point in the three-dimensional point set in the RGB camera coordinate system;
[0014] Step STP400, extension of the three-dimensional point set: based on the rectangular area obtained in step STP100, expand outward by 10 pixels to obtain the newly expanded circular area RGB image Image RGB2 ;
[0015] Step STP500, the RGB image Image obtained in step STP400 is RGB2 According to steps STP200 to STP300, the steps of three-dimensional spatialization of image pixels and planarization of three-dimensional point sets are performed in sequence to obtain the plane P2 where the three-dimensional point set of the newly extended round-shaped area is located.
[0016] Step STP600, qualitative determination of coplanarity: determine the distance d between 95% of the points on plane P2 and plane P1 i Whether it is equal to 0 is used as the coplanarity condition. If it is satisfied, it is determined that plane P2 is coplanar with plane P1. If it is not satisfied, it is determined that plane P2 is not coplanar with plane P1. i Calculated by the following formula:
[0017]
[0018] Step STP700, automatic calibration of the current SID: repeat steps STP400 to STP600 until plane P is obtained. n And satisfy P n-1 , P n、 P n+1 The SID when all are coplanar is taken as the current SID, and the number of cycles satisfies the plane P n+1 The size of is no larger than the actual size of the detector plate, where n∈[2,3,4,…n].
[0019] Preferably, step STP600 also includes a step of correcting the coplanar condition, specifically including: i Is it equal to 0 as the coplanarity condition to replace the distance d i The relationship between the size of the preset value L is used as the condition for judging whether it is coplanar. If the distance di ≤ the preset value L, then the current 3D point is determined to be coplanar with plane P1. If the distance d i > preset value L, it is determined that the current 3D point is not coplanar with plane P1, which is specifically expressed as follows;
[0020]
[0021] in, Indicates the depth value of the RGB camera center point from the detector plate. - indicates the direction opposite to the Z axis in the camera coordinate system.
[0022] Preferably, step STP600 also includes determining whether there is an obstruction on the detector surface. The specific determination steps are as follows: Calculate the plane P n Is the proportion of points located in plane P1 greater than 95%? If the proportion is ≥ 95%, it is considered as unobstructed, and step STP700 is continued. If the calculated plane P n If the proportion of points located in plane P1 is less than 95%, it is considered to be blocked and the SID is not updated. The specific expression is as follows:
[0023]
[0024] Where n∈[2,3,4,…n].
[0025] Beneficial effects:
[0026] The present invention can measure the SID of the current shooting environment in real time, calculate the thickness of the shooting part through the real-time SOD collected by the depth camera, and thus accurately determine the radiation dose through the shooting distance and thickness, thereby achieving the technical effect of precise shooting. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative labor.
[0028] Figure 1 It is a schematic diagram of the principle of the first image acquisition of the present invention.
[0029] Figure 2 It is a schematic diagram of the principle of the first circular expansion area image acquisition of the present invention.
[0030] Figure 3 This is a SID calibration flow chart of an embodiment of the present invention. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0032] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0033] Embodiment 1:
[0034] This embodiment provides an X-ray SID automatic calibration method based on plane detection and depth camera. Figure 3 As shown, the following steps are included:
[0035] Step STP100, acquisition of the first target pixel: select a rectangular area with a length and width of 50 pixels in the RGB camera imaging image to obtain an RGB image Image RGB1 , a total of 2500 pixel coordinate points, denoted as Point 2d ; The center point of the rectangular area is the imaging point of the central ray of the ray source on the detector; see Figure 1 The schematic diagram shown is worth explaining. Figure 1 This is just a hint. The actual RGB image is RGB1 It is electronic data and is acquired by an RGB camera;
[0036] Step STP200, image pixel three-dimensional space: using the depth camera to collect and RGB image Image RGB The corresponding depth image Image depth , use the back-projection expression and the camera intrinsic parameter IntrinsicsK to calculate each pixel Point in step STP100 2d The corresponding actual space coordinate Point 3d , get a set of three-dimensional points; among them, the camera intrinsics Intrinsics, Among them, f x and f y They represent the focal lengths in the x-axis and y-axis directions, respectively, in pixels; cx and cy represent the offsets between the pixel coordinate system and the camera optical center in the x- and y-directions, respectively, in pixels;
[0037] The back projection expression is:
[0038] In the back projection expression: (X, Y, Z) represents the three-dimensional coordinates of the space point in the RGB camera coordinate system, (u, v) represents the pixel coordinates, and d represents the (u, v) coordinates in the depth image data Image depth The corresponding depth value, K -1 Represents the inverse matrix of the camera intrinsic parameter K; see Figure 2 shown.
[0039] Step STP300, planarization of the three-dimensional point set: the three-dimensional point set obtained in step STP200 is decomposed by SVD method to obtain the plane P1 where the three-dimensional point set is located, wherein the plane equation is as follows:
[0040] Ax+By+Cz+D=0
[0041] Among them, A, B, C, and D are all plane fitting parameters, and x, y, and z represent the spatial three-dimensional coordinates of any point in the three-dimensional point set in the RGB camera coordinate system;
[0042] Step STP400, extension of the three-dimensional point set: based on the rectangular area obtained in step STP100, expand outward by 10 pixels to obtain the newly expanded circular area RGB image Image RGB2 ;
[0043] Step STP500, the RGB image Image obtained in step STP400 is RGB2 According to steps STP200 to STP300, the steps of three-dimensional spatialization of image pixels and planarization of three-dimensional point sets are performed in sequence to obtain the plane P2 where the three-dimensional point set of the newly extended round-shaped area is located.
[0044] Step STP600, qualitative determination of coplanarity: determine the distance d between 95% of the points on plane P2 and plane P1 i Whether it is equal to 0 is used as the coplanarity condition. If it is satisfied, it is determined that plane P2 is coplanar with plane P1. If it is not satisfied, it is determined that plane P2 is not coplanar with plane P1. i Calculated by the following formula:
[0045]
[0046] Step STP700, automatic calibration of the current SID: repeat steps STP400 to STP600 until plane P is obtained. n And satisfy P n-1 , P n、 Pn+1 The SID when all are coplanar is taken as the current SID, and the number of cycles satisfies the plane P n+1 The size of is no larger than the actual size of the detector plate, where n∈[2,3,4,…n].
[0047] Under normal circumstances, the above process can be completed within milliseconds. Therefore, the method of the present invention can obtain the accurate SID value in the current shooting environment or shooting scene in real time. During shooting, for example, when the patient is in front of the detector, the SOD can be directly read by the depth camera, thereby obtaining the thickness of the part that needs to be shot for the current patient or the object being shot. According to the known SID value and the thickness of the patient's shooting part, an accurate and scientific radiation dose can be obtained by calculation or table lookup, thereby obtaining high-quality X-rays. At the same time, it can also prevent patients from being subjected to unnecessary radiation damage to the body due to excessive radiation doses, and can also avoid the problem of poor shooting quality due to insufficient doses, and the inability to identify the lesions of the affected area and the need to re-shoot.
[0048] Embodiment 2:
[0049] Based on Example 1, this embodiment further optimizes step STP600. Specifically, step STP600 also includes a step of correcting the error of the coplanar condition, specifically including correcting the distance d in the original step STP600. i Is it equal to 0 as the coplanarity condition to replace the distance d i The relationship between the size of the preset value L is used as the condition for judging whether it is coplanar. If the distance d i ≤ the preset value L, then the current 3D point is determined to be coplanar with plane P1. If the distance d i > preset value L, it is determined that the current 3D point is not coplanar with plane P1, which is specifically expressed as follows;
[0050]
[0051] in, Indicates the depth value of the RGB camera center point from the detector plate. - indicates the direction opposite to the Z axis in the camera coordinate system.
[0052] This embodiment uses a depth camera to measure the distance. The depth camera's measurement has errors. Therefore, if there is no allowable error setting, the number of operations may be greatly increased in the actual determination process, resulting in an increase in the amount of operations, which will reduce efficiency and success. The distance value is the depth value of the camera center point from the detector flat plate, and 0.03 is the parameter error, that is, when the distance from the detector is 1m, the allowable error of the point on the plane is 0.03m. The allowable error values at different distances are different. The greater the distance, the higher the possibility of error. Therefore, the allowable error range under different shooting environments will also change dynamically. Therefore, the actual distance and the allowable error under the current shooting environment are expressed by the preset value L. If the actual distance is within the allowable error range, that is, Then they are also considered coplanar, only the actual distance exceeds the allowable error range, that is, Only then will they be regarded as non-coplanar, which will greatly improve the efficiency of judgment, greatly reduce the number of calculations, and almost achieve 100% judgment, and complete the entire SID calibration process in milliseconds.
[0053] This embodiment also provides another optimization setting. Step STP600 also includes determining whether there is an obstruction on the detector surface. The specific determination steps are as follows: Calculate the plane P n Is the proportion of points located in plane P1 greater than 95%? If the proportion is ≥ 95%, it is considered as unobstructed, and step STP700 is continued. If the calculated plane P n If the proportion of points located in plane P1 is less than 95%, it is considered to be blocked and the SID is not updated. The specific expression is as follows:
[0054]
[0055] Where n∈[2,3,4,…n].
[0056] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. X-ray SID automatic calibration method based on plane detection and depth camera, characterized in that: The following steps are involved: Step STP100, acquisition of the first target pixel: select a rectangular area with a length and width of 50 pixels in the RGB camera imaging image to obtain an RGB image Image RGB1 , a total of 2500 pixel coordinate points, denoted as Point 2d ; The center point of the rectangular area is the imaging point where the central ray of the ray source is located on the detector; Step STP200, image pixel three-dimensional space: using the depth camera to collect and RGB image Image RGB The corresponding depth image Image depth , use the back-projection expression and the camera intrinsic parameter IntrinsicsK to calculate each pixel Point in step STP100 2d The corresponding actual space coordinate Point 3d , get a set of three-dimensional points; among them, the camera intrinsics Intrinsics, Among them, f x and f y They represent the focal lengths in the x-axis and y-axis directions, respectively, in pixels; cx and cy represent the offsets between the pixel coordinate system and the camera optical center in the x- and y-directions, respectively, in pixels; The back projection expression is: In the back projection expression: (X, Y, Z) represents the three-dimensional coordinates of the space point in the RGB camera coordinate system, (u, v) represents the pixel coordinates, and d represents the (u, v) coordinates in the depth image data Image depth The corresponding depth value, K -1 Represents the inverse matrix of the camera intrinsic parameter K; Step STP300, planarization of the three-dimensional point set: the three-dimensional point set obtained in step STP200 is decomposed by SVD method to obtain the plane P1 where the three-dimensional point set is located, wherein the plane equation is as follows: Ax+By+Cz+D=0 Among them, A, B, C, and D are all plane fitting parameters, and x, y, and z represent the spatial three-dimensional coordinates of any point in the three-dimensional point set in the RGB camera coordinate system; Step STP400, extension of the three-dimensional point set: based on the rectangular area obtained in step STP100, expand outward by 10 pixels to obtain the newly expanded circular area RGB image Image RGB2 ; Step STP500, the RGB image Image obtained in step STP400 is RGB2 According to steps STP200 to STP300, the steps of three-dimensional spatialization of image pixels and planarization of three-dimensional point sets are performed in sequence to obtain the plane P2 where the three-dimensional point set of the newly extended round-shaped area is located. Step STP600, qualitative determination of coplanarity: determine the distance d between 95% of the points on plane P2 and plane P1 i Whether it is equal to 0 is used as the coplanarity condition. If it is satisfied, it is determined that plane P2 is coplanar with plane P1. If it is not satisfied, it is determined that plane P2 is not coplanar with plane P1. i Calculated by the following formula: Step STP700, automatic calibration of the current SID: repeat steps STP400 to STP600 until plane P is obtained. n And satisfy P n-1 , P n、 P n+1 The SID when all are coplanar is taken as the current SID, and the number of cycles satisfies the plane P n+1 The size of is no larger than the actual size of the detector plate, where n∈[2,3,4,…n].
2. The X-ray SID automatic calibration method based on plane detection and depth camera according to claim 1 is characterized in that: Step STP600 also includes a step of correcting the coplanar condition, specifically including: i Is it equal to 0 as the coplanarity condition to replace the distance d i The relationship between the size of the preset value L is used as the condition for judging whether it is coplanar. If the distance d i ≤ the preset value L, then the current 3D point is determined to be coplanar with plane P1. If the distance d i > preset value L, it is determined that the current 3D point is not coplanar with plane P1, which is specifically expressed as follows; in, Indicates the depth value of the RGB camera center point from the detector plate. - indicates the direction opposite to the Z axis in the camera coordinate system.
3. The X-ray SID automatic calibration method based on plane detection and depth camera according to claim 1 or 2, characterized in that: Step STP600 also includes determining whether there is an obstruction on the detector surface. The specific determination steps are as follows: Calculate the plane P n Is the proportion of points located in plane P1 greater than 95%? If the proportion is ≥ 95%, it is considered as unobstructed, and step STP700 is continued. If the calculated plane P n If the proportion of points located in plane P1 is less than 95%, it is considered to be blocked and the SID is not updated. The specific expression is as follows: Where n∈[2,3,4,…n].
