Intelligent Calculation Method and System for Spatial Resolution of X-ray Digital Images
By employing an intelligent method for calculating the spatial resolution of X-ray digital images, utilizing image quality meter specification matching and a template image library, the spatial resolution is automatically calculated. This solves the problems of large errors and low efficiency in manual operation in existing technologies, achieving high-precision and high-efficiency spatial resolution calculation.
Patent Information
- Application Number
- CN202310096117.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-07
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2043-02-07
AI Technical Summary
In existing X-ray inspection technologies, the calculation of spatial resolution of X-ray digital images relies on manual operation, which has large errors and low efficiency. Moreover, existing methods cannot fully solve the problems of line drawing errors, finding extreme points of line pairs, gray-scale segmentation of line pairs and background, and the accuracy and reliability of spatial resolution calculation.
An intelligent method is adopted to generate target images through X-ray detectors, calculate homography matrix by matching image quality indicators with template image library, project and map line pairs and extreme points in template images to construct continuous relationship curves, automatically calculate spatial resolution, and integrate character recognition, text matching and feature point matching algorithms to reduce human error.
It achieves high-precision, automated calculations without human intervention, improves the accuracy of spatial resolution and computational efficiency, has good transferability and robustness, and reduces algorithm complexity.
Smart Images

Figure CN116223538B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of nondestructive testing technology, specifically to an intelligent calculation method and system for spatial resolution of X-ray digital images. Background Technology
[0002] X-ray inspection technology is a non-destructive testing technique that uses radiation detectors to perform X-ray imaging. It is widely used in the inspection of the internal quality of structural components in industries such as aviation, aerospace, shipbuilding, vehicles, and special equipment. It is an important guarantee for the quality and safety of structural components. The spatial resolution of X-ray images is an important indicator of the inspection capability of a X-ray inspection system, characterizing the ability of the imaging results to resolve details. For the inspection of structural components with different quality requirements, X-ray imaging systems with corresponding detail resolution capabilities must be selected to ensure the reliability of the inspection results. Therefore, the measurement and calculation of the spatial resolution of X-ray images is a crucial part of X-ray inspection technology and plays an important role in the analysis of the inspection system's capabilities.
[0003] Currently, most mainstream nondestructive testing imaging software used in the field of X-ray inspection has the function of measuring and calculating the spatial resolution of X-ray digital images. This software requires operators to have high levels of professional skills and manual operation ability: First, the operator visually identifies the specifications, type, number of line pairs, location of the image quality meter, and length and width directions of the line pairs in the image to be measured. Second, in the software's image operation area, the operator selects a point in the image range formed by the intersection of the image quality meter's central area and the outer edge of the D1 line. A straight line perpendicular to the length of the line pair is then drawn towards the last line pair, with the endpoint of the line selected within the image range formed by the intersection of the image quality meter's central area and the outer edge of the last line pair. The software uses the manually drawn line as its starting point, reads the grayscale values of the line pixel by pixel, and displays the grayscale value change curve of the image quality meter line pairs and the calculated modulation value on the software interface. Finally, the operator manually clicks the spatial resolution calculation button to obtain the calculated spatial resolution result. However, the quality of manual line drawing is difficult to guarantee effectively. Problems such as lines not being perpendicular to the length of the line pair, incorrect line direction, lines being too long and introducing interference with grayscale features, and lines being too short and not spanning all line pairs have long existed. As a result, the accuracy and reliability of spatial resolution measurement fluctuate. It requires repeated and careful manual adjustment of the line drawing area and direction, resulting in low measurement efficiency. This further forces the workshop to rely on experienced and meticulous employees to complete this task.
[0004] To address the problems and drawbacks of the traditional operating methods mentioned above, existing patents and papers discuss and research topics such as spatial resolution measurement or bilinear image quality meter (BIM) recognition rate measurement, proposing various solutions. In-depth comparative analysis reveals that none of these solutions have revolutionized the traditional manual line drawing operation mode. They are mostly based on manual line drawing, proposing various analysis and optimization schemes for the grayscale value change curve generated by the line drawing. However, because various accuracy errors generated by manual line drawing are already introduced before the grayscale value change curve is generated, subsequent optimization inevitably has objective limitations. Furthermore, these methods still exhibit shortcomings such as limited accuracy and weak reliability, specifically manifested in the following four aspects:
[0005] (1) Line drawing error judgment and correction: Existing methods use image segmentation schemes such as edge detection and morphological processing to address the difficulty of image location in the image quality indicator; to address the problem of reversed line drawing direction in the image quality indicator, a scheme is proposed to adjust the direction by comparing the sum of the gray values in the first and second halves of the gray value change curve; to address the difficulty of drawing perpendicular lines along the length direction, an image affine method or a scheme to calculate the average gradient of the image is used to rotate the image quality indicator image to a vertical state; to address the problem of incorrectly selecting other non-image quality indicator regions for line drawing, a method of filtering by setting a threshold for the rate of change of gray value neighborhood is used. Each solution to the problem has a certain computational complexity, but it can only address a single problem. If all the above solutions are combined to solve the problem comprehensively, the algorithm complexity will be too high after superposition.
[0006] (2) Line-pair extreme point search: Two methods are proposed based on the gray value change curve of the image quality meter: (a) Manually set the highest / lowest gray value threshold, gray value neighborhood change rate threshold, or neighborhood window pixel width, and compare gray values of each curve pixel to judge multiple conditions: the current pixel is the maximum / minimum gray value of the left and right neighbors of the window, the gray value change rate of the neighborhood window is less than the gray value neighborhood change rate threshold, the gray value difference between adjacent candidate pixels is less than the gray difference threshold, etc., and the current pixel is identified as an extreme point candidate only when all three conditions are met; (b) Use the second difference of adjacent gray values and compare gray values of each curve pixel to determine the maximum / minimum value point. Both methods have obvious shortcomings: (a) The reliability of the method depends heavily on the correctness of the manual line drawing operation. If the line is mistakenly drawn by selecting continuous characters or other irrelevant content within the image, the curve will introduce an additional curve segment with approximate line pair grayscale change characteristics. At this time, both methods will determine that the curve segment has a line pair extreme point, thus producing a misjudgment; (b) The effectiveness of the two methods is highly dependent on the accuracy of the human threshold setting. If the threshold is too small, the calculation efficiency will decrease, and if it is too high, it may produce a misjudgment and interfere with the correct calculation.
[0007] (3) Interval segmentation of line pairs and background grayscale: This is mainly achieved through various methods such as the conversion of the object-to-image ratio of the calibrated image quality meter, fixed width segmentation, combination of minimum value and morphological features, and combination of sliding window and dynamic threshold. However, the overall performance of each method is poor. For example, the accuracy depends on the correctness of manual line drawing and human threshold setting. When measuring image quality of different standard specifications, the threshold needs to be reset and the effectiveness needs to be tested. The transferability and scalability are poor, and it is difficult to balance the algorithm complexity and computational efficiency.
[0008] (4) Spatial resolution calculation: Existing methods mostly calculate spatial resolution based on the gray value variation curve of a single pixel width. However, due to the influence of factors such as the placement and angle of the image quality indicator during the imaging process, the gray values at different lengths of the same line pair are different, and the background gray values of the left and right neighbors of the line pair also have mutual deviations. Therefore, the modulation obtained by simply relying on a single line drawing has a certain degree of randomness and is difficult to fully characterize the actual modulation of the image quality indicator line pair. Consequently, the obtained basic spatial resolution of the detector and the spatial resolution of the image also lack high confidence.
[0009] Therefore, based on the above analysis, in order to meet the industry application requirements for high-precision and high-efficiency X-ray inspection system detection capabilities and the technological development trend of intelligent upgrading of X-ray inspection technology, it is urgent to explore an intelligent method and system for calculating the spatial resolution of X-ray digital images. Summary of the Invention
[0010] To address the shortcomings of existing technologies, the purpose of this invention is to provide an intelligent calculation method and system for the spatial resolution of X-ray digital images.
[0011] A method for intelligent calculation of spatial resolution of X-ray digital images according to the present invention includes:
[0012] Step S1: Generate a target image by performing dual-line image quality meter X-ray imaging using an X-ray detector;
[0013] Step S2: Perform image quality meter specification matching on the target image and retrieve a template image of the same specification;
[0014] Step S3: Calculate the homography matrix between the template image and the target image;
[0015] Step S4: Combine the extreme points of each line pair of the image quality meter in the projection mapping template image, and calculate the average modulation index of all line pairs of the image quality meter in the target image.
[0016] Step S5: Construct a continuous relationship curve corresponding to the wire diameter of the average modulation, thereby obtaining the spatial resolution of the X-ray digital image.
[0017] Preferably, the image quality meter specification matching includes string recognition and image quality meter specification field extraction of the target image, and traversing and matching each image quality meter specification text in the image quality meter template image library;
[0018] The spatial resolution includes the detector's basic spatial resolution and the image spatial resolution;
[0019] The calculation process and results can be displayed according to user settings.
[0020] Preferably, step S3 includes:
[0021] Step S3.1: Construct the template image corner point set E1, the target image corner point set E2, the template image thread vector set V1, and the target image thread vector set V2 corresponding to set V1;
[0022] Step S3.2: Select one vector from the target image thread vector set V2 as the comparison vector, and filter the comparison vector and other vectors in the current set one by one;
[0023] Step S3.3: Calculate the current screening pass rate and determine whether the screening pass rate is greater than the threshold. If yes, set the current comparison vector as the reference vector of set V2; if no, reselect the comparison vector and trigger step S3.2.
[0024] Step S3.4: Retain all vectors in set V2 that can be combined with the reference vector to pass the screening, remove the remaining vectors in set V2 that failed the screening and the vectors in set V1 that have a corresponding relationship with them, and then remove all mismatched corner points in corner point sets E1 and E2 that correspond to the removed vectors, and finally form the correctly paired corner point sets E1′ and E2′.
[0025] Preferably, the formula for calculating the screening pass rate is as follows:
[0026] Screening pass rate = (Number of screen passes / Total number of screening decisions) × 100%
[0027] The selection criteria include that the vector being compared and all other vectors in the set are non-zero vectors, the angle between the two vectors is less than 1 degree, and the ratio of the magnitudes of the two vectors is greater than 0.95 and less than 1.05. When all the selection criteria are met, it is recorded as passing the selection once; otherwise, if any criterion is not met, it is recorded as passing the selection once.
[0028] Preferably, the combination of line pair extreme points includes 5 types of line pair extreme points, namely, the first gray-level minimum point, the second gray-level minimum point, the gray-level maximum point, the first background gray-level point, and the second background gray-level point;
[0029] The first grayscale minimum point refers to the pixel point with the smallest grayscale value of one of the threads in the line pair within the width direction of the line pair at the current length point;
[0030] The second minimum gray value point refers to the pixel point with the smallest gray value of the other thread in the line pair within the width direction of the line pair at the current length point.
[0031] The grayscale maximum point refers to the pixel point with the largest grayscale value along the width direction in the area between the two wires of the line pair at the current length point.
[0032] The first background gray value point refers to the image position point when the first gray value point is deviated from the line pair direction by 8 pixels along the width and away from the line pair direction, with the first gray value point as the reference point, at the current length of the line pair.
[0033] The second background gray value point refers to the image position point that is 8 pixels away from the line pair direction along the width, with the second gray value point as the reference point, at the current length of the line pair.
[0034] The template image line pair extreme point combination is used to obtain the pixel position of each line pair extreme point combination of the target image image quality meter through homography matrix projection mapping;
[0035] The combination of all line pair extreme points at each length point in the effective calculation area of the target image quality meter is used to calculate the corresponding line pair toning regime.
[0036] Preferably, step S4 includes:
[0037] Step S4.1: Obtain the initial pixel positions of the five types of extreme points at each length point within the preset effective calculation area;
[0038] Step S4.2: Using the current initial pixel position as the center point, perform local neighborhood grayscale extreme value relocation along the line for the N pixels before and after it in the width direction;
[0039] Step S4.3: Determine the actual pixel position and gray value of all line pairs' five types of extreme points at each length point in the effective calculation area, and then obtain the corresponding line pair toggle system.
[0040] An intelligent calculation system for spatial resolution of X-ray digital images according to the present invention includes a radiation detector, an image quality meter template image library, an image acquisition module, an image quality meter pairing module, a corner matching module, a modulation calculation module, a relationship curve construction module, and a calculation process display module.
[0041] The image acquisition module calls the X-ray detector to perform bilinear image quality meter X-ray imaging to generate a target image.
[0042] The image quality meter matching module performs image quality meter specification matching on the target image and retrieves a template image of the same specification.
[0043] The corner matching module calculates the homography matrix between the template image and the target image;
[0044] The modulation calculation module projects the extreme point combination of each line pair of the image quality meter in the template image and calculates the average modulation of all line pairs of the image quality meter in the target image.
[0045] The relationship curve construction module constructs a continuous relationship curve corresponding to the wire diameter of the average modulation, thereby obtaining the spatial resolution of the X-ray digital image. At the same time, the calculation process display module displays all calculation processes and results.
[0046] Preferably, the image quality meter specification matching includes string recognition and image quality meter specification field extraction of the target image, and traversing and matching each image quality meter specification text in the image quality meter template image library;
[0047] The spatial resolution includes the detector's basic spatial resolution and the image spatial resolution;
[0048] The calculation process and results can be displayed according to user settings.
[0049] Preferably, the corner matching module calculates the homography matrix between the template image and the target image by:
[0050] Module M3.1: Constructs a set of corner points of the template image E1, a set of corner points of the target image E2, a set of thread vectors of the template image V1, and a set of thread vectors of the target image V2 corresponding to set V1;
[0051] Module M3.2: Select one vector from the target image thread vector set V2 as the comparison vector, and filter the comparison vector and other vectors in the current set one by one;
[0052] Module M3.3: Calculates the current screening pass rate and determines whether the screening pass rate is greater than the threshold. If so, the current comparison vector is set as the reference vector of set V2. If not, the comparison vector is reselected and module M3.2 is triggered.
[0053] Module M3.4: Retain all vectors in set V2 that can be combined with the baseline vector and pass the screening, remove the remaining vectors in set V2 that failed the screening and the vectors in set V1 that have a corresponding relationship with them, and then remove all mismatched corner points in corner point sets E1 and E2 that correspond to the removed vectors, and finally form the correctly paired corner point sets E1′ and E2′.
[0054] The formula for calculating the screening pass rate is as follows:
[0055] Screening pass rate = (Number of screen passes / Total number of screening decisions) × 100%
[0056] The selection criteria include that the vector being compared and all other vectors in the set are non-zero vectors, the angle between the two vectors is less than 1 degree, and the ratio of the magnitudes of the two vectors is greater than 0.95 and less than 1.05. When all the selection criteria are met, it is recorded as passing the selection once; otherwise, if any criterion is not met, it is recorded as passing the selection once.
[0057] Preferably, the calculation of the average modulation depth of all line pairs of the target image quality meter includes:
[0058] Module M4.1: Obtain the initial pixel positions of five types of extreme points at each length point within the preset valid calculation area;
[0059] Module M4.2: Using the current initial pixel position as the center point, perform local neighborhood grayscale extreme value relocation along the line for the N pixels before and after it in the width direction;
[0060] Module M4.3: Determines the actual pixel position and gray value of all line pairs' five types of extreme points at each length point in the effective calculation area, and then obtains the corresponding line pair interpolation regime;
[0061] The five types of line pairs have extreme points, namely the first gray-level minimum point, the second gray-level minimum point, the gray-level maximum point, the first background gray-level point, and the second background gray-level point.
[0062] The first grayscale minimum point refers to the pixel point with the smallest grayscale value of one of the threads in the line pair within the width direction of the line pair at the current length point;
[0063] The second minimum gray value point refers to the pixel point with the smallest gray value of the other thread in the line pair within the width direction of the line pair at the current length point.
[0064] The grayscale maximum point refers to the pixel point with the largest grayscale value along the width direction in the area between the two wires of the line pair at the current length point.
[0065] The first background gray value point refers to the image position point when the first gray value point is deviated from the line pair direction by 8 pixels along the width and away from the line pair direction, with the first gray value point as the reference point, at the current length of the line pair.
[0066] The second background gray value point refers to the image position point that is 8 pixels away from the line pair direction along the width, with the second gray value point as the reference point, at the current length of the line pair.
[0067] The template image line pair extreme point combination is used to obtain the pixel position of each line pair extreme point combination of the target image image quality meter through homography matrix projection mapping;
[0068] The combination of all line pair extreme points at each length point in the effective calculation area of the target image quality meter is used to calculate the corresponding line pair toning regime.
[0069] Compared with the prior art, the present invention has the following beneficial effects:
[0070] 1. This invention integrates and applies technologies such as character recognition, text matching, feature point matching, and polynomial curve fitting. It also creatively proposes corner point screening algorithm and line pair extreme point positioning algorithm for the image characteristics of bilinear image quality meters. It can actively identify and match different standard specification image quality meter types, eliminate manual operation in the calculation process, get rid of human error factors, and automatically calculate and output accurate spatial resolution results, filling the gap in intelligent calculation of spatial resolution of X-ray digital images.
[0071] 2. This invention employs a combination of feature point matching and corner point filtering algorithms to accurately acquire the image position, length and width direction of the image quality meter and its line pairs, as well as the pixel positions of the extreme point combinations of the line pairs. A line pair extreme point localization algorithm is used to accurately locate the extreme points of each line pair at each length point within the effective calculation area. This "global + local" secondary localization method achieves precise determination of the extreme points of each line pair of the image quality meter, thereby ensuring high accuracy of the calculation parameters.
[0072] 3. This invention selects 60% of the central region along the length direction of the image quality meter as the effective calculation area, and calculates and statistically analyzes the average modulation index of all line pairs within the effective calculation area. Furthermore, it employs a polynomial curve fitting method to construct a continuous relationship curve function between the average modulation index of each line pair and its corresponding wire diameter, which significantly improves the precision of the calculation process and effectively enhances the confidence level of spatial resolution calculation.
[0073] 4. The image quality meter template image library designed in this invention stores various international and national standard specifications of dual-line image quality meter grayscale template images, ensuring that this invention has good transferability and scalability.
[0074] 5. This invention utilizes the image characteristics of a bilinear image quality meter to design a corner point screening algorithm and a line pair extreme point localization algorithm. It abandons the traditional image feature screening and localization algorithms with high algorithm complexity, and obtains better computational performance with lower algorithm complexity and computational load, effectively improving computational efficiency.
[0075] 6. The feature point matching algorithm used in this invention has good rotation invariance and noise invariance. The matching effect will not be affected by changes in image quality due to translation, rotation, or imaging grayscale, and it has strong robustness. Attached Figure Description
[0076] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0077] Figure 1 This is a diagram showing the components of the intelligent computing system for spatial resolution of X-ray digital images according to the present invention.
[0078] Figure 2 This is a schematic diagram of the template image of the bilinear image quality meter of the present invention and its associated data.
[0079] Figure 3 This is a flowchart illustrating the intelligent calculation method for spatial resolution of X-ray digital images according to the present invention.
[0080] Figure 4 This is a schematic diagram of the target image after imaging by the bilinear image quality meter of the present invention.
[0081] Figure 5 This is a flowchart illustrating the corner selection algorithm of the present invention.
[0082] Figure 6 This is a schematic diagram showing the distribution and sorting of corner points and thread vectors of each line pair in the template image in the corner point filtering algorithm of this invention.
[0083] Figure 7 This is a schematic diagram illustrating the sorting of the distribution of corner points and line vectors of each line in the target image after matching in the corner point filtering algorithm of this invention.
[0084] Figure 8 This is a flowchart illustrating the extreme point localization algorithm for line pairs in this invention.
[0085] Figure 9 This is a schematic diagram of the relocation of five types of extreme points for each line pair and the change curve of their gray values in the line-pair extreme point localization algorithm of this invention.
[0086] Figure 10 This is a schematic diagram illustrating the continuous relationship between the average modulation intensity of the line pair and the wire diameter, as well as a case study of solving the spatial resolution problem. Detailed Implementation
[0087] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.
[0088] Example 1
[0089] According to the present invention, an intelligent calculation method for spatial resolution of X-ray digital images is provided, such as... Figure 3 As shown, it includes:
[0090] Step S1: Generate a target image using a dual-line image quality meter X-ray imaging system with a X-ray detector, as shown below. Figure 4 As shown, the target image is saved to the storage location specified by the user.
[0091] Step S2: Perform image quality meter specification matching on the target image and retrieve template images of the same specification. Image quality meter specification matching includes string recognition and image quality meter specification field extraction on the target image, and iterating through and matching each image quality meter specification text in the image quality meter template image library. The recognition and extraction are implemented using OCR technology. Specifically, such as... Figure 2 As shown, the image quality meter template image library is used to store grayscale template images of bilinear image quality meters in various international and national standard specifications such as ISO, EN, ASTM, and GB, as well as the corresponding image quality meter specification text, the extreme point combination of each line pair at both ends of the length direction, and the wire diameter of each line pair.
[0092] Step S3: Calculate the homography matrix between the template image and the target image. For example... Figure 5 As shown, it includes the following sub-steps:
[0093] First, a set of corner points E1 for the template image, a set of corner points E2 for the target image, a set of line vectors V1 for the template image, and a set of line vectors V2 for the target image corresponding to set V1 are constructed. Specifically, the Shi-Tomas algorithm is used to extract the corner features of line pairs D1 to D6 in the template image and the target image, respectively, and the BRIEF descriptor of each corner feature is calculated, thereby constructing the set of corner points E1 for the template image and the set of corner points E2 for the target image.
[0094] Then, a corner point filtering algorithm is used to remove mismatched corner points. Specifically, the algorithm utilizes the characteristic of the sequential arrangement of line pairs (D1 to D6) in the image quality meter to calculate the hierarchical correspondence between each corner point in the template image corner point set E1 and each line pair. Line vectors are created using the corner points on the same side of the line, with all line vectors pointing in the same direction. This further constructs a line vector set V1, where the order of vectors corresponds to the line pair order (D1 to D6). The results are as follows: Figure 6 As shown; then, based on the point-to-point pre-matching relationship between the corner point sets E1 and E2 of the two images, and following the vector creation order of the thread vector set V1, a thread vector set V2 corresponding one-to-one with set V1 is created using the corner point set E2 of the target image. The result is as follows. Figure 7 As shown.
[0095] Next, the process of identifying and filtering mismatched corner points is performed. Specifically, a vector from the target image thread vector set V2 is selected as the comparison vector, and this comparison vector is paired with other vectors in the current set one by one for filtering. Then, the current filtering pass rate is calculated, and it is determined whether the pass rate is greater than a threshold. If so, the current comparison vector is set as the reference vector of set V2; otherwise, new comparison vectors are selected sequentially according to the vector order in set V2, and the filtering steps are repeated. The formula for calculating the filtering pass rate is as follows:
[0096] Screening pass rate = (Number of screen passes / Total number of screening decisions) × 100%
[0097] The selection criteria include that the vector being compared and all other vectors in the set are non-zero vectors, the angle between the two vectors is less than 1 degree, and the ratio of the magnitudes of the two vectors is greater than 0.95 and less than 1.05. When all the selection criteria are met, it is recorded as passing the selection once; otherwise, if any criterion is not met, it is recorded as passing the selection once.
[0098] In addition, if all vectors have been used as comparison vectors but the screening pass rate still does not exceed the threshold, the screening pass rate threshold will be lowered by a certain percentage, such as 5%, and the above-mentioned mismatched corner point judgment and screening steps will be restarted until the base vector of set V2 is generated.
[0099] Finally, after obtaining the baseline vector, retain all vectors in set V2 that can be combined with the baseline vector and pass the screening. Remove the remaining vectors in set V2 that failed the screening, as well as the vectors in set V1 that have a corresponding relationship with them. Then, remove all mismatched corner points in corner sets E1 and E2 that correspond to the removed vectors, ultimately forming correctly paired corner sets E1′ and E2′. Specifically, as follows... Figure 6 , Figure 7 As shown, in this implementation case, the mismatched corner points that do not meet the judgment conditions and need to be eliminated are m in set E1. 17 m 18 m 27 m 28 m 29 m 30 m 37 m 38 m 43 m 44 Equiangular points, n in set E2 17 n 18 n 27 n 28 n 29 n 30 n 37 n 38 n 43 n 44Isogonal points. After screening and determination, a set of correctly paired corner points E1′ and E2′ is formed, and the homography matrix between the template image and the target image is calculated.
[0100] Step S4: Combine the extreme points of each line pair of the image quality meter in the projected template image, and calculate the average modulation index of all line pairs of the image quality meter in the target image. For example... Figure 2 As shown, the line pair extreme point combination includes five types of line pair extreme points: the first gray-level minimum point, the second gray-level minimum point, the gray-level maximum point, the first background gray-level point, and the second background gray-level point. The first gray-level minimum point refers to the pixel with the smallest gray-level value of one of the lines within the width direction of the line pair at the current length of the line pair. The second gray-level minimum point refers to the pixel with the smallest gray-level value of the other line within the width direction of the line pair at the current length of the line pair. The gray-level maximum point refers to the pixel with the largest gray-level value along the width direction in the area between the two lines of the line pair at the current length of the line pair. The first background gray-level point refers to the image position point at the current length of the line pair, deviating 8 pixels from the first gray-level minimum point along the width direction away from the line pair. The second background gray-level point refers to the image position point at the current length of the line pair, deviating 8 pixels from the second gray-level minimum point along the width direction away from the line pair. The specific pixel positions of the extreme point combinations of each line pair at both ends of the length direction in the template image are obtained through testing, marked, and fixed. Their purpose is to obtain the pixel positions of each line pair extreme point combination of the target image quality meter through homography matrix projection mapping. All line pair extreme point combinations at each length point in the effective calculation area of the target image quality meter are used to calculate the corresponding line pair toning degree. Step S4 includes:
[0101] Step S4.1: Obtain the initial pixel positions of the five types of extreme points at each length point within the preset effective calculation area. Specifically, read the extreme point combinations of each line pair at both ends of the image quality meter along the length direction of the template image in the image quality meter template image library, and use the homography matrix calculated by the corner matching module for projection mapping to calculate and obtain the corresponding pixel positions of each line pair extreme point combination at both ends of the image quality meter along the length direction in the target image. The actual pixel positions and grayscale values of the five types of extreme points at each length point for all line pairs within the effective calculation area are determined using the line pair extreme point localization algorithm. The specific implementation method is as follows: Figure 8 As shown, based on the pixel positions of the five types of extreme points of all line pairs in the target image at both ends of the length direction, the initial pixel positions of the five types of extreme points at each length point in the effective calculation area are obtained by traversing the pixel positions of the straight lines connected at both ends.
[0102] Step S4.2: Using the current initial pixel position as the center point, perform local neighborhood grayscale extreme value relocation along the line for the N pixels before and after it in the width direction.
[0103] Step S4.3: Determine the actual pixel location and grayscale value of all line pairs' five types of extreme points at each length point in the effective calculation area, thereby obtaining the corresponding line pair interpolation regime. For example, the effective calculation area is defined as 60% of the central region along the length direction of the target image's image quality indicator. The method for determining the actual pixel location and grayscale value of all line pairs' five types of extreme points at each length point in the effective calculation area can be based on grayscale extreme value relocation rules, specifically including the following:
[0104] For the first and second minimum grayscale points: select the pixel with the smallest grayscale value in the local neighborhood; for the maximum grayscale points: select the pixel with the largest grayscale value in the local neighborhood; for the first and second background grayscale points: the pixel position remains unchanged, and the background grayscale value is updated to the average grayscale value of all pixels in the local neighborhood; for line pairs D1-D6, N is 2, and for the other line pairs, N is 1.
[0105] Specifically, such as Figure 9 As shown in the figure, D i Line pairs represent image quality meter D1D 13 For the i-th line pair (i≤6 in the figure), within the effective calculation area of 60% of the central region along the image quality meter length direction, a i b i c i p i q i These are the first minimum grayscale point, the second minimum grayscale point, the maximum grayscale point, the first background grayscale point, and the second background grayscale point, determined by the line-pair extreme point localization algorithm at length point l. The grayscale values at these points are I, respectively. ai I bi I ci I pi I qi Then the D i The calculation of the pair interleaving regime at length point l is as follows:
[0106] Dip Di(l) =[1-(I pi +I qi -2I ci ) / (I pi +I qi -I ai -I bi )]×100%
[0107] Furthermore, if the D i If the total number of pixels along the length direction within the effective calculation area of a line pair is k, then D i The average modulation index of the line pair is calculated as follows:
[0108] AvgDipDi =∑Dip Di(l) / k
[0109] Similarly, the image quality meter values D1 to D2 can be calculated by following the steps described above. 13 The average adjustment system of each line pair.
[0110] Step S5: Construct a continuous relationship curve corresponding to the wire diameter of the average modulation index, thereby obtaining the spatial resolution of the X-ray digital image, and simultaneously displaying all calculation processes and results. Spatial resolution includes the detector's basic spatial resolution and the image's spatial resolution. The display content of the calculation process and results can be customized according to user settings. The display terminal carrier includes, but is not limited to, hardware devices such as computers, tablets, mobile phones, and LCD screens. The display content includes, but is not limited to, the target image and template image, the diagonal points of each line pair of the image quality meter after matching and filtering, the extreme point combinations of each line pair of the image quality meter after projection mapping, the average modulation index of each line pair of the image quality meter and its corresponding grayscale value change curve, the continuous relationship curve between the average modulation index of the image quality meter line pair and the wire diameter, and the spatial resolution calculation results. In other words, the relationship curve construction module uses a polynomial curve fitting method to construct a continuous relationship curve function between the average modulation index of each line pair and its corresponding wire diameter for the target image image quality meter line pair calculated and output by the modulation index calculation module, and the wire diameter of each line pair of the template image quality meter in the image quality meter template image library.
[0111] Specifically, such as Figure 10 As shown, the wire diameter value of the wire pair when the average modulation degree of the wire pair is 20% is obtained based on the continuous relationship curve, and the result is 116 μm. Therefore, after intelligent judgment and precise calculation by the intelligent calculation method of X-ray digital image spatial resolution, the spatial resolution calculation result is 116 μm.
[0112] Example 2
[0113] The present invention also provides an intelligent calculation system for the spatial resolution of X-ray digital images. Those skilled in the art can implement the intelligent calculation system for the spatial resolution of X-ray digital images by executing the steps of the method. That is, the method for the intelligent calculation of the spatial resolution of X-ray digital images can be understood as a preferred embodiment of the intelligent calculation system for the spatial resolution of X-ray digital images.
[0114] According to the present invention, an intelligent computing system for spatial resolution of X-ray digital images is provided, such as... Figure 1 As shown, it includes a radiation detector, an image quality meter template image library, an image acquisition module, an image quality meter pairing module, a corner matching module, a modulation calculation module, a relationship curve construction module, and a calculation process display module:
[0115] The image acquisition module calls the X-ray detector to perform X-ray imaging with a dual-line image quality meter to generate a target image. The image quality meter pairing module matches the target image with the image quality meter specifications and retrieves a template image of the same specifications. The corner matching module calculates the homography matrix between the template image and the target image. The modulation calculation module projects the extreme point combination of each line pair of the image quality meter in the template image and calculates the average modulation of all line pairs of the image quality meter in the target image. The relationship curve construction module constructs a continuous relationship curve corresponding to the wire diameter of the average modulation of the line pair, thereby obtaining the spatial resolution of the X-ray digital image. At the same time, the calculation process display module displays all calculation processes and results.
[0116] The image quality meter specification matching process includes string recognition and image quality meter specification field extraction of the target image, and iterating through and matching each image quality meter specification text in the image quality meter template image library. Spatial resolution includes the detector's basic spatial resolution and the image's spatial resolution. The calculation process and results can be displayed according to user settings.
[0117] Specifically, the corner matching module calculates the homography matrix between the template image and the target image by:
[0118] Module M3.1: Constructs a set of corner points of the template image E1, a set of corner points of the target image E2, a set of thread vectors of the template image V1, and a set of thread vectors of the target image V2 corresponding to set V1.
[0119] Module M3.2: Select one vector from the target image thread vector set V2 as the comparison vector, and filter the comparison vector and other vectors in the current set one by one.
[0120] Module M3.3: Calculates the current screening pass rate and determines whether the pass rate is greater than a threshold. If so, it sets the current comparison vector as the baseline vector of set V2; otherwise, it reselects the comparison vector and triggers module M3.2. The formula for calculating the screening pass rate is as follows:
[0121] Screening pass rate = (Number of screen passes / Total number of screening decisions) × 100%
[0122] The selection criteria include that the vector being compared and all other vectors in the set are non-zero vectors, the angle between the two vectors is less than 1 degree, and the ratio of the magnitudes of the two vectors is greater than 0.95 and less than 1.05. When all the selection criteria are met, it is recorded as passing the selection once; otherwise, if any criterion is not met, it is recorded as passing the selection once.
[0123] Module M3.4: Retain all vectors in set V2 that can be combined with the reference vector and pass the screening, remove the remaining vectors in set V2 that failed the screening and the vectors in set V1 that have a corresponding relationship with them, and then remove all mismatched corner points in corner point sets E1 and E2 that correspond to the removed vectors, and finally form the correctly paired corner point sets E1′ and E2′.
[0124] Specifically, calculating the average modulation degree of all line pairs in the target image image quality meter includes: obtaining the initial pixel positions of five types of extreme points at each length point within a preset effective calculation area; relocating the gray-level extremes of the local neighborhood of N pixels before and after the current initial pixel position as the center point along the width direction of the line pair; determining the actual pixel positions and gray-level values of the five types of extreme points of all line pairs at each length point in the effective calculation area, thereby obtaining the corresponding line pair modulation degree.
[0125] Among them, the extreme points of the five line pairs are the first gray-level minimum point, the second gray-level minimum point, the gray-level maximum point, the first background gray-level point, and the second background gray-level point.
[0126] The first grayscale minimum point refers to the pixel with the smallest grayscale value for one of the threads in the line pair at the current length of the line pair, within the width direction of the line pair itself. The second grayscale minimum point refers to the pixel with the smallest grayscale value for the other thread in the line pair at the current length of the line pair, within the width direction of the line pair itself. The grayscale maximum point refers to the pixel with the largest grayscale value along the width direction in the area between the two threads of the line pair at the current length of the line pair. The first background grayscale point refers to the image position point at the current length of the line pair, deviating 8 pixels from the first grayscale minimum point as a reference point along the width direction away from the line pair. The second background grayscale point refers to the image position point at the current length of the line pair, deviating 8 pixels from the second grayscale minimum point as a reference point along the width direction away from the line pair. The template image line pair extreme point combination is used to obtain the pixel positions of each line pair extreme point combination of the target image image quality meter through homography matrix projection mapping. The combination of all line pair extreme points at each length point in the effective calculation area of the target image quality meter is used to calculate the corresponding line pair toning regime.
[0127] Those skilled in the art will understand that, in addition to implementing the system, apparatus, and their modules provided by this invention in purely computer-readable program code, the same program can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system, apparatus, and their modules provided by this invention can be considered a hardware component, and the modules included therein for implementing various programs can also be considered structures within the hardware component; alternatively, modules for implementing various functions can be considered both software programs implementing the method and structures within the hardware component.
[0128] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.
Claims
1. A method for intelligent calculation of spatial resolution of X-ray digital images, characterized in that, include: Step S1: Generate a target image by performing dual-line image quality meter X-ray imaging using an X-ray detector; Step S2: Perform image quality meter specification matching on the target image and retrieve a template image of the same specification; Step S3: Calculate the homography matrix between the template image and the target image; Step S4: Combine the extreme points of each line pair of the image quality meter in the projection mapping template image, and calculate the average modulation index of all line pairs of the image quality meter in the target image. Step S5: Construct a continuous relationship curve corresponding to the wire diameter of the average modulation, thereby obtaining the spatial resolution of the X-ray digital image.
2. The intelligent calculation method for spatial resolution of X-ray digital images according to claim 1, characterized in that, The image quality meter specification matching includes string recognition and image quality meter specification field extraction of the target image, and traversing and matching each image quality meter specification text in the image quality meter template image library; The spatial resolution includes the detector's basic spatial resolution and the image spatial resolution; The calculation process and results can be displayed according to user settings.
3. The intelligent calculation method for spatial resolution of X-ray digital images according to claim 1, characterized in that, Step S3 includes: Step S3.1: Construct the template image corner point set E1, the target image corner point set E2, the template image thread vector set V1, and the target image thread vector set V2 corresponding to set V1; Step S3.2: Select one vector from the target image thread vector set V2 as the comparison vector, and filter the comparison vector and other vectors in the current set one by one; Step S3.3: Calculate the current screening pass rate and determine whether the screening pass rate is greater than the threshold. If yes, set the current comparison vector as the reference vector of set V2; if no, reselect the comparison vector and trigger step S3.
2. Step S3.4: Retain all vectors in set V2 that can be combined with the reference vector to pass the screening, remove the remaining vectors in set V2 that failed the screening and the vectors in set V1 that have a corresponding relationship with them, and then remove all mismatched corner points in corner point sets E1 and E2 that correspond to the removed vectors, and finally form the correctly paired corner point sets E1´ and E2´.
4. The intelligent calculation method for spatial resolution of X-ray digital images according to claim 3, characterized in that, The formula for calculating the screening pass rate is as follows: Screening pass rate = (Number of successful screenings / Total number of screening decisions) × 100% The selection criteria include that the vector being compared and all other vectors in the set are non-zero vectors, the angle between the two vectors is less than 1 degree, and the ratio of the magnitudes of the two vectors is greater than 0.95 and less than 1.
05. When all the selection criteria are met, it is recorded as passing the selection once; otherwise, if any criterion is not met, it is recorded as passing the selection once.
5. The intelligent calculation method for spatial resolution of X-ray digital images according to claim 1, characterized in that, The line pair extreme point combination includes 5 types of line pair extreme points, namely the first gray-level minimum point, the second gray-level minimum point, the gray-level maximum point, the first background gray-level point, and the second background gray-level point; The first grayscale minimum point refers to the pixel point with the smallest grayscale value of one of the threads in the line pair within the width direction of the line pair at the current length point; The second minimum gray value point refers to the pixel point with the smallest gray value of the other thread in the line pair within the width direction of the line pair at the current length point. The grayscale maximum point refers to the pixel point with the largest grayscale value along the width direction in the area between the two wires of the line pair at the current length point. The first background gray value point refers to the image position point when the first gray value point is deviated from the line pair direction by 8 pixels along the width and away from the line pair direction, with the first gray value point as the reference point, at the current length of the line pair. The second background gray value point refers to the image position point that is 8 pixels away from the line pair direction along the width, with the second gray value point as the reference point, at the current length of the line pair. The template image line pair extreme point combination is used to obtain the pixel position of each line pair extreme point combination of the target image image quality meter through homography matrix projection mapping; The combination of all line pair extreme points at each length point in the effective calculation area of the target image quality meter is used to calculate the corresponding line pair toning regime.
6. The intelligent calculation method for spatial resolution of X-ray digital images according to claim 5, characterized in that, Step S4 includes: Step S4.1: Obtain the initial pixel positions of the five types of extreme points at each length point within the preset effective calculation area; Step S4.2: Using the current initial pixel position as the center point, perform local neighborhood grayscale extreme value relocation along the line for the N pixels before and after it in the width direction; Step S4.3: Determine the actual pixel position and gray value of all line pairs' five types of extreme points at each length point in the effective calculation area, and then obtain the corresponding line pair toggle system.
7. An intelligent computing system for spatial resolution of X-ray digital images, characterized in that, It includes a radiation detector, an image quality meter template image library, an image acquisition module, an image quality meter pairing module, a corner matching module, a modulation calculation module, a relationship curve construction module, and a calculation process display module. The image acquisition module calls the X-ray detector to perform bilinear image quality meter X-ray imaging to generate a target image. The image quality meter matching module performs image quality meter specification matching on the target image and retrieves a template image of the same specification. The corner matching module calculates the homography matrix between the template image and the target image; The modulation calculation module projects the extreme point combination of each line pair of the image quality meter in the template image and calculates the average modulation of all line pairs of the image quality meter in the target image. The relationship curve construction module constructs a continuous relationship curve corresponding to the wire diameter of the average modulation, thereby obtaining the spatial resolution of the X-ray digital image. At the same time, the calculation process display module displays all calculation processes and results.
8. The intelligent computing system for spatial resolution of X-ray digital images according to claim 7, characterized in that, The image quality meter specification matching includes string recognition and image quality meter specification field extraction of the target image, and traversing and matching each image quality meter specification text in the image quality meter template image library; The spatial resolution includes the detector's basic spatial resolution and the image spatial resolution; The calculation process and results can be displayed according to user settings.
9. The intelligent computing system for spatial resolution of X-ray digital images according to claim 7, characterized in that, The corner matching module calculates the homography matrix between the template image and the target image by: Module M3.1: Constructs a set of corner points of the template image E1, a set of corner points of the target image E2, a set of thread vectors of the template image V1, and a set of thread vectors of the target image V2 corresponding to set V1; Module M3.2: Select one vector from the target image thread vector set V2 as the comparison vector, and filter the comparison vector and other vectors in the current set one by one; Module M3.3: Calculates the current screening pass rate and determines whether the screening pass rate is greater than the threshold. If so, the current comparison vector is set as the reference vector of set V2. If not, the comparison vector is reselected and module M3.2 is triggered. Module M3.4: Retain all vectors in set V2 that can be combined with the reference vector and pass the screening, remove the remaining vectors in set V2 that failed the screening and the vectors in set V1 that have a corresponding relationship with them, and then remove all mismatched corner points in corner point sets E1 and E2 that correspond to the removed vectors, and finally form the correctly paired corner point sets E1´ and E2´. The formula for calculating the screening pass rate is as follows: Screening pass rate = (Number of successful screenings / Total number of screening decisions) × 100% The selection criteria include that the vector being compared and all other vectors in the set are non-zero vectors, the angle between the two vectors is less than 1 degree, and the ratio of the magnitudes of the two vectors is greater than 0.95 and less than 1.
05. When all the selection criteria are met, it is recorded as passing the selection once; otherwise, if any criterion is not met, it is recorded as passing the selection once.
10. The intelligent computing system for spatial resolution of X-ray digital images according to claim 7, characterized in that, The calculation of the average modulation depth of all line pairs of the target image quality meter includes: Module M4.1: Obtain the initial pixel positions of five types of extreme points at each length point within the preset valid calculation area; Module M4.2: Using the current initial pixel position as the center point, perform local neighborhood grayscale extreme value relocation along the line for the N pixels before and after it in the width direction; Module M4.3: Determines the actual pixel position and gray value of all line pairs' five types of extreme points at each length point in the effective calculation area, and then obtains the corresponding line pair interpolation regime; The five types of extreme points are the first gray-level minimum point, the second gray-level minimum point, the gray-level maximum point, the first background gray-level point, and the second background gray-level point. The first grayscale minimum point refers to the pixel point with the smallest grayscale value of one of the threads in the line pair within the width direction of the line pair at the current length point; The second minimum gray value point refers to the pixel point with the smallest gray value of the other thread in the line pair within the width direction of the line pair at the current length point. The grayscale maximum point refers to the pixel point with the largest grayscale value along the width direction in the area between the two wires of the line pair at the current length point. The first background gray value point refers to the image position point when the first gray value point is deviated from the line pair direction by 8 pixels along the width and away from the line pair direction, with the first gray value point as the reference point, at the current length of the line pair. The second background gray value point refers to the image position point that is 8 pixels away from the line pair direction along the width, with the second gray value point as the reference point, at the current length of the line pair. The template image line pair extreme point combination is used to obtain the pixel position of each line pair extreme point combination of the target image image quality meter through homography matrix projection mapping; The combination of all line pair extreme points at each length point in the effective calculation area of the target image quality meter is used to calculate the corresponding line pair toning regime.
Citation Information
Patent Citations
X-ray digital imaging enhancement and quantitative recognition method for detecting sleeve grouting defects
CN109781752A
Verification method of pipeline X-ray digital imaging detection equipment
CN113125473A