Geometric deformation correction methods for X-ray images

By determining the neighboring pixel values ​​and coefficients of a pixel in an X-ray image, and directly using pre-calculated coefficients for correction, the problem of poor real-time performance caused by large computational load in existing technologies is solved, and efficient geometric deformation correction is achieved.

CN119648589BActive Publication Date: 2026-01-30BEIJING TELESOUND ELECTRONICS
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411532514.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2026-01-30
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

In existing technologies, the geometric deformation correction process for X-ray images involves a large amount of computation, resulting in poor real-time performance.

Method used

By determining the pixel values ​​and coefficients of adjacent pixels in each pixel in an X-ray image, the corrected pixel value is calculated based on these values ​​and coefficients, and the correction is performed using predetermined coefficients, reducing preprocessing and postprocessing.

Benefits of technology

This greatly reduces the computational load and improves the real-time performance of X-ray image correction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648589B_ABST
    Figure CN119648589B_ABST
Patent Text Reader

Abstract

This invention provides a method for correcting geometric deformation of X-ray images. The method includes: when it is determined that an X-ray image has undergone geometric deformation, determining, for each pixel in the X-ray image, the pixel values ​​of a first pixel and a second pixel adjacent to the pixel in the target direction; determining a corrected pixel value for each pixel based on the pixel value of the first pixel, a first coefficient corresponding to the first pixel, the pixel value of the second pixel, and a second coefficient corresponding to the second pixel; the first and second coefficients are determined based on the pixel coordinates obtained by mapping the pixels in the original X-ray image to an ideal X-ray image, where the original X-ray image includes a calibration object and has undergone geometric deformation, and the ideal X-ray image includes a calibration object and has not undergone geometric deformation; and determining the corrected X-ray image based on the corrected pixel values ​​of each pixel. This invention can improve the real-time performance of X-ray image correction.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and in particular to a geometric deformation correction method for X-ray images. BACKGROUND

[0002] In the fields of medical diagnosis, industrial detection and security inspection, X-ray imaging technology is widely used because it can penetrate objects and provide clear images of internal structures. However, due to the limitations of the device itself or the influence of the external environment, X-ray images often undergo geometric deformation, such as distortion or stretching, which seriously affects the image quality and the accuracy of subsequent image analysis.

[0003] In the prior art, when correcting the deformed X-ray image, a complex mathematical model is usually relied on or a deep learning model is trained with a large amount of training data, and then the trained model is used to correct the X-ray image.

[0004] However, the above methods require complex preprocessing of the image, resulting in a large amount of calculation and poor real-time correction of the X-ray image. SUMMARY

[0005] The present application provides a geometric deformation correction method for X-ray images to solve the problem of poor real-time correction of X-ray images in the prior art and achieve the purpose of improving the real-time correction of X-ray images.

[0006] The present application provides a geometric deformation correction method for X-ray images, comprising:

[0007] In the case where the X-ray image undergoes geometric deformation, for each pixel point in the X-ray image, the pixel value of a first pixel point adjacent to the pixel point in the target direction and the pixel value of a second pixel point are determined;

[0008] Based on the pixel value of the first pixel point, the first coefficient corresponding to the first pixel point, the pixel value of the second pixel point, and the second coefficient corresponding to the second pixel point, the correction pixel value of the pixel point is determined; the first coefficient and the second coefficient are determined based on the pixel point coordinates obtained by mapping the pixel points in the original X-ray image to the ideal X-ray image, the original X-ray image being an image including a calibration object and undergoing geometric deformation, and the ideal X-ray image being an image including a calibration object and not undergoing geometric deformation;

[0009] Based on the correction pixel values of each pixel point, the corrected X-ray image corresponding to the X-ray image is determined.

[0010] The X-ray image geometric deformation correction method provided by the application, the correction pixel value of the pixel point is determined based on the pixel value of the first pixel point, the first coefficient corresponding to the first pixel point, the pixel value of the second pixel point, and the second coefficient corresponding to the second pixel point, and includes:

[0011] The pixel value of the first pixel point is multiplied by the first coefficient corresponding to the first pixel point to obtain a first product, and the pixel value of the second pixel point is multiplied by the second coefficient corresponding to the second pixel point to obtain a second product;

[0012] The sum of the first product and the second product is determined as the correction pixel value of the pixel point.

[0013] The X-ray image geometric deformation correction method provided by the application further includes:

[0014] The original X-ray image is acquired;

[0015] The original X-ray image is stretched to obtain the ideal X-ray image;

[0016] Based on the first size of the original X-ray image in the target direction and the second size of the ideal X-ray image in the target direction, a scaling ratio is determined;

[0017] Based on the scaling ratio, the pixel points in the original X-ray image are mapped into the ideal X-ray image to obtain the coordinates of the mapped pixel points;

[0018] Based on the coordinates of the mapped pixel points, the floating-point coordinates of the corresponding pixel points in the original X-ray image are determined;

[0019] Based on the floating-point coordinates of the pixel points, the first coefficient and the second coefficient are determined.

[0020] The X-ray image geometric deformation correction method provided by the application, the calibration object includes a plurality of equally spaced feature points;

[0021] The floating-point coordinates of the corresponding pixel points in the original X-ray image are determined based on the coordinates of the mapped pixel points, and include:

[0022] A first deformed target feature point in the original X-ray image is determined;

[0023] In the case where the coordinates of the mapped pixel points are less than or equal to the coordinates of the pixel points corresponding to the target feature points, the coordinates of the mapped pixel points are determined as the floating-point coordinates of the corresponding pixel points.

[0024] The application provides a geometric deformation correction method of an X-ray image.

[0025] Actual coordinates of each feature point in the original X-ray image are obtained.

[0026] Ideal coordinates of each feature point in the ideal X-ray image are obtained.

[0027] A first target feature point with deformation is determined based on the actual coordinates of each feature point and the ideal coordinates of each feature point.

[0028] The application provides a geometric deformation correction method of an X-ray image.

[0029] In the case that the coordinates of the mapped pixel points are greater than the coordinates of the pixel points corresponding to the target feature points, polynomial fitting coefficients are obtained.

[0030] Based on the polynomial fitting coefficients and the coordinates of the mapped pixel points, a fitting polynomial is used to determine the floating-point coordinates of the corresponding pixel points.

[0031] The application provides a geometric deformation correction method of an X-ray image.

[0032] Based on the actual coordinates of each feature point and the ideal coordinates of each feature point, data fitting is performed by using the fitting polynomial to obtain the polynomial fitting coefficients.

[0033] The application provides a geometric deformation correction method of an X-ray image.

[0034] The floating-point coordinates of the pixel points are rounded up to obtain a first integer.

[0035] The difference between the first integer and the floating-point coordinates of the pixel points is determined as the first coefficient, and the first coefficient corresponds to the first pixel point, wherein the first pixel point is the previous pixel point of the pixel point in a target direction.

[0036] The floating-point coordinates of the pixel points are rounded down to obtain a second integer.

[0037] The difference between the floating-point coordinates of the pixel points and the second integer is determined as the second coefficient, and the second coefficient corresponds to the second pixel point, wherein the second pixel point is the next pixel point of the pixel point in a target direction.

[0038] According to the X-ray image geometric deformation correction method provided by the application, in the case that the target direction is a horizontal direction, the first coefficients of the same column of pixel points are the same, and the second coefficients of the same column of pixel points are the same.

[0039] In the case that the target direction is a vertical direction, the first coefficients of the same row of pixel points are the same, and the second coefficients of the same row of pixel points are the same.

[0040] According to the X-ray image geometric deformation correction method provided by the application, the determination that the X-ray image is geometrically deformed comprises:

[0041] Determining a position wrapped in the X-ray image;

[0042] In the case that the position does not match a preset position, determining that the X-ray image is geometrically deformed, wherein the preset position is a position that does not undergo geometric deformation when the X-ray image is captured.

[0043] The application further provides an X-ray image geometric deformation correction device, comprising:

[0044] A first determination module is configured to, in the case that the X-ray image is geometrically deformed, determine, for each pixel point in the X-ray image, a pixel value of a first pixel point adjacent to the pixel point in a target direction and a pixel value of a second pixel point adjacent to the pixel point in the target direction;

[0045] A second determination module is configured to determine a corrected pixel value of the pixel point based on the pixel value of the first pixel point, a first coefficient corresponding to the first pixel point, the pixel value of the second pixel point, and a second coefficient corresponding to the second pixel point, wherein the first coefficient and the second coefficient are determined based on pixel point coordinates obtained after mapping pixel points in an original X-ray image to an ideal X-ray image, the original X-ray image is an image comprising a calibration object and being geometrically deformed, and the ideal X-ray image is an image comprising the calibration object and not being geometrically deformed;

[0046] A third determination module is configured to determine a corrected X-ray image corresponding to the X-ray image based on the corrected pixel values of the pixel points.

[0047] The application further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the X-ray image geometric deformation correction method according to any one of the above-described methods when executing the computer program.

[0048] The application further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program is executable on a processor to implement the X-ray image geometric deformation correction method according to any one of the above-described methods.

[0049] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the geometric deformation correction method for X-ray images as described above.

[0050] The geometric deformation correction method for X-ray images provided by this invention, when it is determined that the X-ray image has undergone geometric deformation, determines the pixel value of the first pixel and the pixel value of the second pixel adjacent to the pixel in the target direction for each pixel in the X-ray image, and determines the corrected pixel value of the pixel based on the pixel value of the first pixel, the first coefficient corresponding to the first pixel, the pixel value of the second pixel, and the second coefficient corresponding to the second pixel, and determines the corrected X-ray image corresponding to the X-ray image based on the corrected pixel values ​​of each pixel. The first coefficient and the second coefficient are determined based on the pixel coordinates obtained by mapping the pixels in the original X-ray image to the ideal X-ray image. The original X-ray image is an image including a calibration object and undergoing geometric deformation, and the ideal X-ray image is an image including a calibration object and without geometric deformation. Since the first and second coefficients for pixel value correction of each pixel can be determined in advance based on the original X-ray image containing the calibration object with geometric deformation and the ideal X-ray image without geometric deformation, the pre-determined first and second coefficients can be directly used for correction in the actual correction process. This eliminates the need for extensive pre-processing and post-processing of the image, greatly reducing the computational load and improving the real-time performance of X-ray image correction. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0052] Figure 1 This is a system architecture diagram of the geometric deformation correction method for X-ray images provided in an embodiment of the present invention.

[0053] Figure 2 This is a schematic flowchart of the geometric deformation correction method for X-ray images provided in an embodiment of the present invention.

[0054] Figure 3 This is a schematic diagram of the X-ray image before correction provided in an embodiment of the present invention.

[0055] Figure 4 This is a schematic diagram of a corrected X-ray image provided in an embodiment of the present invention.

[0056] Figure 5This is a schematic diagram of the calibration object provided in an embodiment of the present invention.

[0057] Figure 6 This is a schematic diagram of X-ray image acquisition of a calibration object provided in an embodiment of the present invention.

[0058] Figure 7 This is a schematic diagram of the original X-ray image provided in an embodiment of the present invention.

[0059] Figure 8 This is a schematic diagram of a pseudo-color original X-ray image provided in an embodiment of the present invention.

[0060] Figure 9 This is a schematic diagram of the structure of the geometric deformation correction device for X-ray images provided in an embodiment of the present invention.

[0061] Figure 10 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0063] To address the problem in existing technologies where geometric deformation correction of X-ray images requires complex preprocessing and post-processing, resulting in high computational load and impacting real-time performance, this invention provides a method for geometric deformation correction of X-ray images. In this method, when geometric deformation is determined in an X-ray image, for each pixel, the pixel values ​​of the two adjacent pixels in the target direction of the deformation are obtained. Based on these two adjacent pixel values ​​and their corresponding correction coefficients, the correction pixel value of the pixel is determined. After determining the correction pixel value for each pixel in this manner, the corrected X-ray image is obtained. Since the correction coefficients of adjacent pixels can be pre-determined based on the original X-ray image containing the calibration object (with geometric deformation) and the ideal X-ray image without deformation, the pre-determined correction coefficients can be directly used for correction during the actual correction process. This eliminates the need for extensive preprocessing and post-processing, significantly reducing computational load and improving the real-time performance of X-ray image correction.

[0064] The following is combined with Figures 1 to 8The geometric deformation correction method for X-ray images provided in this invention is described below. This invention is applicable to any scenario requiring X-ray image acquisition, such as medical, security, and industrial inspection. The execution entity of this method can be an electronic device such as an X-ray security inspection machine, computer, server, server cluster, or a specially designed X-ray image geometric deformation correction device. Alternatively, it can be an X-ray image geometric deformation correction device installed within such electronic device, which can be implemented through software, hardware, or a combination of both.

[0065] Figure 1 The system architecture diagram of the geometric deformation correction method for X-ray images provided in the embodiments of the present invention is as follows: Figure 1 As shown, the system includes an image acquisition module, a calibration object processing module, a linear interpolation coefficient calculation and storage module, and a real-time image correction module. The image acquisition module uses a high-precision detector to acquire data, ensuring that the acquired X-ray images are clear and low-noise, providing a reliable data foundation for subsequent image processing.

[0066] The calibration object processing module is used to obtain the position of each feature point of the calibration object in the original X-ray image through the interface of the developed software and visualization technology, and to determine the ideal position of each feature point of the calibration object in the ideal X-ray image.

[0067] The linear interpolation coefficient calculation and storage module is used to perform polynomial fitting based on the positions of each feature point of the calibration object in the original X-ray image and the ideal positions of each feature point of the calibration object in the ideal X-ray image, to obtain linear interpolation coefficients, and to save these linear interpolation coefficients for quick access later.

[0068] The real-time image correction module is used to quickly load pre-calculated and saved linear interpolation coefficients during the real-time image correction stage. These loaded coefficients are then used to perform interpolation correction on the real-time acquired X-ray images. By finding the linear interpolation coefficients, each pixel in the X-ray image is precisely corrected to restore its true spatial position. The corrected X-ray image is clear and free of geometric distortion, meeting the requirements of security inspection, medical diagnosis, and other applications. Simultaneously, the real-time image correction module also optimizes the output format and speed of the corrected X-ray image to improve the user experience.

[0069] Figure 2 This is a schematic flowchart of the geometric deformation correction method for X-ray images provided in an embodiment of the present invention, as shown below. Figure 2 As shown, the method includes the following:

[0070] Step 201: If it is determined that the X-ray image has undergone geometric deformation, for each pixel in the X-ray image, determine the pixel value of the first pixel and the second pixel adjacent to the pixel in the target direction.

[0071] In this step, taking a security check scenario as an example, after scanning the package to be checked by an X-ray security scanner, an X-ray image can be obtained. When it is determined that the X-ray image has undergone geometric deformation, such as stretching or deformation, for each pixel in the X-ray image, it is necessary to determine its adjacent first and second pixels in the target direction. The target direction can be understood as the direction in which the X-ray image undergoes deformation, such as the horizontal, vertical, or diagonal direction. For example, if the target direction is horizontal, then the first and second pixels are the pixels on the left and right sides; if the target direction is vertical, then the first and second pixels are the pixels on the top and bottom sides.

[0072] Furthermore, it is also necessary to determine the pixel value of the first pixel and the pixel value of the second pixel. The pixel value usually refers to the gray value or brightness value of the pixel, which can reflect the brightness of the pixel in the X-ray image.

[0073] Step 202: Determine the corrected pixel value of the pixel based on the pixel value of the first pixel, the first coefficient corresponding to the first pixel, the pixel value of the second pixel, and the second coefficient corresponding to the second pixel.

[0074] The first and second coefficients are determined based on the pixel coordinates obtained by mapping the pixels in the original X-ray image to the ideal X-ray image. The original X-ray image is an image that includes the calibration object and has undergone geometric deformation, while the ideal X-ray image is an image that includes the calibration object and has not undergone geometric deformation.

[0075] In this step, the original X-ray image is the image captured after the calibration object is placed on the conveyor belt of the X-ray security inspection machine. This image contains the calibration object and has undergone geometric deformation. The ideal X-ray image can be understood as an image containing the calibration object but without geometric deformation. It is an image obtained after certain processing of the original X-ray image, or it can be a hypothetical theoretical image.

[0076] For each pixel in the original X-ray image, after mapping the pixel to the ideal X-ray image, the pixel coordinates of that pixel can be obtained. Based on the mapped pixel coordinates of each pixel, the first coefficient and the second coefficient can be determined. The first coefficient and the second coefficient can reflect the relationship between the pixel in the original X-ray image and the corresponding pixel in the ideal X-ray image.

[0077] It should be understood that for a given X-ray security inspection machine, since its installation location is fixed, the size of each X-ray image captured by this machine is the same. The first and second coefficients corresponding to adjacent pixels of a given pixel, calculated using the above method, are applicable to every pixel in subsequent X-ray images of the same size. Therefore, in the actual calibration process, the corrected pixel value of a pixel can be determined based on the pixel value of the first pixel, the pre-determined first coefficient corresponding to the first pixel, the pixel value of the second pixel, and the second coefficient corresponding to the second pixel.

[0078] Step 203: Based on the corrected pixel values ​​of each pixel, determine the corrected X-ray image corresponding to the X-ray image.

[0079] In this step, for each pixel in the X-ray image, its corresponding corrected pixel value can be determined according to the methods in steps 201 and 202. Based on the corrected pixel value corresponding to each pixel, the corrected X-ray image can be reconstructed.

[0080] Figure 3 This is a schematic diagram of the X-ray image before correction provided in an embodiment of the present invention, as shown below. Figure 3 As shown, the test object, such as a straight aluminum strip, is placed at an arbitrary angle in the security inspection machine. After passing through the security inspection machine channel, the X-ray security inspection machine is used to collect images, and the collected X-ray images show geometric deformation. Figure 4 This is a schematic diagram of the corrected X-ray image provided in an embodiment of the present invention, as shown below. Figure 4 As shown, the geometric deformation correction method for X-ray images provided by the embodiments of the present invention is used to correct the deformation of X-ray images. Figure 3 After correcting the pixel value of each pixel in the image, the deformed aluminum strip image can be corrected into a straight line, thus meeting the expected goal.

[0081] The geometric deformation correction method for X-ray images provided in this embodiment of the invention, when it is determined that the X-ray image has undergone geometric deformation, determines the pixel value of the first pixel and the pixel value of the second pixel adjacent to the pixel in the target direction for each pixel in the X-ray image, and determines the corrected pixel value of the pixel based on the pixel value of the first pixel, the first coefficient corresponding to the first pixel, the pixel value of the second pixel, and the second coefficient corresponding to the second pixel, and determines the corrected X-ray image corresponding to the X-ray image based on the corrected pixel values ​​of each pixel. The first coefficient and the second coefficient are determined based on the pixel coordinates obtained by mapping the pixels in the original X-ray image to the ideal X-ray image. The original X-ray image is an image including a calibration object and undergoing geometric deformation, and the ideal X-ray image is an image including a calibration object and without geometric deformation. Since the first and second coefficients for pixel value correction of each pixel can be determined in advance based on the original X-ray image containing the calibration object with geometric deformation and the ideal X-ray image without geometric deformation, the pre-determined first and second coefficients can be directly used for correction in the actual correction process. This eliminates the need for extensive pre-processing and post-processing of the image, greatly reducing the computational load and improving the real-time performance of X-ray image correction.

[0082] For example, based on the above embodiments, when determining the corrected pixel value of a pixel based on the pixel value of the first pixel, the first coefficient corresponding to the first pixel, the pixel value of the second pixel, and the second coefficient corresponding to the second pixel, the pixel value of the first pixel and the first coefficient corresponding to the first pixel may be multiplied to obtain a first product, and the pixel value of the second pixel and the second coefficient corresponding to the second pixel may be multiplied to obtain a second product. The sum of the first product and the second product is then determined as the corrected pixel value of the pixel.

[0083] Specifically, taking the target direction as horizontal as an example, the specific correction process for the target direction as vertical is similar to that for the horizontal direction, and will not be repeated here. Because X-ray images are deformed in the horizontal direction, the horizontal coordinate of a pixel in the X-ray image may be a floating-point number due to image deformation. Assume the coordinates of a pixel in the X-ray image are... ,like Let be a floating-point number. ,in, for The integer part, for If the decimal part is , then i and i+1 are The two integer x-coordinate points around it, that is, the i-th pixel, are the first pixel adjacent to it, and the (i+1)-th pixel is the second pixel adjacent to it.

[0084] For the first pixel Second pixel Their pixel values ​​in the X-ray image are respectively and According to the definition of one-dimensional linear interpolation, the pixel point can be determined according to the following formula (1). Corrected pixel values :

[0085] (1)

[0086] in, Indicates the first coefficient. This indicates the second coefficient, where the sum of the first and second coefficients is 1. The first coefficient... Second coefficient Corresponding to The ratio of distances to i and i+1.

[0087] In this embodiment, a weighted sum of the pixel values ​​of the first pixel and the second pixel can be determined based on the first and second coefficients, and the resulting weighted sum is used as the corrected pixel value. This method utilizes information from the local neighborhood of the pixel and reduces correction errors through weighting, thereby improving correction accuracy. Furthermore, determining the first and second coefficients using linear interpolation is relatively simple, avoids excessive computational burden, and meets the requirements of real-time performance and efficiency.

[0088] For example, based on the above embodiments, the first and second coefficients can be determined as follows: acquire the original X-ray image, stretch the original X-ray image to obtain an ideal X-ray image, determine the scaling ratio based on the first dimension of the original X-ray image in the target direction and the second dimension of the ideal X-ray image in the target direction, map the pixels in the original X-ray image to the ideal X-ray image based on the scaling ratio to obtain the coordinates of the mapped pixels, determine the floating-point coordinates of the corresponding pixels in the original X-ray image based on the coordinates of the mapped pixels, and then determine the first and second coefficients based on the floating-point coordinates of the pixels.

[0089] Specifically, Figure 5 A schematic diagram of the calibration material provided in the embodiments of the present invention, such as... Figure 5 As shown, in this embodiment of the invention, a calibration ruler can be selected as the calibration object. Figure 6 This is a schematic diagram of X-ray image acquisition of a calibration object according to an embodiment of the present invention. Figure 7 A schematic diagram of the original X-ray image provided in an embodiment of the present invention, as shown below. Figure 6As shown, a calibration ruler, used as a calibration tool, is placed horizontally on the conveyor belt of the X-ray security inspection machine. After the calibration ruler passes through the security inspection channel, the X-ray image is acquired, as shown below. Figure 7 The original X-ray image shown. Among them, Figure 7 The square object above the calibration ruler is a heavy fixture used to fix the ruler in place, preventing it from deviating from its horizontal position due to collisions with obstacles or vibrations. The calibration ruler is placed horizontally within the X-ray machine's security lane because horizontal placement facilitates subsequent calculation of the ideal horizontal coordinates of various feature points on the calibration object, such as... Figures 5-7 As shown, the calibration ruler includes multiple feature points, such as holes, which can be used for subsequent horizontal coordinate calibration.

[0090] like Figure 7 As shown, in the original X-ray image, the spacing between the holes on the left side of the calibration ruler is relatively uniform, while the spacing between the holes on the right side changes at a certain point. Figure 7 In the illustrated embodiment, the size is gradually reduced. Therefore, the calibration ruler in the original X-ray image undergoes geometric deformation relative to the actual calibration ruler, and its structure differs significantly from the original calibration ruler.

[0091] After acquiring the original X-ray image, the original X-ray image is stretched by means of reverse stretching or deformation to correct the deformation in the original X-ray image and obtain an ideal X-ray image of the calibration object without deformation.

[0092] Furthermore, a first dimension of the original X-ray image in the target direction and a second dimension of the ideal X-ray image in the target direction can also be measured; for example, the image width of the original X-ray image in the horizontal direction can be measured. Image width in the horizontal direction of an ideal X-ray image For example, in this embodiment, It can be 640, It can be 850, etc. Furthermore, the second size of the ideal X-ray image can also be calculated based on the distance between feature points in the calibration object. Furthermore, the scaling ratio can be determined according to the following formula (2). :

[0093] (2)

[0094] After determining the scaling ratio Then, for the original X-ray image, each pixel is mapped along the target direction to determine the coordinates of the pixel in the ideal X-ray image. It should be noted that if the target direction is horizontal, pixel mapping can be performed on a column basis; if the target direction is vertical, pixel mapping can be performed on a row basis. For example, if the target direction is horizontal, the index will be 0 to 640 along the horizontal coordinate direction to achieve column matching from the pixel column of the original X-ray image to the pixel column of the ideal X-ray image. During mapping, the horizontal coordinate of the mapped pixel can be determined according to the following formula (3). :

[0095] (3)

[0096] Here, col represents the column of pixels in the original X-ray image that needs to be mapped.

[0097] During pixel mapping, scaling may cause the coordinates of mapped pixels to be non-integer coordinates. Therefore, based on the mapped pixel coordinates, floating-point coordinates of these pixels in the original X-ray image can be determined. Then, based on these floating-point coordinates, a first coefficient and a second coefficient corresponding to adjacent pixels can be determined. The first coefficient is the correction coefficient corresponding to the pixel's left-side neighbor, and the second coefficient is the correction coefficient corresponding to the pixel's right-side neighbor. These first and second coefficients reflect the relationship between pixels in the original X-ray image and their corresponding pixels in the ideal X-ray image.

[0098] In this embodiment, by accurately determining the scaling ratio between the original X-ray image and the ideal X-ray image in the target direction, and mapping each pixel in the original X-ray image to the ideal X-ray image based on the scaling ratio, the coordinates of the mapped pixels are obtained. Then, the first coefficient and the second coefficient are determined based on the coordinates of the mapped pixels. The first coefficient and the second coefficient determined in the above manner are more accurate, thereby improving the accuracy of image correction and improving the image quality of the X-ray image.

[0099] For example, the aforementioned calibration object includes multiple feature points set at equal intervals. When determining the floating-point coordinates of the corresponding pixel in the original X-ray image based on the coordinates of the mapped pixel, it can be done by determining the first deformed target feature point in the original X-ray image, and determining the coordinates of the mapped pixel as the floating-point coordinates of the corresponding pixel if the coordinates of the mapped pixel are less than or equal to the coordinates of the pixel corresponding to the target feature point.

[0100] Specifically, such as Figure 5As shown, the calibration object includes multiple equally spaced feature points, such as the calibration ruler in this embodiment which includes 28 equally spaced holes. To reduce computation, the first deformed target feature point can be determined from the original X-ray image, that is, the pixel column colBendStart where deformation just begins in the original X-ray image, for example... Figure 7 The 339th pixel shown. The coordinates of the mapped pixel. When the coordinates of the pixel corresponding to the target feature point are less than or equal to colBendStart, it indicates that the pixel before mapping did not undergo deformation in the original X-ray image. Therefore, the coordinates of the mapped pixel can be directly determined as the floating-point coordinates of the corresponding pixel before mapping. This method reduces computation and improves the efficiency of determining the floating-point coordinates of pixels, thus ensuring real-time performance during subsequent image correction.

[0101] In one implementation, when determining the first deformed target feature point in the original X-ray image, the actual coordinates of each feature point in the original X-ray image can be obtained, and the ideal coordinates of each feature point in the ideal X-ray image can be obtained. Based on the actual coordinates and the ideal coordinates of each feature point, the first deformed target feature point can be determined.

[0102] Specifically, Figure 8 A schematic diagram of the original pseudo-color X-ray image provided in an embodiment of the present invention, as shown below. Figure 8 As shown, it can be based on Figure 7 ,Sure Figure 8 The pseudo-color original X-ray image shown is the original X-ray image of the calibration object after geometric deformation. This pseudo-color original X-ray image clearly displays each feature point in the calibration object, facilitating accurate identification and recording of the feature point coordinates. OpenCV can be used to read the pseudo-color original X-ray image, and the actual coordinates of each feature point in the calibration object can be recorded manually by clicking with the mouse. For example, the actual horizontal coordinate of each hole in the calibration ruler can be recorded. These actual horizontal coordinates reflect the position of the hole in the geometrically deformed original X-ray image.

[0103] Furthermore, by using the known physical distances between adjacent feature points on the calibration object, the ideal abscissa of each feature point in an ideal X-ray image without geometric deformation can be calculated. These ideal abscissas represent the position of the feature points on the ideal X-ray image. Because the known physical distances between adjacent feature points on the calibration object are fixed, theoretically, the pixel distances between feature points on the calibration object in the ideal X-ray image are also constant. For example, for calibrating a ruler, assuming the abscissa of the first hole is 20 and the abscissa of the second hole is 30, then the actual distance between two adjacent holes is 10. Thus, the ideal abscissa values ​​of the remaining holes are calculated to be 40, 50, 60, and so on. Further, based on the ideal abscissas of each hole, the horizontal dimensions of the ideal X-ray image without geometric deformation, i.e., the pixel width, can be determined; for example, the pixel width of an ideal X-ray image is 850 pixels.

[0104] It should be understood that when a feature point is not deformed, its actual coordinates in the original X-ray image and its ideal coordinates in the ideal X-ray image should be consistent. When a feature point is deformed, its actual coordinates in the original X-ray image will change, and therefore will differ from its ideal coordinates in the ideal X-ray image. Therefore, the actual coordinates of each feature point in the original X-ray image can be compared with its corresponding ideal coordinates in the ideal X-ray image, such as calculating the difference or distance between the two. Starting with the first feature point in the original X-ray image, a traversal comparison is performed, and the first feature point whose actual coordinates and ideal coordinates are inconsistent or have changed significantly is identified as the first deformed target feature point. The significant change can be determined based on a preset threshold; for example, among all feature points, when the distance between the actual and ideal coordinates of a feature point is the first to exceed a preset threshold, that feature point is considered the first deformed target feature point.

[0105] In this embodiment, the first target feature point that has undergone deformation is determined by comparing the actual coordinates and ideal coordinates of each feature point. This method can not only improve the efficiency of determining the target feature point, but also improve the accuracy of the determined target feature point.

[0106] For example, if the coordinates of the mapped pixel are greater than the coordinates of the pixel corresponding to the target feature point, the polynomial fitting coefficients can be obtained, and the floating-point coordinates of the corresponding pixel can be determined by using the fitting polynomial based on the polynomial fitting coefficients and the coordinates of the mapped pixel.

[0107] Specifically, if the coordinates of the mapped pixels are calculated When the coordinates of the pixel corresponding to the target feature point are greater than colBendStart, it indicates that the pixel before mapping has been deformed in the original X-ray image. Therefore, it is necessary to fit the floating-point coordinates of the corresponding pixel in the original X-ray image by using a fitting polynomial. For example, the cubic fitting polynomial shown in the following formula (4) can be used to fit the pixel and determine the floating-point coordinates of the corresponding pixel in the original X-ray image. :

[0108] (4)

[0109] in, , , and These are the fitting coefficients of the polynomial, used for calculating nonlinear transformations. .

[0110] In this embodiment, when the coordinates of the mapped pixel are greater than the coordinates of the pixel corresponding to the target feature point, polynomial fitting coefficients can be obtained. Based on the polynomial fitting coefficients, the floating-point coordinates of the corresponding pixel are determined by fitting. Polynomial fitting can more accurately describe complex deformation relationships, thus the determined floating-point coordinates are more accurate, improving the correction accuracy of subsequent images.

[0111] For example, based on the above embodiments, when obtaining the polynomial fitting coefficients, the data can be fitted using a fitting polynomial based on the actual coordinates and ideal coordinates of each feature point to obtain the polynomial fitting coefficients.

[0112] Specifically, the actual coordinates and ideal coordinates of each feature point can be used to fit a polynomial function using the least squares method. This polynomial function can describe the mapping relationship between the actual coordinates and the ideal coordinates. The specific polynomial fitting can be calculated using the following formula (5):

[0113] (5)

[0114] in, Represents the actual coordinates, This represents the ideal coordinates, and m indicates the end of higher-order terms. This represents the fitting coefficient.

[0115] In this embodiment, data fitting can be performed using the cubic polynomial in the following formula (6):

[0116] (6)

[0117] The fitting coefficients of the fitted polynomial obtained after fitting are: It is 7.788e-07. It is -0.00132. It is 1.059. The value is -0.9825, which allows us to obtain the fitting polynomial function representing the mapping relationship between actual coordinates and ideal coordinates.

[0118] In this embodiment, a high-precision fitting polynomial can be used to fit the data based on the actual and ideal coordinates of each feature point. This can describe the geometric deformation patterns in the original X-ray image, making the obtained polynomial fitting coefficients applicable to both linear and nonlinear scenes. Therefore, when using the polynomial fitting coefficients for subsequent image correction, X-ray images from different sources and of different qualities can be corrected, making the image correction more versatile.

[0119] For example, based on the above embodiments, when determining the first coefficient and the second coefficient based on the floating-point coordinates of the pixel, it can be done in the following way:

[0120] Round the floating-point coordinates of the pixel upwards to obtain the first integer. The difference between the first integer and the floating-point coordinates of the pixel is determined as the first coefficient, which corresponds to the first pixel, the preceding pixel in the target direction. Round the floating-point coordinates of the pixel downwards to obtain the second integer. The difference between the floating-point coordinates of the pixel and the second integer is determined as the second coefficient, which corresponds to the second pixel, the following pixel in the target direction.

[0121] Specifically, assuming the target direction is horizontal, for a pixel in an X-ray image, the pixel to the left of that pixel is the first pixel, and the pixel to the right of that pixel is the second pixel. Assuming the target direction is vertical, for a pixel in an X-ray image, the pixel above that pixel is the first pixel, and the pixel below that pixel is the second pixel. In practical applications, the first coefficient corresponding to the first pixel can be determined using the following formula (7):

[0122] (7)

[0123] in, Indicates the first coefficient. Floating-point coordinates of pixels The value to be rounded up.

[0124] The second coefficient corresponding to the second pixel is determined using the following formula (8):

[0125] (8)

[0126] in, Indicates the second coefficient. Floating-point coordinates of pixels The value to be rounded down.

[0127] The first coefficient corresponding to each pixel in the original X-ray image is determined using the method described above. Second coefficient Then, it can be saved. During subsequent calibration, since the size of the X-ray image acquired by the same X-ray security inspection machine is the same as the size of the original X-ray image, it is not necessary to redetermine the first coefficient. Second coefficient By directly using the previously determined coefficients for correction, the real-time performance of image correction is improved.

[0128] In this embodiment, for each pixel, a first coefficient corresponding to the first pixel adjacent to it and a second coefficient corresponding to the second pixel adjacent to it can be determined. Subsequently, the first coefficient and the second coefficient are used together to determine the corrected pixel value of the pixel. Since the influence of the pixels on both sides is taken into account, the accuracy of the final corrected image can be improved and the image quality is improved.

[0129] For example, based on the above embodiments, when the target direction is horizontal, the first coefficients of pixels in the same column are the same, and the second coefficients of pixels in the same column are the same; when the target direction is vertical, the first coefficients of pixels in the same row are the same, and the second coefficients of pixels in the same row are the same.

[0130] Specifically, when the target direction is horizontal, it means that the original X-ray image has a large deformation in the horizontal direction. In this case, when determining the first and second coefficients, the calculation is performed on a per-pixel-column basis. In this way, the first coefficient and the second coefficient are the same for pixels in the same column.

[0131] Similarly, when the target direction is vertical, it means that the original X-ray image has a large deformation in the vertical direction. In this case, when determining the first and second coefficients, the calculation will be performed on a pixel-by-pixel basis. In this way, the first coefficient and the second coefficient will be the same for pixels in the same row.

[0132] In this embodiment, when the target direction is horizontal, the first coefficients of pixels in the same column are the same, and the second coefficients of pixels in the same column are the same. When the target direction is vertical, the first coefficients of pixels in the same row are the same, and the second coefficients of pixels in the same column are the same. This avoids determining the first and second coefficients of each pixel individually, thereby greatly reducing the amount of computation and improving the efficiency of determining the first and second coefficients.

[0133] For example, based on the above embodiments, when determining that an X-ray image has undergone geometric deformation, the position enclosed in the X-ray image can be determined first. If the position does not match the preset position, the X-ray image is determined to have undergone geometric deformation. The preset position is the position where geometric deformation does not occur when the X-ray image is captured.

[0134] Specifically, X-ray images often show areas that are deformed while other areas remain unchanged, such as... Figure 7 and Figure 8 As shown, the left side of the X-ray image is undistorted, while the right side is distorted. In the field of security inspection, X-ray image correction is mainly to better display the package to be inspected. When the package to be inspected is already in the left side of the X-ray image, that is, without distortion, there is no need to correct the X-ray image.

[0135] Therefore, in practical applications, a preset position can be set where geometric deformation will not occur when the X-ray image is captured, such as the left side of the X-ray image. If the package to be inspected is not located in the preset position in the X-ray image, it indicates that the portion of the X-ray image containing the package has also been deformed. This confirms that the X-ray image has undergone geometric deformation and requires subsequent correction. Conversely, if the package is located in the preset position in the X-ray image, it indicates that the portion of the X-ray image containing the package has not been deformed. This confirms that the X-ray image has not undergone geometric deformation and requires no subsequent correction.

[0136] In this embodiment, after determining the position of the package in the X-ray image, the X-ray image is only determined to have undergone geometric deformation if the position does not match the preset position. This avoids the phenomenon of correcting the X-ray image even if the part where the package is located has not been deformed, saving system resources and improving security inspection efficiency.

[0137] The geometric deformation correction device for X-ray images provided by the present invention will be described below. The geometric deformation correction device for X-ray images described below can be referred to in correspondence with the geometric deformation correction method for X-ray images described above.

[0138] Figure 9 This is a schematic diagram of the structure of the geometric deformation correction device for X-ray images provided in an embodiment of the present invention, with reference to... Figure 9 As shown, the geometric deformation correction device 900 for X-ray images includes:

[0139] The first determining module 11 is used to determine the pixel value of the first pixel and the second pixel adjacent to the pixel in the target direction for each pixel in the X-ray image when it is determined that the X-ray image has undergone geometric deformation.

[0140] The second determining module 12 is used to determine the corrected pixel value of the pixel based on the pixel value of the first pixel, the first coefficient corresponding to the first pixel, the pixel value of the second pixel, and the second coefficient corresponding to the second pixel; the first coefficient and the second coefficient are determined based on the pixel coordinates obtained by mapping the pixel in the original X-ray image to the ideal X-ray image, the original X-ray image is an image including a calibration object and undergoing geometric deformation, and the ideal X-ray image is an image including a calibration object and without geometric deformation;

[0141] The third determining module 13 is used to determine the corrected X-ray image corresponding to the X-ray image based on the corrected pixel value of each pixel.

[0142] In one example embodiment, the second determining module 12 is specifically used for:

[0143] Multiply the pixel value of the first pixel by the first coefficient corresponding to the first pixel to obtain a first product, and multiply the pixel value of the second pixel by the second coefficient corresponding to the second pixel to obtain a second product;

[0144] The sum of the first product and the second product is determined as the corrected pixel value of the pixel.

[0145] In one example embodiment, the device further includes:

[0146] The acquisition module is used to acquire the original X-ray image;

[0147] The stretching module is used to stretch the original X-ray image to obtain the ideal X-ray image;

[0148] The fourth determining module is used to determine the scaling ratio based on the first dimension of the original X-ray image in the target direction and the second dimension of the ideal X-ray image in the target direction;

[0149] The mapping module is used to map the pixels in the original X-ray image to the ideal X-ray image based on the scaling ratio, so as to obtain the coordinates of the mapped pixels.

[0150] The fifth determining module is used to determine the floating-point coordinates of the corresponding pixel in the original X-ray image based on the coordinates of the mapped pixel.

[0151] The sixth determining module is used to determine the first coefficient and the second coefficient based on the floating-point coordinates of the pixel.

[0152] In one example embodiment, the calibrator includes a plurality of feature points arranged at equal intervals;

[0153] The fifth determining module is specifically used for:

[0154] Identify the first deformed target feature point in the original X-ray image;

[0155] If the coordinates of the mapped pixel are less than or equal to the coordinates of the pixel corresponding to the target feature point, the coordinates of the mapped pixel are determined as the floating-point coordinates of the corresponding pixel.

[0156] In one example embodiment, the fifth determining module is specifically used for:

[0157] Obtain the actual coordinates of each feature point in the original X-ray image;

[0158] Obtain the ideal coordinates of each feature point in the ideal X-ray image;

[0159] Based on the actual coordinates and ideal coordinates of each feature point, the first target feature point to undergo deformation is determined.

[0160] In one example embodiment, the acquisition module is further configured to acquire polynomial fitting coefficients when the coordinates of the mapped pixel are greater than the coordinates of the pixel corresponding to the target feature point.

[0161] The fifth determining module is further configured to determine the floating-point coordinates of the corresponding pixel point by using a fitting polynomial based on the polynomial fitting coefficients and the coordinates of the mapped pixel point.

[0162] In one example embodiment, the acquisition module is specifically used for:

[0163] Based on the actual coordinates and ideal coordinates of each feature point, the data is fitted using the fitting polynomial to obtain the polynomial fitting coefficients.

[0164] In one example embodiment, the sixth determining module is specifically used for:

[0165] The floating-point coordinates of the pixel are rounded up to obtain the first integer;

[0166] The difference between the first integer and the floating-point coordinates of the pixel is determined as the first coefficient, which corresponds to the first pixel, and the first pixel is the pixel preceding the pixel in the target direction.

[0167] The floating-point coordinates of the pixel are rounded down to obtain the second integer;

[0168] The difference between the floating-point coordinates of the pixel and the second integer is determined as the second coefficient, which corresponds to the second pixel, which is the pixel following the pixel in the target direction.

[0169] In one example embodiment, when the target direction is horizontal, the first coefficients of pixels in the same column are the same, and the second coefficients of pixels in the same column are the same.

[0170] When the target direction is vertical, the first coefficients of pixels in the same row are the same, and the second coefficients of pixels in the same row are the same.

[0171] In one example embodiment, the first determining module 11 is specifically used for:

[0172] Determine the location of the object within the X-ray image;

[0173] If the position does not match the preset position, it is determined that the X-ray image has undergone geometric deformation. The preset position is the position where geometric deformation does not occur when the X-ray image is captured.

[0174] The X-ray image geometric deformation correction device of this embodiment can be used to execute the method of any embodiment in the X-ray image geometric deformation correction method side embodiment. Its specific implementation process and technical effects are similar to those in the X-ray image geometric deformation correction method side embodiment. For details, please refer to the detailed description in the X-ray image geometric deformation correction method side embodiment, which will not be repeated here.

[0175] Figure 10 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as... Figure 10As shown, the electronic device may include: a processor 1010, a communications interface 1020, a memory 1030, and a communications bus 1040, wherein the processor 1010, the communications interface 1020, and the memory 1030 communicate with each other through the communications bus 1040. The processor 1010 can call logic instructions in the memory 1030 to execute a geometric deformation correction method for an X-ray image. The method includes: when it is determined that the X-ray image has undergone geometric deformation, determining, for each pixel in the X-ray image, the pixel value of a first pixel adjacent to the pixel in the target direction and the pixel value of a second pixel; determining a corrected pixel value for the pixel based on the pixel value of the first pixel, a first coefficient corresponding to the first pixel, the pixel value of the second pixel, and a second coefficient corresponding to the second pixel; the first coefficient and the second coefficient are determined based on pixel coordinates obtained by mapping pixels in the original X-ray image to an ideal X-ray image, wherein the original X-ray image is an image including a calibration object and undergoing geometric deformation, and the ideal X-ray image is an image including a calibration object and not undergoing geometric deformation; and determining a corrected X-ray image corresponding to the X-ray image based on the corrected pixel values ​​of each pixel.

[0176] Furthermore, the logical instructions in the aforementioned memory 1030 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0177] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the geometric deformation correction method for X-ray images provided by the above methods. The method includes: when it is determined that the X-ray image has undergone geometric deformation, determining, for each pixel in the X-ray image, the pixel value of a first pixel and the pixel value of a second pixel adjacent to the pixel in the target direction; determining the corrected pixel value of the pixel based on the pixel value of the first pixel, a first coefficient corresponding to the first pixel, the pixel value of the second pixel, and a second coefficient corresponding to the second pixel; the first coefficient and the second coefficient are determined based on the pixel coordinates obtained by mapping the pixels in the original X-ray image to an ideal X-ray image, wherein the original X-ray image is an image including a calibration object and undergoing geometric deformation, and the ideal X-ray image is an image including a calibration object and not undergoing geometric deformation; and determining the corrected X-ray image corresponding to the X-ray image based on the corrected pixel value of each pixel.

[0178] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a geometric deformation correction method for X-ray images provided by the methods described above. The method includes: when it is determined that an X-ray image has undergone geometric deformation, determining, for each pixel in the X-ray image, the pixel value of a first pixel adjacent to the pixel in a target direction and the pixel value of a second pixel; determining a corrected pixel value for the pixel based on the pixel value of the first pixel, a first coefficient corresponding to the first pixel, the pixel value of the second pixel, and a second coefficient corresponding to the second pixel; wherein the first coefficient and the second coefficient are determined based on pixel coordinates obtained by mapping pixels in the original X-ray image to an ideal X-ray image, the original X-ray image being an image including a calibration object and undergoing geometric deformation, and the ideal X-ray image being an image including a calibration object and not undergoing geometric deformation; and determining a corrected X-ray image corresponding to the X-ray image based on the corrected pixel values ​​of each pixel.

[0179] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0180] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0181] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method of geometric distortion correction of an X-ray image, characterized in that, The method comprises: In a case where it is determined that the X-ray image is geometrically deformed, for each pixel point in the X-ray image, determining a pixel value of a first pixel point adjacent to the pixel point in a target direction and a pixel value of a second pixel point; Based on the pixel value of the first pixel point, a first coefficient corresponding to the first pixel point, the pixel value of the second pixel point, and a second coefficient corresponding to the second pixel point, determining a corrected pixel value of the pixel point; The first coefficient and the second coefficient are determined based on pixel point coordinates obtained after mapping pixel points in an original X-ray image to an ideal X-ray image, the original X-ray image being an image including a calibration object and being geometrically deformed, and the ideal X-ray image being an image including the calibration object and not being geometrically deformed; Based on the corrected pixel value of each pixel point, determining a corrected X-ray image corresponding to the X-ray image; The method further comprises: Obtaining the original X-ray image; Stretching the original X-ray image to obtain the ideal X-ray image; Based on a first size of the original X-ray image in the target direction and a second size of the ideal X-ray image in the target direction, determining a scaling ratio; Based on the scaling ratio, mapping the pixel points in the original X-ray image to the ideal X-ray image to obtain coordinates of the mapped pixel points; Based on the coordinates of the mapped pixel points, determining floating-point coordinates of corresponding pixel points in the original X-ray image; Based on the floating-point coordinates of the pixel points, determining the first coefficient and the second coefficient.

2. The method of geometric distortion correction of an X-ray image according to claim 1, characterized in that, The method further comprises: Multiplying the pixel value of the first pixel point by the first coefficient corresponding to the first pixel point to obtain a first product, and multiplying the pixel value of the second pixel point by the second coefficient corresponding to the second pixel point to obtain a second product; Determining a sum of the first product and the second product as the corrected pixel value of the pixel point.

3. The method of geometric distortion correction of an X-ray image according to claim 2, characterized in that, The calibration object includes a plurality of feature points arranged at equal intervals; The method further comprises: Determining a first deformed target feature point in the original X-ray image; In a case where the coordinates of the mapped pixel points are less than or equal to the coordinates of the pixel points corresponding to the target feature points, determining the coordinates of the mapped pixel points as the floating-point coordinates of the corresponding pixel points.

4. The method of geometric distortion correction of an X-ray image according to claim 3, characterized in that, The method further comprises: Obtaining actual coordinates of each feature point in the original X-ray image; Obtaining ideal coordinates of each feature point in the ideal X-ray image; Based on the actual coordinates of each feature point and the ideal coordinates of each feature point, determining a first deformed target feature point.

5. The method of geometric distortion correction of an X-ray image according to claim 3, characterized in that, The method further comprises: In a case where the coordinate of the mapped pixel point is greater than the coordinate of the pixel point corresponding to the target feature point, a polynomial fitting coefficient is obtained; Based on the polynomial fitting coefficient and the coordinate of the mapped pixel point, a floating-point coordinate of the corresponding pixel point is determined by using a fitting polynomial.

6. The method of geometric distortion correction of an X-ray image according to claim 5, characterized in that, The obtaining of the polynomial fitting coefficient comprises: Based on the actual coordinates of each feature point and the ideal coordinates of each feature point, data fitting is performed by using the fitting polynomial to obtain the polynomial fitting coefficient.

7. The method of geometric distortion correction of an X-ray image according to claim 1, wherein, The determining of the first coefficient and the second coefficient based on the floating-point coordinate of the pixel point comprises: The floating-point coordinate of the pixel point is rounded up to obtain a first integer; The difference between the first integer and the floating-point coordinate of the pixel point is determined as the first coefficient, the first coefficient corresponding to the first pixel point, the first pixel point being the previous pixel point of the pixel point in a target direction; The floating-point coordinate of the pixel point is rounded down to obtain a second integer; The difference between the floating-point coordinate of the pixel point and the second integer is determined as the second coefficient, the second coefficient corresponding to the second pixel point, the second pixel point being the next pixel point of the pixel point in the target direction.

8. The method of geometric distortion correction of X-ray images according to any one of claims 1 to 7, characterized in that, In a case where the target direction is a horizontal direction, the first coefficients of pixel points in the same column are the same, and the second coefficients of pixel points in the same column are the same; In a case where the target direction is a vertical direction, the first coefficients of pixel points in the same row are the same, and the second coefficients of pixel points in the same row are the same.

9. The method of geometric distortion correction of X-ray images according to any one of claims 1 to 7, characterized in that, The determination of the X-ray image having geometric deformation comprises: Determining a position wrapped in the X-ray image; In a case where the position does not match a preset position, it is determined that the X-ray image has geometric deformation, the preset position being a position that does not have geometric deformation when the X-ray image is captured.

Citation Information

Patent Citations

  • Parcel image segmentation method and device, electronic equipment and storage medium

    CN115131379A