X-ray image correction method, storage medium and device
By identifying the outline of the target object in the X-ray image, establishing a three-dimensional distorted coordinate system and performing geometric stereo projection and fitting processing, the image distortion problem caused by oblique shooting of X-ray detection equipment is solved, and the detection efficiency and clarity are improved.
Patent Information
- Application Number
- CN202211192835.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-28
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-09-28
AI Technical Summary
X-ray detection equipment is prone to image distortion when shooting at an oblique angle, affecting detection efficiency and clarity.
By acquiring an oblique X-ray image, identifying the outline of the target object, establishing a three-dimensional distorted coordinate system, performing geometric stereo projection and fitting processing, adjusting the shooting angle, and repeating the above steps, a frontal X-ray image of the target object is obtained.
It effectively corrects image distortion caused by oblique shooting, improving detection efficiency and image clarity.
Smart Images

Figure CN115511745B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image correction, and in particular to an X-ray image correction method, storage medium and device. Background Art
[0002] X-ray inspection equipment is an effective and versatile "X-ray" instrument. It has been developed in China for over 20 years and has become increasingly mature through years of development and accumulation. In many engineering situations, X-ray inspection equipment is required to observe the internal structure and operating conditions of various construction machinery.
[0003] Currently, due to the large size of X-ray inspection equipment, it is not flexible enough to enter the gaps between various devices to directly inspect the device components. Moreover, if the device components are photographed directly from the outside, the X-ray images captured by the X-ray inspection equipment are easily affected by other objects and / or other components on the outside. In this case, the device components can only be photographed by tilting the shooting direction. Although this method can fully display the device components, due to the geometric angle tilt and the X-ray image is relatively abstract compared to the real photo, the captured X-ray image will be distorted to varying degrees and relatively serious, which is very unfavorable for the inspection of device components. Summary of the Invention
[0004] Based on this, it is necessary to address the above problems and propose an X-ray image correction method, storage medium and equipment, which can effectively avoid problems such as unclear display of the target object structure and improve the efficiency of detection.
[0005] To achieve the above-mentioned object, the present invention provides, in a first aspect, a method for correcting an X-ray image, the method comprising:
[0006] Acquire an X-ray image captured at a first shooting angle, and identify a contour of a target object in the X-ray image;
[0007] Determine the X-axis, Y-axis, and Z-axis of the three-dimensional distorted coordinate system according to the contour of the target object;
[0008] Performing geometric stereo projection processing on the outline of the target object according to the three-dimensional distorted coordinate system to obtain a frontal X-ray image of the target object;
[0009] Adjust the shooting angle and repeat the above steps to obtain a preset number of frontal X-ray images;
[0010] The preset number of frontal X-ray images are fitted to obtain a target frontal X-ray image.
[0011] Optionally, identifying the contour of the target object in the X-ray image includes:
[0012] An image recognition algorithm based on deep learning is used to perform image recognition processing on the X-ray image to obtain the outline of the target object in the X-ray image.
[0013] Optionally, determining an X-axis of a three-dimensional distorted coordinate system according to the contour of the target object includes:
[0014] determining a plurality of key points on the X-ray image according to the contour of the target object;
[0015] Determine the direction of the front horizontal line according to the plurality of key points;
[0016] The front horizontal line direction is used as the X-axis of the three-dimensional distorted coordinate system.
[0017] Optionally, determining the Y axis of the three-dimensional distorted coordinate system according to the contour of the target object includes:
[0018] determining a plurality of key points on the X-ray image according to the contour of the target object;
[0019] Determine the direction of the side horizontal line according to the multiple key points;
[0020] The side horizontal line direction is used as the Y axis of the three-dimensional distorted coordinate system.
[0021] Optionally, determining the Z axis of the three-dimensional distorted coordinate system according to the contour of the target object includes:
[0022] determining a plurality of key points on the X-ray image according to the contour of the target object;
[0023] Determine the direction of the front vertical line according to the plurality of key points;
[0024] The front vertical line direction is used as the Z axis of the three-dimensional distorted coordinate system.
[0025] Optionally, obtaining a frontal X-ray image of the target object after performing geometric stereo projection processing on the contour of the target object according to the three-dimensional distorted coordinate system includes:
[0026] Through a geometric transformation algorithm, the outline of the target object in the three-dimensional distorted coordinate system is projected onto a two-dimensional distorted coordinate system consisting of any two axes of the X-axis, Y-axis, and Z-axis of the three-dimensional distorted coordinate system to obtain a frontal X-ray image of the target object.
[0027] Optionally, performing fitting processing on the preset number of frontal X-ray images to obtain a target frontal X-ray image includes:
[0028] determining a confidence level for each confidence region in each frontal X-ray image;
[0029] The target frontal X-ray image is obtained by combining multiple confidence regions with the highest confidence levels among the confidence regions at the same position in each frontal X-ray image.
[0030] Optionally, determining the confidence level of each confidence region in each frontal X-ray image comprises:
[0031] Divide each frontal X-ray image into a plurality of confidence regions;
[0032] Comparing the confidence regions at the same position in each frontal X-ray image to obtain the overlap of the corresponding confidence regions in each frontal X-ray image;
[0033] The confidence level of each confidence region in each frontal X-ray image is determined according to the overlap level of the confidence regions at the same position in each frontal X-ray image.
[0034] To achieve the above-mentioned object, the present invention provides, in a second aspect, a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform the steps of the method described in the first aspect.
[0035] To achieve the above-mentioned objectives, the present invention provides a computer device in a third aspect, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method described in the first aspect.
[0036] The embodiment of the present invention has the following beneficial effects: obtaining an X-ray image taken at a first shooting angle and identifying the outline of a target object in the X-ray image; determining the X-axis, Y-axis, and Z-axis of a three-dimensional distorted coordinate system based on the outline of the target object; performing geometric stereo projection processing on the outline of the target object based on the three-dimensional distorted coordinate system to obtain a frontal X-ray image of the target object; adjusting the shooting angle and repeating the above steps to obtain a preset number of frontal X-ray images; performing fitting processing on the preset number of frontal X-ray images to obtain a target frontal X-ray image. The above method identifies X-ray images taken at different angles at an oblique angle, determines a three-dimensional distorted coordinate system, performs geometric stereo projection and fitting processing, and finally obtains a target frontal X-ray image of the target object in the frontal direction. This effectively avoids the problem that the X-ray image taken at an oblique angle is distorted to varying degrees and more severely, thereby resulting in unclear display of the structure of the captured target object. The target frontal X-ray image obtained by the above method can also greatly improve detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0038] in:
[0039] Figure 1 This is an X-ray image correction method in an embodiment of the present application;
[0040] Figure 2 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0042] See also Figure 1 , is an X-ray image correction method in an embodiment of the present application, the method comprising:
[0043] Step 110: Acquire an X-ray image captured at a first shooting angle, and identify the outline of the target object in the X-ray image.
[0044] The target object is a component of a device that needs to be inspected using an X-ray inspection device.
[0045] It should be noted that the X-ray image taken at the first shooting angle is taken by tilting the shooting direction to shoot the target object, so that the X-ray image taken in this way has a geometric angle tilt, that is, the X-ray image taken is distorted.
[0046] It should be further explained that the X-ray image can be subjected to image recognition processing to obtain the outline of the protruding target object.
[0047] Step 120: Determine the X-axis, Y-axis, and Z-axis of the three-dimensional distorted coordinate system according to the contour of the target object.
[0048] It should be noted that, for the determination of the X-axis, Y-axis and Z-axis of the three-dimensional distorted coordinate system, multiple key points corresponding to the X-axis, multiple key points corresponding to the Y-axis and multiple key points corresponding to the Z-axis can be marked in the X-ray image according to the contour of the target object, and then the multiple key points corresponding to the X-axis, the multiple key points corresponding to the Y-axis and the multiple key points corresponding to the Z-axis are processed respectively by the K-means clustering method, that is: the multiple key points corresponding to the X-axis are divided into two groups on average, and the direction of the dividing line of the two groups of key points is used as the X-axis; the multiple key points corresponding to the Y-axis are divided into two groups on average, and the direction of the dividing line of the two groups of key points is used as the Y-axis; the multiple key points corresponding to the Z-axis are divided into two groups on average, and the direction of the dividing line of the two groups of key points is used as the Z-axis; finally, the three-dimensional distorted coordinate system is determined according to the X-axis, Y-axis and Z-axis.
[0049] Step 130: Performing geometric stereo projection processing on the outline of the target object according to the three-dimensional distorted coordinate system to obtain a frontal X-ray image of the target object.
[0050] It should be noted that in the three-dimensional distorted coordinate system obtained from the X-ray image, the outline of the target object can be projected, that is, the outline of the target object in the three-dimensional distorted coordinate system is projected onto a two-dimensional distorted coordinate system composed of any two axes of the X-axis, Y-axis, and Z-axis of the three-dimensional distorted coordinate system, thereby obtaining a frontal X-ray image of the target object (that is, projecting the three-dimensional image into a two-dimensional image). It is understood that the two-dimensional distorted coordinate system here can be composed of the X-axis and the Y-axis, the X-axis and the Z-axis, or the Y-axis and the Z-axis.
[0051] Step 140: Adjust the shooting angle and repeat steps 110 to 130 to obtain a preset number of frontal X-ray images.
[0052] The preset number is set according to the actual needs of the operator. For example, if the preset number is set to 3, steps 110 to 130 need to be repeated twice to obtain 3 frontal X-ray images. That is, in a feasible implementation method, it is also necessary to: obtain an X-ray image taken at a second shooting angle, and identify the outline of the target object in the X-ray image. Determine the X-axis, Y-axis, and Z-axis of the three-dimensional distorted coordinate system based on the outline of the target object; perform geometric stereo projection processing on the outline of the target object according to the three-dimensional distorted coordinate system to obtain a frontal X-ray image of the target object (the frontal X-ray image of the target object obtained at the second shooting angle); obtain an X-ray image taken at a third shooting angle, and identify the outline of the target object in the X-ray image. Determine the X-axis, Y-axis, and Z-axis of the three-dimensional distorted coordinate system based on the outline of the target object; perform geometric stereo projection processing on the outline of the target object according to the three-dimensional distorted coordinate system to obtain a frontal X-ray image of the target object (the frontal X-ray image of the target object obtained at the third shooting angle).
[0053] It should be noted that since there may be some errors between the frontal X-ray image obtained by taking an X-ray image from only one shooting angle and the actual frontal target object, it is necessary to adjust the shooting angle to obtain multiple frontal X-ray images obtained by taking multiple X-ray images from multiple shooting angles. Based on the multiple frontal X-ray images obtained from different shooting angles, the target frontal X-ray image that is consistent with the actual frontal target object can be determined.
[0054] Step 150: Perform fitting processing on a preset number of frontal X-ray images to obtain a target frontal X-ray image.
[0055] It should be noted that the fitting process here refers to dividing each of a preset number of frontal X-ray images into multiple confidence regions, then calculating the confidence of each confidence region of each frontal X-ray image, and combining multiple confidence regions with the highest confidence at the same position of each frontal X-ray image of the preset number of frontal X-ray images. The frontal X-ray image obtained by combining the multiple confidence regions is the target X-ray image.
[0056] It should be further explained that for the calculation of the confidence of each confidence area of each frontal X-ray image, the confidence areas at the same position of each frontal X-ray image of a preset number of frontal X-ray images can be compared, and the confidence of the confidence area can be determined based on the overlap of the comparison. It can be understood that the higher the overlap of the comparison, the higher the confidence.
[0057] In an embodiment of the present application, by identifying X-ray images taken at different angles at an oblique angle, determining a three-dimensional distorted coordinate system, and performing geometric stereo projection and fitting processing, a target frontal X-ray image of the target object in the frontal direction is finally obtained. This effectively avoids the problem that the X-ray image taken at an oblique angle causes the captured X-ray image to be distorted to varying degrees and more seriously, thereby resulting in unclear display of the structure of the captured target object. The target frontal X-ray image obtained by the above method can also greatly improve the efficiency of detection.
[0058] In a feasible implementation, in step 110, identifying the outline of the target object in the X-ray image includes: performing image recognition processing on the X-ray image based on a deep learning-based image recognition algorithm to obtain the outline of the target object in the X-ray image.
[0059] It should be noted that a large number of X-ray images can be used in advance to perform deep learning to extract the contours of objects, thereby obtaining an image recognition algorithm based on deep learning, and then the image recognition algorithm based on deep learning can be used to perform image recognition processing on the X-ray images to obtain the contours of the target objects in the X-ray images.
[0060] In an embodiment of the present application, an X-ray image is subjected to image recognition processing by using an image recognition algorithm based on deep learning to obtain the outline of the target object in the X-ray image, thereby facilitating determination of the X-axis, Y-axis, and Z-axis of the three-dimensional distorted coordinate system according to the outline of the target object, so as to realize correction of the X-ray image taken at an oblique angle to the X-ray image taken at a frontal angle, thereby improving the efficiency of detection, etc.
[0061] In this application, in step 120, the X-axis, Y-axis, and Z-axis of the three-dimensional distorted coordinate system can be determined according to the contour of the target object, that is:
[0062] In a feasible implementation, the X-axis of the three-dimensional distorted coordinate system is determined according to the outline of the target object, including: determining multiple key points on the X-ray image according to the outline of the target object; determining the direction of the front horizontal line according to the multiple key points; and using the direction of the front horizontal line as the X-axis of the three-dimensional distorted coordinate system.
[0063] The multiple key points can be determined manually by marking multiple key points on the X-ray image according to the outline of the target object, and then dividing the multiple key points into two groups by K-means clustering, and the dividing line between the two groups of key points is used as the direction of the front horizontal line. The multiple key points can also be determined by an artificial intelligence algorithm based on deep learning, marking multiple key points on the X-ray image according to the outline of the target object, and then dividing the multiple key points into two groups by K-means clustering, and the dividing line between the two groups of key points is used as the direction of the front horizontal line.
[0064] In an embodiment of the present application, multiple key points on the X-ray image are determined according to the contour of the target object; the direction of the front horizontal line is determined according to the multiple key points; the direction of the front horizontal line is used as the X-axis of the three-dimensional distorted coordinate system, thereby obtaining the X-axis of the three-dimensional distorted coordinate system, which facilitates projection through the three-dimensional distorted coordinate system to obtain a frontal X-ray image, so as to realize the correction of the obliquely shot X-ray image to the frontally shot X-ray image, thereby improving the efficiency of detection, etc.
[0065] In a feasible implementation, the Y-axis of the three-dimensional distorted coordinate system is determined according to the outline of the target object, including: determining multiple key points on the X-ray image according to the outline of the target object; determining the direction of the side horizontal line according to the multiple key points; and using the direction of the side horizontal line as the Y-axis of the three-dimensional distorted coordinate system.
[0066] The multiple key points can be determined manually by marking multiple key points on the X-ray image according to the outline of the target object, and then dividing the multiple key points into two groups by K-means clustering, and the dividing line between the two groups of key points is used as the direction of the lateral horizontal line. The multiple key points can also be determined by an artificial intelligence algorithm based on deep learning, marking multiple key points on the X-ray image according to the outline of the target object, and then dividing the multiple key points into two groups by K-means clustering, and the dividing line between the two groups of key points is used as the direction of the lateral horizontal line.
[0067] In an embodiment of the present application, multiple key points on the X-ray image are determined according to the contour of the target object; the direction of the side horizontal line is determined according to the multiple key points; the direction of the side horizontal line is used as the Y-axis of the three-dimensional distorted coordinate system, thereby obtaining the Y-axis of the three-dimensional distorted coordinate system, which facilitates projection through the three-dimensional distorted coordinate system to obtain a frontal X-ray image, so as to realize the correction of the obliquely shot X-ray image to the frontal shot X-ray image, thereby improving the efficiency of detection, etc.
[0068] In a feasible implementation method, the Z axis of the three-dimensional distorted coordinate system is determined according to the outline of the target object, including: determining multiple key points on the X-ray image according to the outline of the target object; determining the direction of the front vertical line according to the multiple key points; and using the direction of the front vertical line as the Z axis of the three-dimensional distorted coordinate system.
[0069] The determination of multiple key points can be performed manually in an X-ray image, by marking multiple key points on the X-ray image according to the outline of the target object, and then dividing the multiple key points into two groups by a K-means clustering method, with the dividing line between the two groups of key points serving as the front vertical line direction. The determination of multiple key points can also be performed by an artificial intelligence algorithm based on deep learning, by marking multiple key points on the X-ray image according to the outline of the target object, and then dividing the multiple key points into two groups by a K-means clustering method, with the dividing line between the two groups of key points serving as the front vertical line direction.
[0070] In an embodiment of the present application, multiple key points on the X-ray image are determined according to the contour of the target object; the directions of the vertical and horizontal lines are determined according to the multiple key points; and the directions of the vertical and horizontal lines are used as the Z-axis of the three-dimensional distorted coordinate system, thereby obtaining the Z-axis of the three-dimensional distorted coordinate system, which facilitates projection through the three-dimensional distorted coordinate system to obtain a frontal X-ray image, so as to realize the correction of the X-ray image taken at an oblique direction to the X-ray image taken at a frontal direction, thereby improving the efficiency of detection, etc.
[0071] In a feasible implementation method, in step 130, the outline of the target object is geometrically projected according to the three-dimensional distorted coordinate system to obtain a frontal X-ray image of the target object, including: using a geometric transformation algorithm, projecting the outline of the target object in the three-dimensional distorted coordinate system to a two-dimensional distorted coordinate system composed of any two axes of the X-axis, Y-axis, and Z-axis of the three-dimensional distorted coordinate system to obtain a frontal X-ray image of the target object.
[0072] Among them, the geometric transformation algorithm can be an artificial intelligence projection algorithm.
[0073] It should be noted that the outline of the target object in the three-dimensional distorted coordinate system is projected onto a two-dimensional distorted coordinate system composed of any two axes of the X-axis, Y-axis, and Z-axis of the three-dimensional distorted coordinate system, so that the three-dimensional image is projected to obtain a two-dimensional image, which utilizes the projection principle of geometric solids.
[0074] In an embodiment of the present application, a two-dimensional image, i.e., a frontal X-ray image of the target object, is obtained by projecting the outline of the target object in the three-dimensional distorted coordinate system onto a two-dimensional distorted coordinate system composed of any two axes of the X-axis, Y-axis, and Z-axis of the three-dimensional distorted coordinate system. This facilitates obtaining a target frontal X-ray image of the target object through the frontal X-ray image of the target object, so as to correct the X-ray image taken at an oblique angle to an X-ray image taken at the front, thereby improving the efficiency of detection, etc.
[0075] In a feasible implementation, in step 150, a preset number of frontal X-ray images are fitted to obtain a target frontal X-ray image, including: determining the confidence of each confidence region in each frontal X-ray image; combining multiple confidence regions with the highest confidence at the same position in each frontal X-ray image to obtain a target frontal X-ray image.
[0076] It should be noted that before determining the confidence level of each confidence region in each frontal X-ray image, each frontal X-ray image is divided into multiple confidence regions. Specifically, each frontal X-ray image is divided into multiple confidence regions. The number of confidence regions is related to the number of distinct regions of the target object. It is understood that a target object has multiple distinct regions. The more distinct regions there are, the more confidence regions there are. Alternatively, the number of distinct regions can be equal to the number of confidence regions. Furthermore, the confidence level of each confidence region in each frontal X-ray image can be determined by comparing the confidence regions at the same location in a preset number of frontal X-ray images. The confidence level of the confidence region is determined based on the degree of overlap between the comparisons. It is understood that the higher the degree of overlap, the higher the confidence level.
[0077] It should be further explained that the multiple confidence areas with the highest confidence levels in the confidence areas at the same position in each frontal X-ray image are combined, that is, the multiple confidence areas with the highest confidence levels in the confidence areas at the same position in each of a preset number of frontal X-ray images are combined, and the frontal X-ray image obtained by combining the multiple confidence areas is the target frontal X-ray image. For example: if there are 3 frontal X-ray images (the first frontal X-ray image, the second frontal X-ray image, and the third frontal X-ray image), and each number of frontal X-ray images is divided into 2 confidence regions (the first confidence region and the second confidence region), then the multiple confidence regions with the highest confidence in the confidence regions at the same position of the first frontal X-ray image (the confidence of the first confidence region is 3, the confidence of the second confidence region is 10), the second frontal X-ray image (the confidence of the first confidence region is 7, the confidence of the second confidence region is 6), and the third frontal X-ray image (the confidence of the first confidence region is 10, the confidence of the second confidence region is 8) are combined, that is, the second confidence region of the first frontal X-ray image and the first confidence region of the third frontal X-ray image are combined to obtain the target frontal X-ray image.
[0078] In an embodiment of the present application, by determining the confidence level of each confidence area in each frontal X-ray image; combining multiple confidence areas with the highest confidence levels in the same position in each frontal X-ray image to obtain a target frontal X-ray image, it is possible to effectively avoid problems such as the X-ray image being photographed at an oblique angle, which causes the photographed X-ray image to be severely distorted to varying degrees, thereby resulting in unclear display of the structure of the photographed target object, and the obtained target frontal X-ray image can also greatly improve the efficiency of detection.
[0079] In a feasible implementation method, the confidence level of each confidence region in each frontal X-ray image is determined, including: dividing each frontal X-ray image into multiple confidence regions; comparing the confidence regions at the same position in each frontal X-ray image to obtain the overlap of the corresponding confidence regions in each frontal X-ray image; and determining the confidence level of each confidence region in each frontal X-ray image based on the overlap of the confidence regions at the same position in each frontal X-ray image.
[0080] It is understandable that the higher the degree of overlap in the comparison, the higher the confidence level, and the confidence level can be determined based on the comparison result.
[0081] It should be noted that the confidence areas at the same position in each frontal X-ray image are compared to obtain the degree of overlap of the confidence areas at the same position in each frontal X-ray image. The degree of overlap can be determined by comparing the confidence areas at the same position in each frontal X-ray image using an artificial intelligence algorithm.
[0082] In addition, the operator can also manually intervene and adjust the overlap according to actual needs. It can be understood that under normal circumstances, the operator does not need to manually intervene and adjust the overlap. If the operator manually intervenes in the overlap, the overlap value can be made more accurate. At this time, the operator can manually intervene to adjust the overlap.
[0083] In an embodiment of the present application, each frontal X-ray image is divided into multiple confidence regions; the confidence regions at the same position in each frontal X-ray image are compared to obtain the degree of overlap of the confidence regions at the same position in each frontal X-ray image; and the confidence of each confidence region in each frontal X-ray image is determined based on the degree of overlap of the confidence regions at the same position in each frontal X-ray image, so as to obtain a target frontal X-ray image of the target object based on the confidence of each region in each frontal X-ray image, so as to realize the correction of the X-ray image taken at an oblique direction to the X-ray image taken at a frontal direction, thereby improving the efficiency of detection, etc.
[0084] In an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the processor executes an X-ray image correction method in the above method embodiment.
[0085] In one embodiment, a device is proposed, including a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor executes an X-ray image correction method in the above method embodiment.
[0086] Figure 2 FIG1 shows an internal structure diagram of a computer device in an embodiment. The computer device can be a terminal, a server, or a gateway. Figure 2 As shown, the computer device includes a processor, a memory, and a network interface connected via a system bus.
[0087] The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the various steps in the above method embodiment. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can implement the various steps in the above method embodiment. It will be understood by those skilled in the art that Figure 2 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0088] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods.
[0089] Among them, any reference to memory, storage, database or other media used in the various embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0090] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0091] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A method for correcting an X-ray image, characterized in that: The method comprises: Acquire an X-ray image captured at a first shooting angle, and identify a contour of a target object in the X-ray image; Based on manual or deep learning artificial intelligence algorithms, multiple key points corresponding to the X axis, multiple key points corresponding to the Y axis, and multiple key points corresponding to the Z axis are determined according to the contour of the target object, and the X axis, Y axis, and Z axis of the three-dimensional distorted coordinate system are determined based on the multiple key points corresponding to the X axis, the multiple key points corresponding to the Y axis, and the multiple key points corresponding to the Z axis; Performing geometric stereo projection processing on the outline of the target object according to the three-dimensional distorted coordinate system to obtain a frontal X-ray image of the target object; Adjust the shooting angle and repeat the above steps to obtain a preset number of frontal X-ray images; performing fitting processing on the preset number of frontal X-ray images to obtain a target frontal X-ray image; The fitting process is performed on the preset number of frontal X-ray images to obtain a target frontal X-ray image, comprising: determining a confidence level for each confidence region in each frontal X-ray image; The target frontal X-ray image is obtained by combining multiple confidence regions with the highest confidence levels among the confidence regions at the same position in each frontal X-ray image.
2. The method according to claim 1, characterized in that The identifying the contour of the target object in the X-ray image includes: An image recognition algorithm based on deep learning is used to perform image recognition processing on the X-ray image to obtain the outline of the target object in the X-ray image.
3. The method according to claim 1, characterized in that Determining the X-axis of the three-dimensional distorted coordinate system according to the multiple key points corresponding to the X-axis includes: Determine the direction of the front horizontal line according to the plurality of key points; The front horizontal line direction is used as the X-axis of the three-dimensional distorted coordinate system.
4. The method according to claim 1, wherein Determining the Y axis of the three-dimensional distorted coordinate system according to the multiple key points corresponding to the Y axis includes: Determine the direction of the side horizontal line according to the multiple key points; The side horizontal line direction is used as the Y axis of the three-dimensional distorted coordinate system.
5. The method according to claim 1, wherein Determining the Z axis of the three-dimensional distorted coordinate system according to the multiple key points corresponding to the Z axis includes: Determine the direction of the front vertical line according to the plurality of key points; The front vertical line direction is used as the Z axis of the three-dimensional distorted coordinate system.
6. The method according to claim 1, characterized in that The step of performing geometric stereo projection processing on the contour of the target object according to the three-dimensional distorted coordinate system to obtain a frontal X-ray image of the target object includes: Through a geometric transformation algorithm, the outline of the target object in the three-dimensional distorted coordinate system is projected onto a two-dimensional distorted coordinate system consisting of any two axes of the X-axis, Y-axis, and Z-axis of the three-dimensional distorted coordinate system to obtain a frontal X-ray image of the target object.
7. The method according to claim 1, characterized in that Determining the confidence level of each confidence region in each frontal X-ray image comprises: Divide each frontal X-ray image into a plurality of confidence regions; Comparing the confidence regions at the same position in each frontal X-ray image to obtain the overlap of the corresponding confidence regions in each frontal X-ray image; The confidence level of each confidence region in each frontal X-ray image is determined according to the overlap level of the confidence regions at the same position in each frontal X-ray image.
8. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Tool setting method of mechanical arm feeding type laser etching system
CN111604598A
Geometric distortion correction device, projector, and geometric distortion correction method
JP2014134611A