Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Abstract—Weld bead detection is essential for fully automatic Felisberto et al. [4], [5] presented a methodology to perform
identification of flaws on welded joints through digital radio- the weld bead extraction from digital radiographs based on
graphic inspection. This paper presents an approach based on template matching and genetic algorithms. That proposed
Genetic Algorithms (GA) and template matching to detect weld
beads in Double Wall Double Image (DWDI) digital radiographs. methodology uses a model image and works successfully
Pipe or weld bead pre-defined models are compared to radiog- extracting weld beads from panoramic, Single Wall Single
raphy sampled pixels whose locations are defined by candidate Image (SWSI) and Double Wall Single Image (DWSI) ra-
solutions provided by the GA. The fitness of each individual diographs. However, Lim et al. [10] claim that the technique
is evaluated based on a linear combination of its phenotype described in [4] and [5] depends on an image model obtained
and genotype (this later evaluated by an heuristic function). At
the end of the evolutionary process, the best individual in the from the inspected radiographs themselves and therefore it
population indicates the position, orientation and dimensions of is not applicable to all possible variations of weld bead
the pipe or weld bead in the image. The proposed approach geometry. Furthermore, the method is limited to SWSI and
successfully detects pipe and weld beads in all the 16 radiographs DWSI radiographs. Lim, Ratnam and Khalid [10] have also
used for parameters setting and performance evaluation. The proposed an approach for weld bead extraction from SWSI
system represents an important contribution as there is no
previous works concerning automatic weld bead detection for and DWSI radiographs using grey level intensity profiles.
this kind of image. They use a maximum intensity to divide the intensity profiles
in two parts. In each part, least square lines were fitted to
I. I NTRODUCTION their data points using a predefined range threshold. The weld
Weld bead detection in digital radiographic images is a bead boundary points on each part are found using error
fundamental step for automatic defects segmentation in weld threshold. However, the proposed approach requires that the
bead inspection processes [8], [9]. This step consists in iso- pixel having the highest intensity value in the weld bead profile
lating the weld bead as a region of interest (ROI), in which is precisely in the center of the weld bead which makes this
defects can be identified and segmented using a diversity of method sensitive to the presence of other objects in image,
image processing techniques, like morphological bottom-hat like image quality indicators (IQI) and placeholders. Moreover,
filtering [1], Otsu’s global thresholding and Sauvola’s local the method is not suitable for extraction of weld beads from
thresholding [11]–[13], Gaussian filtering [13] and background Double Wall Double Image (DWDI) radiographs.
subtraction [14]. Important improvements have been observed In this paper, we extend the method presented by Felisberto
in this area as described by Silva and Mery [2], [3]. However, et al. [4], [5] proposing the weld bead extraction from DWDI
most of approaches assume that the weld bead has been radiographs in which the weld beads have ellipsoidal shape.
manually isolated beforehand. As the previous work, the proposed methodology combines
Fig. 1. DWDI radiographic testing. Fig. 2. DWDI radiography: (a) pipe wall; (b,d) Image Quality Indicator (IQI);
(c) welded joint; (e) tag indicating the angle of welded joint exposition.
(a2) (b2)
(a3) (b3)
Fig. 6. Pipe and weld bead best individuals (at the final population).
j i
Gxi,j = + 0.5 Gyi,j = + 0.5 (4)
ncol − 1 nlin − 1
( (a) (b)
0 ww Gyi,j + 0.5(1.0 − ww )) if Gyi,j >= 0
Gyi,j = (5) Fig. 7. Sampling grid. (a) pipe detection: (a1) points distribution; (a2) wall
ww Gyi,j − 0.5(1.0 − ww ) if Gyi,j < 0 thickness adjustment; (a3) scale; (a4) rotation; (a5) translation; (b) weld bead
detection: (b1) points distribution; (b2) center line adjustment; (b3) scale and
00 00 0 curve to an ellipse; (b4) rotation and (b5) translation.
Gxi,j = wGxi,j Gyi,j = hGyi,j (6)
000 00 00
Gxi,j = Gxi,j cos θ + Gyi,j sin θ are sampled from the radiographic image and stored into
000 00 00 (7)
Gyi,j = −Gxi,j sin θ + Gyi,j cos θ Mimg . The sample matrix Mimg for each individual is then
compared with the reference matrix, defining this way the
0000 000 0000 000 phenotype evaluation of such individual as Eq. (9), with Mpipe
Gxi,j = Gxi,j + x Gyi,j = Gyi,j + y (8)
as Mref .
X |Mref − Mimg |
where Gxi,j is the horizontal coordinate of each sampling grid phenotype = 1.0 − (9)
max. dissimilarity
point and Gyi,j its respective vertical coordinate. The remaining
parameters are those encoded into pipe chromosome described where max. dissimilarity is defined by the maximum dissimi-
in Table I. larity between black and white pixels (|white − black|).
Figure 7(a) illustrates the operations performed by these If a grid position leads to a pixel outside the image, no pixel
equations. They are described as follows: is sampled and such position is marked as invalid. Addition-
1) Begin with a set of points distributed over a regularly ally, as a penalty, the maximum dissimilarity is assigned to
spaced grid, with coordinates ranging from -0.5 to +0.5 that point.
units, as defined by Eq. (4) and illustrated in Figure 7(a1) As in the case of pipe detection, each individual in the weld
2) Adjust the lines of the grid to fit in the wall thickness bead detection is evaluated as a candidate solution for defining
of the candidate solution and leave the center of the grid the best matching of the weld bead over the detected pipe.
empty, as defined by Eq. (5) and illustrated in Figure Equation (4) plus equations (10) to (13) define the calculation
7(a2) of a set of points (or positions) that will be used as a sampling
3) Scale the grid to the width and height of the candidate grid for the weld bead detection, where Gxi,j is the horizontal
solution, as defined by Eq. (6) and illustrated in Figure coordinate of sampling grid points and Gyi,j their respective
7(a3) vertical coordinates. The remaining parameters are the ones
4) Rotate the grid to match the candidate solution orienta- encoded into pipe chromosome as described in Table I.
tion, as defined by Eq. (7) and illustrated in Figure 7(a4) Such operations are illustrated in Figure 7 (b) and are
5) Translate the grid to match the candidate solution position described as follow:
in the radiographic image, as defined by Eq. (8) and 1) Begin with a set of points distributed over a regularly
illustrated in Figure 7(a5) spaced grid, with coordinates ranging from -0.5 to +0.5
After generating the sampling grid based on chromosome units, as defined by Eq. (4) and illustrated by Figure 7
parameters for every pipe individual in the population, pixels (b1)
TABLE II
0
0.5−cyh
0.5Gi,j
if Gyi,j >= 0 PARAMETERS USED IN THE HEURISTIC FUNCTION .
Gyi,j = (10)
ch +0.5
0.5Gy if Gyi,j < 0 Parameter Weight Standard value Max. dissimilarity
i,j pipe
x 0.10 50% of image’s 50% of image’s
00
Gxi,j = (0.5 − 0.1ww )h cos (2πGxi,j ) width width
00 0 (11) y 0.10 50% of image’s 50% of images
Gyi,j = r2 sin (2πGxi,j ) + h2 Gyi,j height height
w 0.35 100% of image’s 50% of image’s
000 00 00 width width
Gxi,j = Gxi,j cos (θ − π2 ) + Gyi,j sin (θ − π2 ) h 0.35 80% of image’s 60% of image’s
000 00 00 (12) height height
Gyi,j = −Gxi,j sin (θ − π
2) + Gyi,j cos (θ − π
2)
θ 0.10 zero π/4
weld bead
0000 000 l 0.20 zero 50% of pipe’s
Gxi,j = Gxi,j + x + l cos θ width (w)
0000 000 (13) r2 0.20 30% of effective 50% of effective
Gyi,j = Gyi,j + x + l sin θ pipe’s height pipe’s height
(0.5 − 0.1ww )h (0.5 − 0.1ww )h
h2 0.60 35% of pipe’s 40% of pipe’s wall
wall thickness thickness (ww h)
(ww h)
2) Adjust the lines of the grid so that its center line matches
the adjusted center line of the candidate solution, as
defined by Eq. (10) and illustrated by Figure 7 (b2)
positions, orientations and dimensions of pipes and weld beads
3) Scale and curve the grid to an ellipse that fit in the pipe
usually found in the application context). Moreover, it may
and match the dimensions of the candidate solution, as
provide a kind of noise filtering as it prevents the GA from
defined by Eq. (11) and illustrated by Figure 7 (b3)
finding out solutions (pipes or weld beads) distant from their
4) Rotate the grid to match the orientation of the pipe, as
usually locations.
defined by Eq. (12) and illustrated in Figure 7 (b4)
In Section VI we present the results comparing the perfor-
5) Then, translate the grid to match the candidate solution
mance of the proposed approach with and without the heuristic
position over the pipe, as defined by Eq. (13) and illus-
function.
trated in Figure 7 (b5)
In the same way as pipe detection, after generating the B. Selection and Genetic Operators
sampling grid based on chromosome parameters for every weld After being evaluated, some individuals are selected for
bead individual in the population, pixels are sampled from reproduction. This selection process is based on a stochastic
the radiographic image and stored into Mimg . Thereafter, the tournament, in which individuals are randomly chosen in pairs,
sample matrix Mimg for each individual is compared with the and their fitness are compared. The individual with the highest
reference matrix, defining this way the phenotype evaluation fitness returns to the population and the other is discarded.
of such individual as (9), with Mweld as Mref . This operation is repeated until the population is reduced to a
In all the experiments performed in Sections V and VI, desired amount of individuals selected for reproduction. The
we used pipe and weld bead sampling grids with 48 lines lower the amount of individuals selected for reproduction,
× 17 columns and 27 lines × 32 columns, respectively. The the greater the selective pressure, and then faster is the GA
procedure of image matching using so small sampling grids convergence, nevertheless this increases the probability of
is an important aspect of the present paper as it allows a fast premature convergence to a local optimum. Section V details
and lightweight image matching process. the definition of appropriate values for the population size
2) Heuristic function: In addition to the phenotype evalu- and number of selected individuals, ensuring the best GA
ation, each individual is evaluated using an heuristic function performance considering all the tested parameters.
based on a ”standard” genotype. The heuristic function After the selection process, the genetic operators are ap-
defined by Eq. (14) is simply a weighted and normalized plied. For this, firstly the survival individuals are picked
similarity metric, calculated comparing the candidate solution randomly at pairs to reproduce and an offspring is generated
to the standard genotype. from these parents. In this step, crossover is the most important
operator; it combines alleles from both parents to form the
X |standard − candidate|
heuristic = 1.0 − weight (14) offspring’s chromosome. In this implementation, homogeneous
max. dissimilarity
crossover is used, so each offspring allele has a probability of
Table II lists the ”standard” values defined for each being inherited from the first or from the second parent. As
chromosome parameter, their corresponding weights, defined pointed by [16], in real parameter optimization, the crossover
through a refinement process, and normalizing factors both need to be performed in a inter-exons fashion to reduce
used in (14). disruption effects of crossover operations. Then, only exon-
The heuristic function is added to improve the search as by-exon crossover probability was set (see Table III), letting
it drives the solutions into standard values directions (i.e, the overall crossover probability for two different individuals
be the joint probability of at least one inter-exon crossover VI. T ESTING AND R ESULTS
(poverall
cross = 1−(1−pcross
inter−exon (
) cromossomelength)). Thus
The resulting GA-based approaches (i.e, those with the best
it ranges around 9.5% to 100% in pipe detection and 7.7%
configurations defined in the previous section) were applied to
to 100% in subsequent weld bead detection. Additionally, the
the subset of eight remaining images out of the set of sixteen
mutation operator is applied, replacing an allele by a randomly
images described in Section II.
generated value accordingly to the range of the corresponding
In this section, the experiments were divided in two groups:
parameter.
with and without the heuristic function.
V. S ETTING THE GA PARAMETERS Table IV shows the results (mean and standard deviation of
The GAs performance is highly influenced by the choice of the final fitness among 30 runs) for each image used in the
their operational parameters, like the population size, number test phase considering the absence of heuristic function in the
of selected individuals to reproduction, crossover and mutation fitness calculation.
rates. An exhaustive grid search is conducted to define the best TABLE IV
configuration considering a set of tested parameters both in F INAL F ITNESS ( WITHOUT THE HEURISTIC FUNCTION ) FOR THE TESTED
pipe and weld bead detection as shown in Table III. IMAGES .
Fig. 8. A simple case: pipe and weld bead correctly extracted from the ACKNOWLEDGMENT
testing image H.
This work is partially supported by the Brazilian Na-
tional Research Council (CNPq), under research grants nos.
304867/2008-0 to T.M.Centeno and 307735/2008-7 to M.R.
Delgado, and by Leopoldo Américo Miguez de Mello R&D
Center - CENPES, Brazilian Petroleum - PETROBRAS.
R EFERENCES
[1] M. Carrasco and D. Mery. Segmentation of welding defects using a
robust algorithm. Materials Evaluation, 62, 11:1142–1147, 2004.
[2] R. R. da Silva and D. Mery. State-of-the-art of weld seam inspection
by radiographic testing: Part i - image processing. E-Journal of
Nondestructive Testing and Ultrasonics, 12:1–9, 2007.
[3] R. R. da Silva and D. Mery. State-of-the-art of weld seam inspection
by radiographic testing: Part ii pattern recogtion. E-Journal of Nonde-
Fig. 9. A middle case: pipe and weld bead correctly extracted from the structive Testing and Ultrasonics, 12:1–13, 2007.
testing image B. [4] M. K. Felisberto, H. S. Lopes, T. M. Centeno, and L. V. R. de Arruda.
An object detection and recognition system for weld bead extraction
from digital radiographs. Computer Vision and Image Understanding,
102(3):238–249, 2006.
[5] M. K. Felisberto, G. A. Schneider, T. M. Centeno, and L. V. R.
de Arruda. Automatic weld bead recognition and defect detection in
pipeline radiographs. ASME Conference Proceedings, 2006(42630):537–
543, 2006.
[6] D. E. Goldberg. Genetic Algorithms in Search Optimization and
Machine Learning. 1989.
[7] H. (Health and S. Executive). Information for the Procurement and
Conduct of NDT. Part 3: Radiographic Inspection in Industry.
[8] T. W. Liao and Y. Li. An automated radiographic ndt system for weld
inspection: Part ii–flaw detection. NDT & E International, 31(3):183–
192, 1998.
[9] T. W. Liao and J. Ni. An automated radiographic ndt system for weld
inspection: Part i – weld extraction. NDT & E International, 29(3):157–
Fig. 10. A hard case: pipe and weld bead correctly extracted from the testing 162, 1996.
image E. [10] T. Y. Lim, M. M. Ratnamand, and M. A. Khalid. Automatic weld bead
extraction from digitised radiographs using grey level intensity profiles
and least-squares fitting. Insight, 50:8–13, 2008.
As discussed in the introduction, the proposed approach was [11] A. Mahmoudi and F. Regragui. Fast segmentation method for defects
not compared with other similar approaches as the problem of detection in radiographic images of welds. In IEEE/ACS International
detecting weld bead in Double Wall Double Image (DWDI) Conference on Computer Systems and Applications, pages 857–860, Los
Alamitos, CA, USA, 2009. IEEE Computer Society.
radiographs has not yet been previously addressed. [12] A. Mahmoudi and F. Regragui. Welding defect detection by segmen-
tation of radiographic images. IEEE Control Systems Magazine, pages
VII. C ONCLUSIONS 111–115, 2009.
A GA-based approach for detecting pipe and weld beads [13] M. Thiruganam. Automatic defect detection and counting in radio-
graphic weldment images. International Journal of Computer Appli-
from Double Wall Double Images (DWDI) digital radiographic cations, 10(6):1–4, November 2010.
images was proposed and tested. An exhaustive grid search [14] G. Wang and T. W. Liao. Automatic identification of different types
was used to define the GA operational parameters providing of welding defects in radiographic images. NDT & E International,
35(8):519–528, 2002.
the optimal among all the tested configurations. Pipes and weld [15] D. Whitley. A genetic algorithm tutorial. Statistics and Computing,
beads were successfully detected in all the 16 (DWDI) X-ray 4:65–85, 1993.
[16] A. H. Wright. Genetic algorithms for real parameter optimization. In
Foundations of Genetic Algorithms, pages 205–218. Morgan Kaufmann,
1991.