A method for calculating the blackness value of digital radiographs
By optimizing the method for calculating the blackness value of digital radiographs using cubic function fitting and least squares method, the problem of large calculation error in existing technologies is solved, achieving higher accuracy in blackness value measurement, meeting relevant standards, and improving the image quality assessment of digital radiographs.
Patent Information
- Application Number
- CN202211208110.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2042-09-30
AI Technical Summary
In existing technologies, the calculation of the blackness value of digital X-ray film has errors, resulting in a large deviation between the measured data and the actual value, which fails to meet the relevant standard requirements.
A cubic function was used as the fitting function, and the fitting model was determined by the least squares method. The data was measured using a probe tool and the fitting and simulation were performed to determine the mapping relationship between the independent and dependent variables and optimize the method for calculating the blackness value.
It significantly reduced the error in blackness value measurement, with 95% of the measured results having a deviation of less than 0.05 from the actual values, meeting relevant standard requirements and improving the accuracy of digital radiograph quality assessment.
Smart Images

Figure CN115615551B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of nondestructive testing technology, and in particular to a method for calculating the blackness value of digital radiographic films. Background Technology
[0002] After digitizing radiographic films taken during non-destructive testing, system testing using the scanner's built-in software revealed a significant discrepancy between the measured data obtained from the blackness measurement tool and the actual data obtained using a blackness meter. The data distribution trend was above the actual measured values, failing to meet relevant standards. Analysis indicated that the "grayscale to blackness conversion formula" used in the software was not a formula reflecting the actual measured data. Blackness is a fundamental parameter of radiographic film image quality, affecting image contrast and graininess (noise), and consequently, sensitivity. Inaccurate blackness measurement of digitized radiographic films will inevitably affect the judgment of their quality and hinder computer-aided image evaluation.
[0003] The NB / T 47013 (Standard for Non-destructive Testing of Pressure Equipment) stipulates that "the error of the measured value should not exceed ±0.05," while the RCC_M (Standard for Design and Construction Rules of Mechanical Equipment for Pressurized Water Reactor Nuclear Island) stipulates that "the blackness of the reference film for measuring blackness should be accurate to ±0.1." Through experiments, using the scanner's built-in software to calculate the optical density of 45 verification films, only 26% had a deviation value less than 0.05, which does not meet the relevant standard requirements. Summary of the Invention
[0004] The purpose of this invention is to provide a method for calculating the blackness value of digital radiographic film, thereby solving the problem of measurement error in the blackness value of digital radiographic film.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] A method for calculating the density value of digital radiographs includes the following steps:
[0007] S1: The raw data of the blackness of a point on the X-ray film is obtained by measuring the blackness with a blackness meter;
[0008] S2: After the X-ray film is digitized, the measurement data is calculated at the same coordinate position using a probe tool in the system;
[0009] S3: Fit and simulate the measurement data.
[0010] In S3, a cubic function is used as the fitting function, and the feature transfer function of the fit is Y = -1.5967e -11 X 3 +1.1705e -0.8 X 2-0.0013e -0.3 X+4.5909e, where X represents the grayscale value of the digital radiograph and Y represents the blackscale value of the digital radiograph.
[0011] In S3, the fitting model f(x,A) is determined based on the measurement data, where A=(a0,a1,…,a…). n () represents parameters to be determined.
[0012] Furthermore, the class to which the function belongs is determined based on the knowledge of each discipline.
[0013] Choose an undetermined parameter A such that the residuals e between the fitted model and the actual observed values at each point are... k =y k -f(x k Find f*(x) such that the weighted sum of squares of A is minimized.
[0014] The measurement data is {(x i ,y i The fitted model is f(x,A) = a0 + a1x + ... + a n x n The coefficients a0, a1, ..., a are determined by the least squares method. n Assuming the weights of each data point are constant, let:
[0015] If we minimize it, then we have:
[0016] The system of equations is obtained as follows:
[0017] make
[0018] Then the parameters A = X of the fitting formula are obtained. -1 Y, yielding the fitting polynomial f(x,A) = a0 + a1x + ... + a n x n .
[0019] Compared with existing technologies, the method for calculating the blackness value of digital radiographs provided by this invention has the following advantages:
[0020] The measurement method provided by this invention has a small error in calculating the density value of digitized X-ray film.
[0021] Comparing the blackness values measured by the blackness meter with the results calculated by this method, it can be found that the curve fitted by this method is very close to the measured data points, and the fitting effect is quite ideal, satisfying that at least 95% of the deviation values are less than 0.05 and 100% of the deviation values are less than 0.1. It can be seen that this method is accurate and feasible. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a distribution map of blackness values measured manually and by the original software in the existing technology;
[0024] Figure 2 The distribution map of blackness values provided by the present invention is based on manual measurement and existing software calculation. Detailed Implementation
[0025] The following detailed description provides further details on specific implementation methods.
[0026] To address the issue of measurement data bias, data fitting is the optimal method. Data fitting effectively finds an expression that reflects the relationship between variables, best approximating the known data under certain criteria. Data fitting does not aim for perfect consistency with the original data, but rather to find the result with the smallest difference in a least-squares sense. By fitting, the side effects of measurement and fluctuations on the results are minimized, especially with a sufficiently large dataset. This method transforms discrete data into a continuous functional expression, followed by derivatives and other mathematical calculations to derive the actual relationship. Least-squares fitting is the most commonly used method. Applying fitting can reveal underlying patterns and has both theoretical and practical basis, making it widely used in experimental data processing and analysis.
[0027] Least squares curve fitting can be used to seek the variation patterns of finite measurement data and their accompanying errors. Curve fitting first determines the fitting model, and then determines the class of the function. Polynomial fitting first transforms the function into a hyperbola, S-curve, inverse exponential curve, logarithmic curve, etc., and then solves for the coefficients of the fitting polynomial. Least squares curve fitting involves a large amount of data preprocessing and calculation, so the least squares solution is often difficult to obtain manually and requires the use of computer technology. In this data fitting, the original data is first analyzed, and the measurement data is fitted and simulated to study the mapping relationship between the independent variable gray level and the dependent variable black level, and to analyze its inherent laws.
[0028] Therefore, the present invention provides a method for calculating the density value of digital radiographs, comprising the following steps:
[0029] S1: The raw data of the blackness of a point on the X-ray film is obtained by measuring the blackness with a blackness meter;
[0030] S2: After the X-ray film is digitized, the measurement data is calculated at the same coordinate position using a probe tool in the system;
[0031] S3: Fit and simulate the measurement data.
[0032] After the radiographs were digitized, they were measured using a probe tool in the system. Initially, the blackness values of 45 verification films were measured and compared with the original data measured by a blackness meter. Only 26% met the requirements. After changing the feature transfer function algorithm, the blackness measurement values of 95% of the digitized films had a difference of no more than ±0.05 compared with the original data, meeting the requirements of the relevant ASME standards (American Nondestructive Testing Standards). The remaining differences did not exceed ±0.1, meeting the requirements of the relevant RCC-M standards (European Nondestructive Testing Standards).
[0033] Given a set of measurement data {(x i ,y i Let x = 0, 1, 2, ..., m}, and based on the least squares principle, find the functional relationship f(x, A) between variables x and y, so that it best approximates or fits the known data. f(x, A) is called the fitting model, and A = (a0, a1, ..., a...). n These are some parameters to be determined. The approach is to choose parameter A such that the residuals e between the fitted model and the actual observed values at each point are such that... k =y k -f(x k Find the weighted sum of squares of f*(x) such that A) is minimized. Where, ω(x) i The value ≥ 0 is called the weight, which reflects the value of the data (x). i ,y iThe proportion of data in the experiment. The curve fitted using this method is called the least squares fitted curve.
[0034] To find the fitted curve using the least squares method, the first step is to determine the fitted model f(x). Generally, the class of the function can be roughly determined based on knowledge from various disciplines. If such knowledge is not available, the form of the fitted curve is usually determined from the dynamics of the problem and the scatter plot of the given data.
[0035] Taking polynomial fitting as an example, if the model to be fitted is f(x,A)=a0+a1x+…+a n x n If the coefficients a0, a1, ..., a are determined by the least squares method, then it is called a polynomial fitting. n Assuming the weights of each data point are constant, let:
[0036] If we minimize it, then we have:
[0037] Right now:
[0038] The system of equations is obtained as follows:
[0039] This equation is called the normal equation for polynomial fitting. Let
[0040]
[0041] Then it has the matrix form: XA = Y,
[0042] Therefore, the parameters of the fitting formula can be obtained: A = X -1 Y,
[0043] Solving this matrix equation yields the coefficient term A, which in turn gives the fitted polynomial f(x,A)=a0+a1x+…+a n x n It is worth noting that when n is large (n≥7), the coefficient matrix of the normal equation is highly ill-conditioned, meaning the rounding error of the solution is so large that it becomes meaningless. Therefore, when using polynomials for curve fitting, n should not be too large. When n=1, a simple fitting model y=a0+a1x is obtained, which is called linear fitting.
[0044] Determining the fitting function is crucial to successful fitting. A fitting function that conforms to the characteristics and patterns of the data can more quickly and accurately fit the equation parameters. Therefore, setting a reasonable fitting function can achieve twice the result with half the effort. In the process of fitting this data curve, through fitting tests of various functions and analysis of data characteristics, a cubic function was ultimately determined to be used as the fitting function.
[0045] Using the regularized total least squares method, the final optimization formula is obtained: y = ax 3 +bx 2 The cubic equation +cx+d is solved using regularized total least squares. Where a = -1.596774013265388e -11 b = 1.170586416247726e —0.8 c = -0.001340295667236e -0.3 , d = 4.590914285712070e.
[0046] To verify the effectiveness and engineering feasibility of the proposed fitting-based optimization algorithm, this method was applied to actual experimental data. The algorithm was fitted to real experimental data containing only grayscale values, and then the blackness value was calculated based on the fitting results.
[0047] The density of a point on a radiograph is measured using a densitometer. After the radiograph is digitized, a probe tool in the system is used to calculate a value at the same coordinate position. A comparison is made between the manually measured data (scattered points) and the original software calculation. Figure 1 As shown in the figure, the fitting results obtained for this segment show that the original software's calculation of blackness has a large error compared to the manual measurement, and its distribution trend is above the actual measured value distribution.
[0048] Comparison of manually measured scatter plots with the results calculated using the optimized formula: Figure 2 As shown in the figure, the curve fitted by the optimized formula closely matches the measured data points, indicating a satisfactory fitting effect. This demonstrates that the current software fitting method is accurate and feasible, the calculated density values meet relevant standards, and it can accurately locate data, making it suitable for auxiliary evaluation of digital radiographs.
[0049] In other words, this invention, through data fitting, first analyzes the original data, then fits and simulates the measured data to study the mapping relationship between the independent variable grayscale and the dependent variable blackscale, analyzing its inherent patterns. Next, it determines the fitting function. The determination of the fitting function is crucial to the success of the fitting; a fitting function that conforms to the data characteristics and patterns can more quickly and accurately fit the equation parameters. In the process of fitting this data curve, through fitting tests of various functions and analysis of data characteristics, a cubic function was ultimately determined as the fitting function, and the characteristic transfer function of the fitting is: Y = -1.5967e -11 X 3 +1.1705e -0.8 X 2 -0.0013e -0.3X+4.5909e. Where X represents the grayscale value of the digitized radiograph (the display value of the digitized image), and Y represents the blackscale value of the digitized radiograph (a parameter value of image quality).
[0050] Density is a fundamental parameter of radiographic film image quality, affecting image contrast and graininess (noise), and consequently, sensitivity. Accurate measurement of density values is a crucial factor in the quality of digitized radiographic film. To ensure sufficient contrast, the film density cannot be too low; however, due to limitations imposed by the viewing lamp's brightness, the density should not be excessive. The required density of the film is generally within a range. The lower limit refers to the density at the center of the weld reinforcement at both ends of the film, while the upper limit refers to the density in the heat-affected zone on both sides of the weld in the middle of the film. Original film density is typically measured using a densitometer, which is susceptible to errors due to instrument and human factors. Once the accuracy of the measurement system is verified after digitization, the probability of error is greatly reduced, thus providing strong support for intelligent film evaluation.
[0051] Therefore, by comparing the blackness value measured by the blackness meter with the result calculated by this method, it can be found that the curve fitted by this method is very close to the measured data points, and the fitting effect is quite ideal, satisfying that at least 95% of the deviation values are less than 0.05 and 100% of the deviation values are less than 0.1. It can be seen that this method is accurate and feasible.
[0052] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for measuring the blackness value of a digitized radiographic film, characterized by, The method comprises the following steps: S1: the blackness of a point on the radiographic film is measured to obtain original data by using a blackness meter; S2: after the radiographic film is digitized, the measurement data is measured at the same coordinate position by using a probe tool in the system; S3: fitting and simulation of the measured data, using a cubic function as the fitting function, the characteristic transfer function of the fitting is Y = -1.5967e -11 X 3 +1.1705e -0.8 X 2 -0.0013e -0.3 X+4.5909e, wherein X represents the gray value of the digitized radiograph, and Y represents the blackness value of the digitized radiograph.
2. The method for measuring the blackness value of a digitized radiographic film according to claim 1, wherein In S3, the fitting model f(x,A) is determined based on the measurement data, where A=(a0,a1,…,a…). n () represents parameters to be determined.
3. The method for measuring the blackness value of a digitized radiographic film according to claim 2, wherein Selecting the parameters A to be determined so that the weighted sum of the squared residuals e k = y k - f(x k , A) is minimized, finding f*(x) so that 4. The method for measuring the blackness value of a digitized radiographic film according to claim 3, wherein The measurement data is {(x i ,y i ), i = 0, 1, 2, L, m}, the fitting model is f(x, A) = a0+a1x+…+a n x n , the coefficients a0, a1, …, a n are determined by the least square method, and it is assumed that the weight of each data point is a constant value, that is: Let it be the minimum, then there is: The following equations are obtained: Let then the parameter A of the fitting formula is obtained as X -1 Y, the fitting polynomial f(x,A) = a0 + a1x +... + a n x n .
Citation Information
Patent Citations
Image enhancement method applicable to digital images of industrial radiographic inspection film
CN102542532A