Image calibration method, device and image calibration equipment
Through the small ball device and collinear constraints, the small ball images in the image are automatically identified and sorted, and the calibration matrix is calculated, which solves the accuracy and reliability problems of traditional image calibration methods and achieves precise positioning and rapid operation in spinal surgery. Calibration.
Patent Information
- Application Number
- CN202311326822.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-13
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2043-10-13
AI Technical Summary
The traditional image calibration method requires a lot of manual operations and is susceptible to human error. It is also affected by factors such as the complexity of the shape of the calibration object and the X-ray radiation range, resulting in large deviations in the calibration results, making it difficult to achieve precise positioning in robot-assisted spine surgery. .
Using a small ball device, including at least three small ball groups, each group contains collinear metal balls, the small ball image group that satisfies the collinear constraints is screened out from the radiation images, automatically sorted and calculated the calibration matrix, and achieved image calibration. .
This method can quickly and accurately calculate the calibration matrix, reduce human errors, and improve the accuracy and reliability of image calibration. It is suitable for scenarios such as spinal surgery. The calibration accuracy can reach 0.5mm and takes only 1 second.
Smart Images

Figure CN117530707B
Abstract
Description
Technical Field
[0001] The embodiments of the present application belong to the field of medical technology, and in particular, relate to an image calibration method, apparatus, and image calibration device. Background Art
[0002] Image calibration is one of the important technologies in the field of medical auxiliary diagnosis and medical imaging. Common image calibration includes X-ray image calibration, etc. In the medical field, X-ray image calibration is widely used in the diagnosis and treatment process. Through X-ray image calibration, points on three-dimensional objects can be accurately mapped to two-dimensional images.
[0003] Taking spinal surgery as an example, X-ray images are usually required to be measured and planned during the operation, and the accuracy of the distance on the image and the actual distance is crucial. In particular, in robot-assisted navigation spinal surgery, calibration through X-ray images can locate surgical instruments and surgical sites, which can help doctors intuitively locate surgical instruments and surgical sites, help achieve more precise surgical operations, reduce surgical time, and reduce surgical risks.
[0004] Traditional image calibration methods are generally implemented by placing multiple calibration objects of known shapes and measuring the positions of these objects on the X-ray image to calculate the calibration matrix. This calibration method requires a lot of manual operations, which is not only time-consuming, but also susceptible to human errors. In addition, the accuracy of this method will also change due to the complexity of the shape of the calibration object. Other calibration methods in the prior art will also cause large deviations in the calibration results due to reasons such as the radiation range of the X-ray and object occlusion. Summary of the invention
[0005] In view of this, embodiments of the present application provide an image calibration method, an apparatus, and an image calibration device to improve the accuracy of image calibration in the medical field.
[0006] A first aspect of an embodiment of the present application provides an image calibration method, comprising:
[0007] Controlling the radiation device to radiate a designated part to obtain a radiation image, wherein a small ball device is placed on the designated part, wherein the small ball device includes at least three small ball groups, and any small ball group includes a plurality of metal small balls that are collinear in space;
[0008] Screening out a plurality of small ball image groups satisfying a collinearity constraint condition from the radiological image;
[0009] When the number of the plurality of small ball image groups satisfying the collinearity constraint condition is greater than or equal to a preset number, sorting each of the small ball image groups respectively;
[0010] A calibration matrix is determined according to the small ball images included in each sorted small ball image group, and the calibration matrix is used to perform image calibration on the radiological image.
[0011] A second aspect of an embodiment of the present application provides an image calibration device, including:
[0012] A radiation module, used to control the radiation device to radiate a designated part to obtain a radiation image, wherein a small ball device is placed on the designated part, wherein the small ball device includes at least three small ball groups, and any small ball group includes a plurality of metal small balls that are collinear in space;
[0013] A screening module, used for screening out a plurality of small ball image groups satisfying a collinearity constraint condition from the radiological image;
[0014] A sorting module, used for sorting each of the plurality of small ball image groups respectively when the number of the plurality of small ball image groups satisfying the collinearity constraint condition is greater than or equal to a preset number;
[0015] The calibration module is used to determine a calibration matrix according to the small ball images contained in each sorted small ball image group, and the calibration matrix is used to perform image calibration on the radiological image.
[0016] A third aspect of an embodiment of the present application provides an image calibration device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the image calibration method as described in the first aspect above when executing the computer program.
[0017] 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 image calibration method as described in the first aspect above is implemented.
[0018] A fifth aspect of the embodiments of the present application provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the image calibration method described in the first aspect.
[0019] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0020] The image calibration method provided by the embodiment of the present application can be used to identify the ball image corresponding to the real metal ball in the radiographic image through the collinearity constraints and quantity constraints between the metal balls, so as to quickly and accurately calculate the calibration matrix for image calibration. The calibration is performed using this method, and no human intervention is required in the entire calibration process. The calculation from radiographic imaging to the calibration matrix can be completed automatically, which can minimize the impact of human operation errors on image calibration, and help improve the accuracy and reliability of calibration. In addition, the calibration process does not require a training model, nor does it require a large amount of computing resources. A complete calibration only takes about 1 second, and can be completed directly on an ordinary computer. Under the multiple experimental verifications of the applicant, the image calibration accuracy completed using this method can reach 0.5mm.
[0021] The image calibration method provided in the embodiment of the present application can be applied to various scenarios where image calibration is required. For example, in various procedures that require the use of a two-dimensional C-arm for surgery, such as spinal surgery, the method can be used to calibrate images. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] 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.
[0023] Figure 1 is a schematic diagram of an image calibration method provided in an embodiment of the present application;
[0024] Figure 2 is a schematic diagram of a small ball device provided in an embodiment of the present application;
[0025] Figure 3 is a schematic diagram of a possible implementation of S102 in an image calibration method provided in an embodiment of the present application;
[0026] Figure 4 is an overall flow chart of an image calibration method provided in an embodiment of the present application;
[0027] Figure 5 is a schematic diagram of an image calibration device provided in an embodiment of the present application;
[0028] Figure 6 It is a schematic diagram of an image calibration device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] 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.
[0030] The technical solution of the present application is described below through specific embodiments.
[0031] Reference Figure 1 , shows a schematic diagram of an image calibration method provided in an embodiment of the present application, which may specifically include the following steps:
[0032] S101, controlling the radiation equipment to irradiate the designated part to obtain a radiation image.
[0033] This method can be applied to an image calibration device, that is, the execution subject of the embodiment of the present application can be an image calibration device, and the image calibration device can be a computer device in the medical field that can calibrate a two-dimensional image. The image calibration device can quickly and accurately calibrate the image by executing each step of the method provided in the embodiment of the present application.
[0034] In one example, the two-dimensional image that needs to be calibrated may be an X-ray image. Therefore, the radiation equipment in the embodiment of the present application may be a device that can generate X-rays to radiate a designated part of a patient to obtain a corresponding radiation image. Specifically, the radiation equipment may be a two-dimensional X-ray machine, such as a two-dimensional C-arm X-ray machine or an O-arm X-ray machine. Taking a C-arm X-ray machine as an example, the device consists of a C-shaped frame, a tube that generates X-rays, an image intensifier and a charge coupled device (CCD) camera for collecting images, and a workstation for image processing, and can be used for angiography, photography, and other tasks in various surgeries.
[0035] In a possible implementation of the embodiment of the present application, the radiation device and the image calibration device may be integrated, that is, the radiation device and the image calibration device may exist as a part of an integrated medical device or system. Alternatively, the radiation device and the image calibration device may exist separately, and the two may interact with each other through communication.
[0036] In an embodiment of the present application, the designated part may be a patient's affected part or a surgical site. For example, during spinal surgery, the X-ray image needs to be calibrated, and the calibration can be implemented using the method provided in an embodiment of the present application. Therefore, the designated part may be a part of the spine that requires surgery. The image calibration device may control the radiation device to radiate the designated part to obtain a radiation image, which is also a two-dimensional X-ray image.
[0037] In the embodiment of the present application, before controlling the radiation device to irradiate the designated part, a small ball device can be placed at the designated part. Therefore, an image of the small ball device can be formed in the radiation image, and subsequent calibration of the image can be achieved based on the position of the small ball device and its position in the image.
[0038] In order to avoid interfering with the diagnosis, treatment or surgery of the designated part, the above-mentioned small ball device can be wrapped in a sterile cover and placed in the designated part.
[0039] In an embodiment of the present application, the ball device may be composed of a plurality of metal balls, a flat plate with a plurality of ball grooves, and a tracer. The tracer is fixed on the flat plate. The ball device may include at least three ball groups, each of which may include a plurality of metal balls that are collinear in space, and the diameter of each metal ball may be 2 millimeters (mm). Exemplarily, a ball device may have 3 ball groups, each of which may include 3 collinear metal balls. Except for the metal balls that are made of metal material, the other parts of the ball device are made of materials that can be seen through X-rays. Since the three metal balls in each group are collinear in space, even if the ball device is offset during the radiation process, each group of balls in the image can still meet the three-point collinearity.
[0040] In addition, in order to prevent the interference between the groups of small balls, the embodiment of the present application can use the non-interference property of regular polygons to use each side of the regular polygon as the placement area of each group of metal small balls. Figure 2 As shown, it is a schematic diagram of a small ball device of an embodiment of the present application, in which the flat plate 201 includes a regular polygon composed of a plurality of small ball grooves 202a, and the plurality of small ball grooves 202a located on each side of the regular polygon can be used to place a plurality of metal small balls 202 in a small ball group respectively. Figure 2 The regular polygon shown in FIG. 1 is an equilateral triangle formed by three ball groove groups. Each side of the equilateral triangle includes three ball grooves 202a, and each ball groove 202a can hold a metal ball 202. In this way, three ball grooves on one side of the equilateral triangle can hold three metal balls in a ball group.
[0041] Usually, when applying the above-mentioned ball device for X-ray image calibration, at least three ball groups are required, and generally no more than eight ball groups. If a ball group contains 3 metal balls, this method uses at least 9 metal balls, and generally a maximum of 24 metal balls can be used. Of course, the number of metal balls used is not the more the better, but needs to be determined according to actual conditions. Affected by the radiation range of the radiation equipment, if the radiation range is small, generally 3-5 ball groups can be used, otherwise it is easy to lose the image of the metal balls in the radiation image due to exceeding the range.
[0042] S102: Filter out a plurality of small ball image groups satisfying collinearity constraint conditions from the radiological images.
[0043] In the embodiment of the present application, since the small ball device is placed at a designated part, and the designated part is within the radiation range of the radiation device, the radiation image obtained by controlling the radiation device to radiate the designated part also includes multiple small ball images. The purpose of selecting multiple small ball image groups that meet the collinearity constraint condition from the radiation image is to identify the corresponding image of the metal small ball contained in each small ball group in the radiation image.
[0044] In a possible implementation of the embodiment of the present application, as Figure 3 As shown, the step of selecting a plurality of small ball image groups satisfying the collinearity constraint condition from the radiological image in S102 may specifically include the following steps S1021-S1023:
[0045] S1021. Filter out a plurality of candidate small ball images from the radiological image, any of which is approximately circular.
[0046] In the embodiment of the present application, the selection of candidate ball images can be implemented based on the shape characteristics of the metal ball. Therefore, images in the radiographic image that are approximately circular in shape can be used as candidate ball images. In a specific implementation, a circular detection algorithm can be used to detect various circular image areas contained in the radiographic image, and these circular image areas can be used as candidate ball images.
[0047] Usually, noise may also appear in the radiographic image, and the shape of the noise may also be circular. Therefore, the embodiment of the present application may also determine the radius of each metal ball, and filter each circular image region obtained by the above detection in combination with the ball radius. In this way, most of the noise images may be filtered out, so that the remaining circular or approximately circular images may be used as candidate ball images.
[0048] S1022. Determine a plurality of collinear ball groups satisfying collinearity constraints from the plurality of candidate ball images.
[0049] After screening out multiple candidate ball images, the image calibration device can continue to process these candidate ball images to find multiple collinear ball groups that meet the collinearity constraint conditions. For example, in the above example, each ball group contains three collinear metal balls in space, so each collinear ball group to be determined in this step should also contain three collinear candidate ball images.
[0050] In an embodiment of the present application, searching for collinear ball images can be achieved using the center of all candidate ball images. Specifically, the center of each candidate ball image can be traversed, and for any candidate ball image, an adjacent candidate ball image can be searched within a preset search range. When the number of adjacent candidate ball images searched is less than two, the adjacent candidate ball images searched and the current candidate ball image cannot form a collinear ball group containing at least 3 ball images, so the current candidate ball image can be placed in a backup ball group. When the number of adjacent candidate ball images searched is greater than or equal to two, the area of the triangle formed by the center of each two adjacent candidate ball images and the center of the current candidate ball image can be calculated. If the area of the triangle is less than a preset collinearity threshold, it means that the three candidate ball images corresponding to the threshold are collinear, so the two adjacent candidate ball images and the current candidate ball image can be classified into a collinear ball group.
[0051] In a possible implementation of the embodiment of the present application, before traversing the center of each candidate ball image, a tree data structure can be constructed based on the centers of all candidate ball images. For example, a kd-tree can be constructed based on the centers of all candidate ball images. In subsequent steps, adjacent candidate ball images can be searched based on the kd-tree to speed up the search.
[0052] S1023. Determine a plurality of small ball image groups from the plurality of collinear small ball groups, wherein any of the small ball image groups is used to represent a small ball group in the small ball device.
[0053] The images of each ball in the determined collinear ball group still cannot accurately represent that they are formed by metal balls during the radiation process. Therefore, it is necessary to determine multiple ball image groups from multiple collinear ball groups. These ball image groups are used to characterize each ball group in the ball device.
[0054] In the embodiment of the present application, the distance information between the metal balls contained in each ball group in the ball device can be obtained, and based on the distance information, multiple ball image groups can be identified from multiple collinear ball groups. The distance information between the metal balls can be determined when designing the ball device.
[0055] like Figure 2 As shown, the distances between the three metal balls included in each regular polygon of the ball device can be different. Based on such distance constraints, the image calibration device can determine multiple ball image groups from multiple collinear ball groups. In this way, the ball images included in each ball image group can be regarded as images formed by multiple metal balls in a ball group during the radiation process.
[0056] S103: When the number of the plurality of small ball image groups that satisfy the collinearity constraint condition is greater than or equal to a preset number, sort each of the small ball image groups respectively.
[0057] In the embodiment of the present application, when the number of small ball image groups satisfying the collinearity constraint condition reaches a certain number, for example, when the number of small ball image groups satisfying the collinearity constraint condition reaches 3, it can be considered that the images formed by each small ball group of the small ball device in the radiological image have been correspondingly identified. At this time, each small ball image group can be further sorted.
[0058] The ball image groups can still be sorted based on the distance constraint between the metal balls, that is, based on the distance information between the metal balls contained in each ball group in the ball device, the ball images contained in each ball image group are sorted. In this way, the sorted ball images can correspond to the metal balls at the specified position.
[0059] S104. Determine a calibration matrix according to the small ball images included in each sorted small ball image group, wherein the calibration matrix is used to perform image calibration on the radiological image.
[0060] In the embodiment of the present application, the calibration matrix used for image calibration can be determined by calculation based on the three-dimensional point set of the metal sphere and the two-dimensional point set of the sphere image in the corresponding radiological image.
[0061] Specifically, the two-dimensional point set of the ball images contained in each sorted ball image group and the three-dimensional point set of the plurality of metal balls contained in each ball group in the ball device can be obtained, that is, the two-dimensional point set of each ball image in the radiographic image and the three-dimensional point set of each metal ball at the designated position. Then, the least square method can be used to calculate the two-dimensional point set and the three-dimensional point set to obtain the calibration matrix.
[0062] As an example of an embodiment of the present application, the calibration matrix P may be determined using the following formula:
[0063]
[0064] in:
[0065]
[0066] In the above formula (X1, Y1, Z1)...(X m ,Y m ,Z m ) represent the three-dimensional point sets of each metal ball at the specified position, (u1,v1)……(u m ,v m ) represent the two-dimensional point set of each ball image in the radiological image. c is the scaling factor and can be ignored in actual calculations.
[0067] After calculating the above calibration matrix, the calibration matrix can be used to calibrate the image.
[0068] In a possible implementation of an embodiment of the present application, if the number of multiple ball image groups that satisfy the collinearity constraint is less than a preset number, for example, less than 3 in the aforementioned example, the image calibration device can obtain three ball images from the backup ball group to form a temporary ball image group, and then use the multiple ball image groups that satisfy the collinearity constraint and the temporary ball group to calculate the calibration matrix and the loss value of the calibration matrix.
[0069] If the loss value is less than a preset threshold, the current calibration matrix can be used as a matrix for image calibration of radiological images; otherwise, ball images can be repeatedly selected from the backup ball group to update the temporary ball image group, and the calibration matrix can be recalculated until the loss value of the calibration matrix is less than the preset threshold.
[0070] 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.
[0071] For ease of understanding, the image calibration method provided in the embodiment of the present application is described below with reference to a complete example. Figure 4 As shown, it is an overall flow chart of an image calibration method provided by an embodiment of the present application. Figure 4 As shown in the process, a complete image calibration mainly includes the following steps:
[0072] (1) Collect X-ray images.
[0073] Before collecting X-ray images, you can Figure 2 The small ball device shown is placed at a designated position, such as a surgical position of a spinal operation, and then a radiation device is controlled to irradiate the designated position to obtain an X-ray image.
[0074] (2) Automatically detect circles.
[0075] In this example, a circle detection algorithm, such as a Hough algorithm, may be used to detect a circular image in an X-ray image.
[0076] (3) Obtain the disordered ball image through radius constraints and collinearity constraints.
[0077] For the circular image detected in step (2), multiple disordered ball images can be obtained by means of radius constraints and collinearity constraints.
[0078] Through the radius constraint, the circular images in the X-ray image whose image radius does not conform to the radius of the metal ball can be deleted. In this way, most of the circular noise images will be discarded and deleted, and multiple circular images will be obtained. Then, through the collinearity constraint, multiple collinear ball groups can be obtained. For the collinear ball group, the disordered ball image can be obtained by judging whether it meets the collinear group ratio, that is, finding the collinear group that meets the conditions from multiple collinear ball groups. Specifically, the ratio between the known balls in the ball device can be used to constrain the length ratio between the ball groups to obtain a collinear group that meets the conditions. Each collinear group can be regarded as a disordered ball that meets the conditions. The above-mentioned compliance can refer to distinguishing collinear ball groups based on the principle that the ratios between the balls in different collinear groups are different. For balls that do not meet the collinear group ratio constraint, they can be placed in the backup ball group.
[0079] (4) Through distance constraints, an ordered ball image is obtained.
[0080] Through the processing of step (3), a collinear ball group that meets the conditions is obtained. The multiple ball images in these collinear ball groups that meet the conditions are disordered ball images. For each collinear ball group that meets the conditions, the disordered ball images can be sorted into ordered ball images by the distance constraint within the group. In this way, each ball image corresponds to each metal ball at the specified position.
[0081] (5) Calculate the calibration matrix.
[0082] When calculating the calibration matrix, it is first necessary to determine whether the number of ordered ball images obtained meets the quantity constraint condition. For example, in combination with a ball device containing 3 ball groups with a total of 9 metal balls, determine whether the number of ordered ball groups finally obtained is greater than or equal to 3 groups, that is, 9 ordered ball images. If the above conditions are met, the image calibration device can calculate the calibration matrix based on the ordered ball images. Otherwise, the image calibration device can enable the backup balls to calculate the calibration matrix.
[0083] The image calibration method provided by the embodiment of the present application can be used to identify the ball image corresponding to the real metal ball in the radiographic image through the collinearity constraints and quantity constraints between the metal balls, so as to quickly and accurately calculate the calibration matrix for image calibration. The calibration is performed using this method, and no human intervention is required in the entire calibration process. The calculation from radiographic imaging to the calibration matrix can be completed automatically, which can minimize the impact of human operation errors on image calibration, and help improve the accuracy and reliability of calibration. In addition, the calibration process does not require a training model, nor does it require a large amount of computing resources. A complete calibration only takes about 1 second, and can be completed directly on an ordinary computer. Under the multiple experimental verifications of the applicant, the image calibration accuracy completed using this method can reach 0.5mm.
[0084] Reference Figure 5 , shows a schematic diagram of an image calibration device provided in an embodiment of the present application, which may specifically include a radiation module 501, a screening module 502, a sorting module 503 and a calibration module 504, wherein:
[0085] The radiation module 501 is used to control the radiation device to radiate the designated part to obtain a radiation image, wherein the designated part is placed with a small ball device, wherein the small ball device includes at least three small ball groups, and any small ball group includes a plurality of metal small balls that are collinear in space;
[0086] A screening module 502 is used to screen out a plurality of small ball image groups satisfying a collinearity constraint condition from the radiological image;
[0087] A sorting module 503, configured to sort each of the ball image groups respectively when the number of the plurality of ball image groups satisfying the collinearity constraint condition is greater than or equal to a preset number;
[0088] The calibration module 504 is used to determine a calibration matrix according to the small ball images included in each sorted small ball image group, and the calibration matrix is used to perform image calibration on the radiological image.
[0089] In a possible implementation of an embodiment of the present application, the ball device is composed of a plurality of metal balls, a flat plate with a plurality of ball grooves, and a tracer, the tracer is fixed on the flat plate, the plurality of ball grooves on the flat plate form a regular polygon, and the plurality of ball grooves on each side of the regular polygon are respectively used to place a plurality of metal balls in the same ball group.
[0090] In a possible implementation of the embodiment of the present application, the number of ball groups included in the ball device is no less than three and no more than eight, and any ball group contains three metal balls.
[0091] In a possible implementation of the embodiment of the present application, the screening module 502 can be specifically used to: screen out multiple candidate ball images from the radiological image, any of the candidate ball images is approximately circular; determine multiple collinear ball groups that satisfy collinearity constraints from the multiple candidate ball images; determine multiple ball image groups from the multiple collinear ball groups, any of the ball image groups is used to characterize a ball group in the ball device.
[0092] In an embodiment of the present application, the screening module 502 can also be used to: use a circle detection algorithm to detect each circular image area contained in the radiological image; determine the radius of the metal sphere; and filter each circular image area according to the radius to obtain multiple candidate sphere images.
[0093] In an embodiment of the present application, the screening module 502 can also be used to: traverse the centers of each of the candidate ball images; for any candidate ball image, search for adjacent candidate ball images within a preset search range; when the number of adjacent candidate ball images searched is less than two, place the current candidate ball image in a backup ball group; when the number of adjacent candidate ball images searched is greater than or equal to two, calculate the area of a triangle formed by the centers of every two adjacent candidate ball images and the center of the current candidate ball image, and if the area of the triangle is less than a preset collinearity threshold, the two adjacent candidate ball images and the current candidate ball image are classified into a collinear ball group.
[0094] In an embodiment of the present application, the screening module 502 can also be used to: obtain distance information between each metal ball contained in each ball group in the ball device, wherein the distance information is determined when designing the ball device; and based on the distance information, identify multiple ball image groups from multiple collinear ball groups.
[0095] In a possible implementation manner of the embodiment of the present application, the sorting module 503 may be specifically configured to sort the small ball images contained in each of the small ball image groups based on the distance information.
[0096] In a possible implementation of an embodiment of the present application, the calibration module 504 can be specifically used to: obtain a two-dimensional point set of the ball images contained in each sorted ball image group, and a three-dimensional point set of multiple metal balls contained in each ball group in the ball device; use the least squares method to calculate the two-dimensional point set and the three-dimensional point set to obtain a calibration matrix.
[0097] In a possible implementation of the embodiment of the present application, the calibration module 504 can also be used for: if the number of multiple ball image groups that satisfy the collinearity constraint is less than a preset number, obtaining three ball images from the backup ball group to form a temporary ball image group; using the multiple ball image groups that satisfy the collinearity constraint and the temporary ball group to calculate the calibration matrix; calculating the loss value of the calibration matrix; if the loss value is less than a preset threshold, using the current calibration matrix as the matrix for image calibration of the radiological image; otherwise, updating the temporary ball image group and recalculating the calibration matrix.
[0098] An embodiment of the present application provides an image calibration device, and by using the device, each step in the aforementioned method embodiments can be implemented.
[0099] 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.
[0100] Reference Figure 6 , shows a schematic diagram of an image calibration device provided in an embodiment of the present application. Figure 6 As shown, the image calibration device 600 in the embodiment of the present application includes: a processor 610, a memory 620, and a computer program 621 stored in the memory 620 and executable on the processor 610. When the processor 610 executes the computer program 621, the steps in each embodiment of the above-mentioned image calibration method are implemented, for example Figure 1 Alternatively, when the processor 610 executes the computer program 621, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 3 Functions of modules 301 to 305 are shown.
[0101] Exemplarily, the computer program 621 may be divided into one or more modules / units, which are stored in the memory 620 and executed by the processor 610 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 621 in the image calibration device 600. For example, the computer program 621 may be divided into a radiation module, a screening module, a sorting module, and a calibration module, and the specific functions of each module are as follows:
[0102] A radiation module, used to control the radiation device to radiate a designated part to obtain a radiation image, wherein a small ball device is placed on the designated part, wherein the small ball device includes at least three small ball groups, and any small ball group includes a plurality of metal small balls that are collinear in space;
[0103] A screening module, used for screening out a plurality of small ball image groups satisfying a collinearity constraint condition from the radiological image;
[0104] A sorting module, used for sorting each of the plurality of small ball image groups respectively when the number of the plurality of small ball image groups satisfying the collinearity constraint condition is greater than or equal to a preset number;
[0105] The calibration module is used to determine a calibration matrix according to the small ball images contained in each sorted small ball image group, and the calibration matrix is used to perform image calibration on the radiological image.
[0106] The image calibration device 600 may be a device for implementing the above-mentioned various method embodiments, and the image calibration device 600 may be a computing device such as a desktop computer, a cloud server, etc. The image calibration device 600 may include, but is not limited to, a processor 610 and a memory 620. Those skilled in the art will understand that Figure 6 It is only an example of the image calibration device 600 and does not constitute a limitation of the image calibration device 600. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the image calibration device 600 may also include input and output devices, network access devices, buses, etc.
[0107] The processor 610 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.
[0108] The memory 620 may be an internal storage unit of the image calibration device 600, such as a hard disk or memory of the image calibration device 600. The memory 620 may also be an external storage device of the image calibration device 600, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the image calibration device 600. Further, the memory 620 may also include both an internal storage unit of the image calibration device 600 and an external storage device. The memory 620 is used to store the computer program 621 and other programs and data required by the image calibration device 600. The memory 620 may also be used to temporarily store data that has been output or is to be output.
[0109] An embodiment of the present application further discloses an image calibration device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the image calibration method described in the above embodiments is implemented.
[0110] The embodiments of the present application further disclose 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 image calibration method as described in the above embodiments is implemented.
[0111] The embodiments of the present application further disclose a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the image calibration method described in the above embodiments.
[0112] 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. An image calibration method, characterized in that: include: Controlling the radiation device to radiate a designated part to obtain a radiation image, wherein a small ball device is placed on the designated part, wherein the small ball device includes at least three small ball groups, and any small ball group includes a plurality of metal small balls that are collinear in space; Screening out a plurality of candidate small ball images from the radiological image, any of the candidate small ball images being approximately circular; Determine a plurality of collinear ball groups satisfying collinearity constraint conditions from the plurality of candidate ball images; Determine a plurality of ball image groups from the plurality of collinear ball groups, any of the ball image groups being used to represent a ball group in the ball device; When the number of the plurality of small ball image groups satisfying the collinearity constraint condition is greater than or equal to a preset number, sorting each of the small ball image groups respectively; Determine a calibration matrix according to the small ball images included in each sorted small ball image group, wherein the calibration matrix is used to perform image calibration on the radiological image; The step of determining a plurality of collinear ball groups satisfying collinearity constraints from a plurality of candidate ball images comprises: Traversing the centers of the candidate ball images; For any candidate ball image, search for adjacent candidate ball images within a preset search range; When the number of adjacent candidate ball images searched is less than two, the current candidate ball image is placed in the reserve ball group; When the number of adjacent candidate ball images searched is greater than or equal to two, the area of the triangle formed by the center of each two adjacent candidate ball images and the center of the current candidate ball image is calculated. If the area of the triangle is less than a preset collinearity threshold, the two adjacent candidate ball images and the current candidate ball image are classified into a collinear ball group; The step of determining a plurality of ball image groups from a plurality of collinear ball groups comprises: Acquire the distance information between each metal ball contained in each ball group in the ball device, wherein the distance information is determined when designing the ball device; Based on the distance information, a plurality of ball image groups are identified from the plurality of collinear ball groups.
2. The method according to claim 1, characterized in that The ball device consists of a plurality of metal balls, a flat plate with a plurality of ball grooves, and a tracer. The tracer is fixed on the flat plate. The plurality of ball grooves on the flat plate form a regular polygon. The plurality of ball grooves on each side of the regular polygon are respectively used to place a plurality of metal balls in the same ball group.
3. The method according to claim 1, characterized in that: The number of the ball groups included in the ball device is no less than three and no more than eight, and any ball group contains three metal balls.
4. The method according to claim 1, characterized in that: The step of selecting a plurality of candidate spherical images from the radiological image comprises: Detecting each circular image area contained in the radiological image using a circular detection algorithm; Determine the radius of the metal sphere; According to the radius, each of the circular image regions is filtered to obtain a plurality of candidate ball images.
5. The method according to claim 1, characterized in that The step of respectively sorting each of the ball image groups comprises: Based on the distance information, the small ball images contained in each of the small ball image groups are sorted respectively.
6. The method according to any one of claims 1 to 5, characterized in that: The step of determining the calibration matrix according to the ball images included in each sorted ball image group includes: Acquire a two-dimensional point set of the ball images contained in each sorted ball image group, and a three-dimensional point set of a plurality of metal balls contained in each ball group in the ball device; The two-dimensional point set and the three-dimensional point set are calculated using the least square method to obtain a calibration matrix.
7. The method according to claim 1, characterized in that After selecting a plurality of small ball image groups satisfying the collinearity constraint condition from the radiological image, the method further comprises: If the number of the plurality of small ball image groups that satisfy the collinearity constraint condition is less than a preset number, three small ball images are obtained from the backup small ball group to form a temporary small ball image group; Calculate the calibration matrix using a plurality of ball image groups and the temporary ball group that satisfy the collinearity constraint condition; Calculating a loss value of the calibration matrix; If the loss value is less than a preset threshold, the current calibration matrix is used as a matrix for image calibration of the radiological image; otherwise, the temporary ball image group is updated and the calibration matrix is recalculated.
8. An image calibration 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 image calibration method according to any one of claims 1 to 7 is implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the image calibration method according to any one of claims 1 to 7 is implemented.
