The radiographic inspection setup geometry and the procedure is illustrated in Figure1. Common setup geometry parameters such as source to rotation point x coordinate (R
x
), source to detector distance (SDD), and object to detector distance (ODD) are defined in the figure. The intended inspection application is to detect, position, and size submillimeter pore defects in thin (≈ 5 mm) laser-welded titanium. The laser weld geometry parametrization[14] is also indicated in Figure1. The parameters are nominal thickness (T), weld width (B), enforcement radius (R0) and thickness (δ0), and undercut radius (R1) and thickness (δ1).
The image analysis of the radiographs faces two main difficulties, which are illustrated with synthetic radiographs. Firstly, as can be seen in Figure2, large-scale variations over small pixel length scales in the projected weld geometry dominate the gray scale variation compared to the pore indications shown in Figure3. The pore indications in Figure3 are some 20 to 30 times smaller than the large-scale variations in Figure2. Secondly, as indicated in Figure3, the CNR of the pore indications are low. For pores at the size of the detector pixel size, the contrast is highly sensitive to the pore size. The contrast is approximately proportional to radius3 or even worse depending on its size compared to the detector pixel size. Furthermore, the pore indication is small in terms of affected number of detector pixels.
The algorithm is divided into the following three tasks: segmentation, tracking, and size measurement. The segmentation output is a set of coordinates of pore projection indications in the radiographs from the different rotations. This list is input to the tracker, which solves for the 3-D coordinates at the same time as it filters out false pores. The pores proposed as true pores are then paired up with their projection coordinates and used as input to the size measurement algorithm. It should be noted that the concept is to retrieve what is interesting, the pore indications, rather than to first make a low-noise radiograph.
2.1 Segmentation
The segmentation should output a set of 2-D pixel coordinates representing the mass centers of all pore indications in each of the radiographs. It is preferred to have a high true-positive rate, a low false-positive rate, a high precision in the mass centers, and a high uniqueness. Where a high uniqueness is defined as each pore coordinates is only listed once among the coordinates, three different segmentation methods (see Figure4) have been evaluated: a radial symmetry based, a cross correlation, and an energy weighted cross correlation. To address the uniqueness, a merger algorithm common to all methods is applied as a final step.
2.1.1 Radial symmetry
The idealized pore will be projected with circular symmetry in the intensity pixel values around the mass center point when the intensity is otherwise constant. Therefore, a high level of circular symmetry is expected to be a good measure of a pore projection center. In[15], a measure of local symmetry based on normalized axial moments is derived and implemented as a discrete symmetry transform (DST). The DST is calculated as given in[15, 16] according to
(1)
(2)
The sum in T
k
(i,j) is summed over the indexes which are on the boundary of the pixelated circle C
r
of radius rrs with pixels centered in (i,j). In total, nrs number of local axial moments T
k
at the order lrs are calculated and summed over with k = 0,…,nrs-1 at each i,j. The maximum value of T
k
is then used as the normalization factor Tmax. The transform will look for symmetry around the axis with slope given by k π/nrs, that is, axes in the case of nrs > 1.
In[15], the DST is only applied at points of nonuniformity; here, the nonuniformity stage is changed to identify potential pore projection center points instead. The following differential expression is proposed to identify a symmetric peak around the second index j with possible radius ≈ rrs:
(3)
where the direction of index j is perpendicular to the weld geometry. E will be large when slopes are opposite around (i,j) and, for example, identical to zero for a perfect line. As a final step, the DST matrix is convoluted with a Gaussian kernel G with standard deviation σrs resulting in a correlation image:
(4)
This procedure is run irs number of times for different rrs, with the result averaged. It should be noted that when the number of axial moments is set to 1 (nrs = 1), the correlation image will only depend on E(i,j) since DST(i,j) = 1 for all i,j.
2.1.2 Cross correlation
If a mathematical model of the pore projection can be derived, such a model can be correlated against the image to find correlation maximums and hence the locations of the pore indications. The same linear X-ray attenuation model as in[14] is used but with the detector approximated as ideal and the X-rays approximated as parallel. The 2-D projection of the pore with radius rcc pixels centered in c is approximated as
(5)
where μ is the linear attenuation per pixel for the surrounding material. Furthermore, the equation is only valid for.
The detector model used for the synthetic radiographs will smooth the pore projection indications due to its point spread function. This smoothing will also be present in real radiographs. However, due to the idealized detector model used, this effect is not included in Equation 5. Furthermore, the buildup factor (fraction of scattered to direct radiation) is assumed to be approximately constant over the area of the projected pore. This has been shown to hold for this application in[14]. Finally, probably the least valid assumption is that the background intensity profile, in this case dominated by the weld geometry, is changing little compared to the change due to the pore. This assumption is not valid, and therefore, geometry-related intensity changes must be reduced. This reduction is done using a simple local median with radius rme,. As a last step, the normalized cross correlation is calculated at each pixel against the model proposed in Equation 5 according to the standard equation:
(6)
where the summation is over all indexes within a square of size scc and 〈〉 denote average. A value close to 1 will indicate a high similarity to K.
A variation of the cross correlation method is also considered and referred to as energy weighted cross correlation. The cross correlation is scaled with the energy in the intensity according to
(7)
where the indexes l,m is given by K(l,m) ≠ 0.
2.1.3 Mean shift merging
The last step of the segmentation is a merger algorithm, which intends to make the coordinates unique. The algorithm is based on the mean shift algorithm[17]. The mean shift algorithm is generally used to find high-density regions (clusters) in multidimensional spaces. Here, it is used to find the centers of pore indication clusters in 2-D.
In more detail, the merger iteratively selects the pixels in the correlation image with values larger than C
T
. For each pixel above C
T
, the mean shift algorithm is restarted and iterated until it has converged into a local maximum in density. At each iteration, the mass center within a radius rms is calculated and compared with the previous mass center, the mean shift vector. In the next iteration, this next proposed mass center is used. This is repeated until the solution is considered as having converged, with the mean shift vector changing less than δms percent. The converged coordinates are incrementally averaged in bins of 1-pixel sizes. As a consequence, indications closer than ≈ rms will not be resolvable.
2.2 Tracking
The tracker should not only invert the 3-D to 2-D X-ray projection for the defects to solve for the 3-D physical coordinates of the defects in the weld but at the same time also handle the high false-positive rate from the segmentation algorithm. Formally, a tracker tracks a state X of a single or multiple objects by assigning measurements Y to different objects as time increases (data association). The measurement is predicted, and the state of each object is updated when a new measurement is assigned to it (filtering). The measurements are the set of pore projection coordinates in the detector plane given by the segmentation.
The filtering step consists of measurement prediction and object state vector update. It is often handled by a member of the Kalman filter family (see for example[18]). In this article, the extended Kalman filter (EKF) is used since the measurement function Y = h(X) is nonlinear. The nonlinearity is rather low, and the EKF is assumed to be sufficient. The filter state variables are the 3-D coordinates p = (p
x
,p
y
,p
z
) of each of the pores and the rotation angle ω. The mass center coordinates m of the projection of an ideal pore following the notations in Figure5 are given by
(8)
where m is in millimeters and is translated and scaled into the detector plane before it is used. These equations are then linearized in the EKF framework, and a standard Kalman filter approach is applied. The measurement errors are assumed to be Gaussian with a diagonal covariance matrix. The diagonal elements are denoted R for the pore indication coordinates and R
ω
for the angle. The states will typically oscillate weakly, an effect which can be modeled by a nonzero state covariance matrix. However, it is set to zero since the oscillations are assumed to be negligible compared to the measurement errors. Being linearized, the EKF is sensitive to the initial state. However, in some cases an initial state close to the true state can be derived from two measurements; therefore, the state initiation is delayed until measurements from two rotations are present. Allowing rotation only around one of the euclidean base vectors, one can solve the two equations in Equation 8 for the two unknown coordinates (p
x
,p
y
). Additionally, p
z
is approximately known from the rotation axis limitations. The state initiation is accepted if Gx 0 < p
x
< Gx 1 and otherwise rejected. The gates Gx 0 and Gx 1 are approximated from the setup geometry. The initial state could also be derived using the formalism of vision systems, relaxing the demand on rotation axis, though this approach has not been takenhere.
One data association method suitable for the situation is the multiple hypothesis tracker (MHT) originally presented in[19]. It is suitable when the number of objects to track is not known a priori and/or when the clutter density is high. The implementation derived is very similar to the ‘Structured Branching’ MHT as described in[20]. The assumptions made are that each object generates at most one measurement but each measurement can originate from many different objects. The last assumption accepts overlapping pore projections in some of therotations.
In the nomenclature of tracking, as the object changes its state in some partly known way, the measurements belonging to it forms a track and the track can be used to solve for the state. The main idea of the MHT is that it computes many possible tracks from different combinations of measurements and selects only the most probable. The different combinations can be kept in a tree, with the path from each leaf to the root representing one solution. The probability for each track (object) to be a true positive is, if it is not properly normalized, referred to as its score. The score is constructed by the summation over all nodes, one at each rotation k, for each track as log likelihoods according to
(9)
(11)
where Equation 10 refers to the case of no measurement (the pore indication is not detected in the radiograph) and Equation 11 refers to when a measurement is present. RS is the measurement residual covariance matrix, which increases with R, R
ω
, and the covariance matrix calculated in the Kalman filter step. Smht is a scaling parameter to weight the two terms. Further, d2 is a normalized statistical distance indicating how far away the measurement is from the prediction with respect to the uncertainty indicated by RS. See[13] for an in-depth discussion on the constants and the scores.
In the last paragraphs of this subsection, (row X) will be used to refer to row number X in the following pseudocode of the implementation:
Adding new nodes to the tree is done with great care for the tree not to grow too large. The gates G
z
and G
y
are applied on the two detector coordinates (row 5). If the difference between the previous measurement and the new one is within the gates, a new node for the measurement is added (row 6). There is always a node added for the no measurement case (row 7). The no measurement case represents the hypothesis that the measurement was not detected in the current rotation.
Apart from the gating, a pruning of the tree is also conducted. At the pruning (row 9), the leaves with 〈score〉 = score
k
/k ≥ T1 are accepted and kept while the rest are rejected and pruned. In addition, a maximum limit of five leaves per root is applied, where the leaves with the highest 〈score〉 are kept. These two constants are chosen to yield reasonable run times. The pruning is skipped for those trees which have less than three rotations since two rotations are required for deriving the initial state alone.
At the first rotation, all measurements lead to new track roots, but at later rotations, only the measurements which are far away from any current track prediction are added (row 10). The distance to other track threshold is given by, where dmin is the minimum distance to any track prediction for the measurement at the current rotation. This is done to assure that those measurements which are likely not to belong to any existing track are identified as new roots.
At the decide stage (row 11), the single most probable track (pore) from each tree root is selected and either accepted or rejected. The most probable track is the leaf with the highest 〈score〉. In addition, the following conditions must be met in order for the selected tracks to be accepted: 〈score〉 ≥ T2, Gx 0 < p
x
< Gx 1, and it should have less than ilost number of no measurement nodes.
As a final step (row 12), the tracks (pore proposals) which have states close to each other are combined. This combine step is required since the creation of new tracks might lead to multiple pore proposals originating from the same physical pore. The distances between all pair of solutions are verified not to be closer than δ
u
(in millimeters); if so, the highest 〈score〉 solution is chosen. This is iterated until there are no solutions closer than δ
u
(in millimeters). The solution will, in most cases, not be unique but is believed to represent reality just as good as any of the other solution. As a consequence, δ
u
becomes a resolution limiting parameter.
2.3 Size measurement
Two possible approaches to measure the size of a pore is either by its projection spatial size or intensity. A projection spatial size approach is assumed to have lower resolution in size than an intensity based for pore sizes at the order of the detector pixel size. Therefore, an intensity-based approach is used, where a scalar depending on the intensity is constructed to correlate with the pore size. Different scalar proposals are constructed in three steps. Firstly, the natural logarithm is optionally applied to the radiograph. Secondly, the weld geometry background (see Figure2) is removed by subtracting the local median of size rme from the original radiograph as
(12)
Thirdly, a sum U is constructed for the pore indication centered at (i0,j0) according to
(13)
where the index j is along the direction perpendicular to the weld direction. Three functions F are evaluated: linear F = I⋆, absolute value F = |I⋆|, and square F = (I⋆)2. The sum U is then averaged over the radiographs at different rotations. The proposed method will yield relative pore sizes; to get real pore sizes, a calibration step is required, which is not elaborated on in this article.