0% found this document useful (0 votes)
16 views8 pages

Mery CrossingLineProfiles

Uploaded by

Guillermo harris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views8 pages

Mery CrossingLineProfiles

Uploaded by

Guillermo harris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Crossing Line Profile: A New Approach to

Detecting Defects in Aluminium Die Casting

Domingo Mery

Departamento de Ingenierı́a Informática


Universidad de Santiago de Chile
Av. Ecuador 3659, Santiago de Chile
[email protected]
http://www.diinf.usach.cl/∼dmery

Abstract. Radioscopy is the accepted way for controlling the quality


of aluminium die cast pieces through computer-aided analysis of X-ray
images. Two classes of regions are possible in a digital X-ray image of
a casting: regions belonging to regular structures of the specimen, and
those relating to defects. Since the contrast between a flaw and a defect-
free neighbourhood is distinctive, the detection is usually performed by
thresholding this feature. Nevertheless, this measurement suffers from
accuracy error when the neighbourhood is not homogeneous, for example
when the flaw is at an edge of a regular structure of the test object. For
this reason, many approaches use a-priori information about the location
of regular structures of the test piece. In this paper, a new approach to
detecting defects without a-priori knowledge is proposed. The approach
is based on features extracted from crossing line profiles, i.e., the grey
level profiles along straight lines crossing each segmented potential flaw
in the middle. The profile that contains the most similar grey levels in
the extremes is selected. Hence, the homogeneity of the neighbourhood is
ensured. Features from the selected profile are extracted. The detection
performance of our features and a vast number of other known features
are assessed by computing the area Az under the Receiver Operation
Characteristic (ROC) curve. The best performance is achieved using one
of the proposed features yielding an area Az = 0.9944 in 50 X-ray images
of aluminium wheels with 23.000 potential flaws.
Keywords: flaw detection, automated visual inspection, X-ray testing.

1 Introduction
Shrinkage as molten metal cools during the manufacture of die castings, can
cause defect regions within the work piece. These are manifested, for example,
by bubble-shaped voids, cracks, slag formations or inclusions (see an example
in Fig. 1a). Light-alloy castings produced for the automotive industry, such as
wheel rims, steering knuckles and steering gear boxes are considered important
components for overall roadworthiness. To ensure the safety of construction, it
is necessary to check every part thoroughly. Radioscopy rapidly became the ac-
cepted way for controlling the quality of die cast pieces through computer-aided

J. Bigun and T. Gustavsson (Eds.): SCIA 2003, LNCS 2749, pp. 725−732, 2003.
 Springer-Verlag Berlin Heidelberg 2003
2
726 D. Mery

analysis of X-ray images [1]. The purpose of this non-destructive testing (NDT)
method is to identify casting defects, which may be located within the piece
and thus are undetectable to the naked eye. The automated visual inspection of
castings is a quality control task to determine automatically whether a casting
complies with a given set of product and product safety specifications.
Two classes of regions are possible in a digital X-ray image of an aluminium
casting: regions belonging to regular structures of the specimen, and those re-
lating to defects. The automatic process used in fault detection in aluminium
castings consists of five steps: a) Image formation, in which an X-ray image of the
casting under test is taken and stored in the computer. b) Image pre-processing,
where the quality of the X-ray image is improved in order to enhance the details
of the X-ray image. c) Image segmentation, in which each potential flaw of the
X-ray image is found and isolated from the rest of the scene. d) Feature extrac-
tion, where the potential flaws are measured and some significant characteristics
are quantified. e) Classification, where the extracted features of each potential
flaw are analysed and assigned to one of the classes (regular structure or defect).
In an X-ray image we can see that the defects, such as voids, cracks and
bubbles (or inclusions and slags), show up as bright (or dark) features. The
reason is that the X-ray attenuation in these areas is shorter (or higher). Since
the contrast in the X-ray image between a flaw and a defect-free neighbourhood
of the specimen is distinctive, the detection is usually performed by analysing
this feature. There are several definitions of contrast, they generally give a com-
parison between the grey level of a region (potential flaw) and the grey level
of its corresponding neighbourhood (see for example [2]). Nevertheless, the last
measurement suffers from accuracy error when the neighbourhood is not ho-

a b c

d e f

Fig. 1. Detection of flaws: a) radioscopic image with a small flaw at an edge of a regular
structure, b) Laplacian-filtered image with σ = 1.25 pixels (kernel size = 11 × 11), c)
zero crossing image, d) gradient image, e) edge detection after adding high gradient
pixels, and f) detected flaw using feature F1 extracted from a crossing line profile.
Crossing Line Profile 3
727

mogeneous, for example when the flaw is at an edge of a regular structure of


the test object. For this reason, many approaches compute the grey level of the
neighbourhood using a-priori knowledge of the design structure of the test piece
(see for example [3, 4]). Thus, the defect-free areas are defined in sections where
the grey level values have a small variance. These methods have become the
most widely established in industrial applications owing to their high detection
performance1 . However, they require a very precise positioning of the test ob-
ject and a complicated selection process of the defect-free areas. A review of the
existing approaches of automated flaw detections in aluminium castings can be
found in [1].
In order to avoid the mentioned problems, this paper proposes a new ap-
proach based on features extracted from crossing line profiles computed without
a-priori knowledge. The paper is organised as follows. In Section 2, the segmen-
tation of potential flaws is outlined. The new approach is described in Section
3. The performance analysis is presented in Section 4. Finally, Section 5 gives
concluding remarks. An early version of this research is presented in [2].

2 Segmentation of potential flaws


The X-ray image taken with an image intensifier and a CCD camera (or a flat
panel detector), must be pre-processed to improve the quality of the image. In
our approach, the pre-processing techniques are used to remove noise, enhance
contrast, correct the shading effect and restore blur deformation [1].
The segmentation of potential flaws identifies regions in radioscopic images
that may correspond to real defects. Two general characteristics of the defects
are used to identify them: a) a flaw can be considered as a connected subset of
the image, and b) the grey level difference between a flaw and its neighbourhood
is significant. According to the mentioned characteristics, a simple automated
segmentation approach was suggested in [5] (see Fig. 1). First, a Laplacian-
of-Gaussian (LoG) kernel and a zero crossing algorithm [6] are used to detect
the edges of the X-ray images. The LoG-operator involves a Gaussian lowpass
filter which is a good choice for the pre-smoothing of our noisy images that
are obtained without frame averaging. The resulting binary edge image should
produce at real flaws closed and connected contours which demarcate regions.
However, a flaw may not be perfectly enclosed if it is located at an edge of a
regular structure as shown in Fig. 1c. In order to complete the remaining edges
of these flaws, a thickening of the edges of the regular structure is performed
as follows: a) the gradient of the original image is calculated (see Fig. 1d); b)
by thresholding the gradient image at a high grey level a new binary image is
obtained; and c) the resulting image is added to the zero crossing image (see Fig.
1e). Afterwards, each closed region is segmented as potential flaw. For details
see a description of the method in [5].
1
By inspecting the pieces used in this work, the results obtained by an industrial
software based on a-priori knowledge were excellent: 100% of the real flaws were
detected without false alarms [5].
4
728 D. Mery

This is a very simple detector of potential flaws with a large number of


false alarms flagged erroneously. However, the advantages are as follows: a) it
is a single detector (it is the same detector for each image), b) it is able to
identify potential defects independent of the placement and the structure of the
specimen, i.e., without a-priori information of the design structure of the test
piece, and c) the detection rate of real flaws is very high (approximately 90%).
In order to reduce the number of the false positives, the segmented regions must
be measured and classified. In the next Section, we present new features that
can be used to classify with high accuracy the segmented regions in one of the
two classes: regular structure or defect.

3 Crossing line profiles

As explained in Section 2, a segmented potential flaw is defined as a region


enclosed by edges of the binary image obtained in the edge detection (see con-
nected black pixels in Fig. 1e). For each segmented region, a window g is defined
from the X-ray image x as: g(i, j) = x(i + ir , j + jr ) for i = 1, ..., 2h + 1, and
j = 1, ..., 2w + 1, where h and w are the height and width of the region. The
offsets ir and jr are defined as ir = i0 − h − 1 and jr = j0 − w − 1 where (i0 , j0 )
denotes the coordinates of the centre of gravity of the region (rounded to the
nearest integers). Hence, g is a window of size (2h + 1) × (2w + 1), in which
the middle pixel corresponds to the centre of gravity of the segmented potential
flaw, i.e., g(h + 1, w + 1) = x(i0 , j0 ).
Now, we define the crossing line profile Pθ as the grey level function along a
straight line of window g through the middle pixel (h+1, w +1) forming an angle
θ with i-axis. In [2], P0 and Pπ/2 were analysed together in order to obtain two
features, K and Kσ , that give a measurement of the difference between maximum
and minimum, and the standard deviation of both crossing line profiles. However,
the analysis does not take into account that the profiles could include a non-
homogeneous area. For example, if a non-flaw region is segmented at an edge of
a regular structure, it could be that P0 (or Pπ/2 ) includes a significant grey level
change of the regular structure. In this case, the variation of the profile will be
large and therefore the region will be erroneously classified as defect.
In order to solve this problem, we suggest to analyse individually eight cross-
ing line profiles Pθ , at θ = kπ/8, for k = 0, ..., 7, as illustrated in Fig. 2. In this
analysis, the crossing line profile that contains the most similar grey levels in
the extremes is selected. Hence, the attempt is made to ensure the homogeneity
of the neighbourhood filtering out those profiles that present a high grey level
change in the edge of the regular structure. In the example of Fig. 2, the se-
lected profile is obtained for k = 5 where the grey values of the extremes are
both approximately equal to 150. We observe that the selected crossing line is
approximately perpendicular to the direction of the gradient of the X-ray im-
age without defect. This coincides with one of the criteria used by approaches
with a-priori knowledge: the selected pixels of the defect-free area are located
perpendicular to the direction of the gradient of the piece’s contour [1].
Crossing Line Profile 5
729

       

       
   

           

   
   

       

   
   

   

                   

       

       
   

           

   
   

       

   
   

   

                   

Fig. 2. Crossing line profiles for the window shown in Fig. 1a.

Before the features are extracted, a pre-processing of the selected crossing


line profile is performed as follows: 1) The selected profile is resized to size n = 32
using a nearest neighbour interpolation. The resized profile will be denoted by
P . 2) In order to obtain a defect profile without the background of the regular
structure, P is linearly transformed by Qi = mPi + b, for i = 1, ..., n, where m
and b are so chosen that Q1 = Qn = 0.
Finally, the proposed features are extracted from the normalised profile Q.
They are defined as follows: Q̄: mean of Q; σQ : standard deviation of Q; ∆Q :
difference between maximum and minimum of Q; and Fi : magnitude of the i-th
harmonic of the Discrete Fourier Transform of Q for i = 1, ..4.

4 Performance Analysis

First, we will mention the features that are extracted and analysed in this work.
The features are divided into two groups: geometric and gray value features.
Although most of the extracted features do not give any information about the
contrast, they were analysed in order to investigate if they are relevant to defect
detection.
6
730 D. Mery

The geometric features provide information about the size and the shape
of the segmented potential flaw. The extracted geometric features are: area,
perimeter, height, width, roundness [6], Hu invariant moments, Flusser and Suk
invariant moments, Fourier descriptors, and Gupta and Srinath moments [7],
semi-minor and semi-major axis of ellipse fitted to the contour of the potential
flaw [6], and Danielsson shape factor [8].
The grey value features provide information on the brightness of the seg-
mented potential flaw. In this group, the extracted features are: mean grey
value, mean gradient in the boundary, mean second derivate in the region [2],
radiographic contrasts, contrasts K and Kσ based on P0 and Pπ/2 [2], invariant
moments with grey value information [7], local variance [9], mean and range
of the 14 Haralick textural features based on the co-occurrence matrix in four
different directions taken neighbouring pixels separated by a distance of 1, 2, 3,
4, and 5 pixels [10], and finally the first 64 components of the discrete Fourier
transform, the Karhunen Loève transform and the discrete cosine transform [6]
taken from a normalised image window of 32 × 32 pixels including potential flaw
and neighbourhood.
Each feature is analysed independently using a threshold classifier. Thus, a
potential flaw is classified as regular structure if the feature is bellow a threshold,
otherwise it will be assigned to the defect class. In order to obtain the feature that
yields the best detection performance, the Receiver Operation Characteristic
(ROC) [11] curve is analysed, which is a plot of the ‘sensitivity’ (Sn) against the
‘1-specificity’ (1 − Sp) defined as:
TP FP
Sn = , 1 − Sp = , (1)
TP + FN TN + FP
where T P is the number of true positives (flaws correctly classified); T N the
number of true negatives (regular structures correctly classified); F P is the num-
ber of false positives (false alarms, i.e., regular structures classified as defects);
and F N is the number of false negatives (flaws classified as regular structures).
Ideally, Sn = 1 and 1 − Sp = 0, i.e., all flaws are detected without flagging false
alarms. The ROC curve permits to assess the detection performance at vari-
ous operating points (e.g., thresholds in the classification). The area under the
ROC curve (Az ) is normally used as performance measure because it indicates
how reliable the detection can be performed. A value of Az = 1 gives perfect
classification, whereas Az = 0.5 corresponds to random guessing.
In our experiments, 50 X-ray images of aluminium wheels were analysed.
In the segmentation 22.936 potential flaws were obtained, in which there were
60 real flaws. Some of them were existing blow holes. The other defects were
produced by drilling small holes in positions of the casting which were known to
be difficult to detect. In the performance analysis, the best result was achieved
by our feature F1 (see definition in Section 3), yielding an area Az = 0.9944. The
ROC curve of this feature and the distribution of samples for the two classes
are illustrated in Fig. 3. A detection example is shown in Fig. 1f. The results
of the top eight features are summarised in Table 1, in which the areas Az
and the specificities obtained at sensitivity levels of 100% and 95% are given.
Crossing Line Profile 7731

ROC curve Class distributions


0.5
1 0.45
0.4
0.8
0.35 class: regular structure
0.6 0.3
A = 0.9944
0.25

S

0.4 0.2 class: defect


0.15
0.2
0.1

0 0.05
00 200 400 600
0 0.2 0.4 0.6 0.8 1  

Fig. 3. ROC curve and distribution of classes for the feature F1 .

Table 1. Az and Sp values at Sn=100% and 95%

@Sn =100% (T P = 60) @Sn =95% (T P = 57)


Ranking Feature Reference Az Sp F P /image Sp F P /image
1 F1 Section 3 0.9944 0.9783 9.9 0.9860 6.4
2 σQ Section 3 0.9927 0.9685 14.4 0.9809 8.7
3 ∆Q Section 3 0.9901 0.9662 15.5 0.9765 10.8
4 Ks [2] 0.9897 0.9667 15.2 0.9727 12.5
5 K [2] 0.9891 0.9541 21.0 0.9639 16.5
6 Q̄ Section 3 0.9856 0.8835 53.3 0.9577 19.4
7 f8 (5) [10] 0.9725 0.6340 167.5 0.9244 34.6
8 f13 (2) [10] 0.9711 0.6579 156.5 0.9037 44.1

One of the performances obtained by first feature (Sp = 0.9860 at Sn = 95%)


indicates that on average there are 6.4 false alarms per image when detecting
57 from 60 real flaws. These results are a substantial improvement over those
presented in [2], in which, for the same images, the results obtained have a value
of Sp = 0.9727 at Sn = 95%, which indicates 12.5 false alarms per image when
detecting 57 from 60 real flaws. We observe, that the geometric features do
not provide relevant information to separate the classes. The reason is because
the regions corresponding to flaws and regular structures have similar size and
shapes. Furthermore, the top six features are obtained from the crossing line
profiles. In addition, there are two textural features with high values of Az ,
f8 (5) and f13 (2), that correspond to the mean sum entropy by a distance of 5
pixels and mean of information measure of correlation by a distance of 2 pixels
respectively. However, the sensitivity of 100% is achieved at low specificity levels.
8
732 D. Mery

5 Concluding remarks
In this paper, a new approach to detecting defects in castings without a-priori
knowledge of the design structure is proposed. The approach is based on fea-
tures extracted from crossing line profiles, i.e., grey level profiles along lines
crossing segmented potential flaws in the middle. Several features obtained from
the crossing line profiles were suggested. The detection performance of our fea-
tures and more than 350 other features are assessed by computing the area Az
under the ROC curve. The best performance (Az = 0.9944) was achieved using
the suggested feature F1 calculated as the amplitude of the first harmonic of a
normalised crossing line profile. This means, that only 6.4 false alarms per image
are obtained in the identification of potential flaws (at Sn = 95%). By combining
more than one non-correlated a better classification can be carried out [12]. It is
known that false alarms flagged in this step can be eliminated using a posterior
analysis based on image sequence analysis without eliminating the real flaws [5].

References
1. Mery, D., Filbert, D., Jaeger, T.: Image processing for fault detection in alu-
minum castings. In MacKenzie, D., Totten, G., eds.: Analytical Characterization
of Aluminum and Its Alloys, New York, Marcel Dekker (2003) (In Press).
2. Mery, D., Filbert, D.: Classification of potential defects in automated inspection
of aluminium castings using statistical pattern recognition. In: 8th European Con-
ference on Non-Destructive Testing (ECNDT 2002), Barcelona (2002)
3. Filbert, D., Klatte, R., Heinrich, W., Purschke, M.: Computer aided inspection of
castings. In: IEEE-IAS Annual Meeting, Atlanta, USA (1987) 1087–1095
4. Schulenburg, H., Purschke, M.: Advances in the automatic evaluation of radioscopic
images. In: International Conference on Computerized Tomography for Industrial
Applications and Image Processing in Radiology, March 15-17, Berlin (1999) 241–
243
5. Mery, D., Filbert, D.: Automated flaw detection in aluminum castings based on
the tracking of potential defects in a radioscopic image sequence. IEEE Trans.
Robotics and Automation 18 (2002) 890–901
6. Castleman, K.: Digital Image Processing. Prentice-Hall, Englewood Cliffs, New
Jersey (1996)
7. Sonka, M., Hlavac, V., Boyle, R.: Image Processing, Analysis, and Machine Vision.
2 edn. PWS Publishing, Pacific Grove, CA (1998)
8. Danielsson, P.E.: A new shape factor. Computer Graphics and Image Processing
7 (1978) 292–299
9. Jähne, B.: Digitale Bildverarbeitung. 2 edn. Springer, Berlin, Heidelberg (1995)
10. Haralick, R., Shanmugam, K., Dinstein, I.: Textural features for image classifica-
tion. IEEE Trans. on Systems, Man, and Cybernetics SMC-3 (1973) 610–621
11. Egan, J.: Signal detection theory and ROC analysis. Academic Press, New York
(1975)
12. Mery, D., da Silva, R., Caloba, L., Rebello, J.: Pattern recognition in the automatic
inspection of aluminium castings. In: International Conference on Computerized
Tomography for Industrial Applications and Image Processing in Radiology, June
23-25, Berlin (2003) (accepted).

You might also like