38
16 Image Processing for Fault Detection in Aluminum Castings Domingo Mery, Dieter Filbert, and Thomas Jaeger CONTENTS 16.1 Introduction ................................................................... 702 16.2 Digital Image Processing in X-Ray Testing..................................... 703 16.2.1 Image Formation ...................................................... 704 16.2.2 Preprocessing .......................................................... 706 16.2.2.1 Noise Removal .............................................. 706 16.2.2.2 Contrast Enhancement ....................................... 707 16.2.2.3 Shading Correction .......................................... 708 16.2.2.4 Restoration of Blur Caused by Motion ....................... 709 16.2.3 Segmentation .......................................................... 710 16.2.3.1 Median Filtering ............................................. 711 16.2.3.2 Edge Detection and Region Finding .......................... 713 16.2.4 Feature Extraction and Selection ....................................... 714 16.2.4.1 Feature Extraction ........................................... 714 16.2.4.2 Feature Selection............................................. 715 16.2.5 Classification .......................................................... 716 16.2.6 Flaw Simulation ....................................................... 717 16.2.6.1 Mask Superimposition ....................................... 718 16.2.6.2 CAD Models for Casting and Flaw .......................... 718 16.2.6.3 CAD Models for Flaws Only................................. 720 16.3 Defect Detection in Castings: State of the Art .................................. 721 16.3.1 Reference Methods .................................................... 722 16.3.1.1 The MODAN-Filter ......................................... 722 16.3.1.2 Signal Synchronized Filter ................................... 725 16.3.1.3 The PXV 5000 Radioscopic Test System...................... 726 16.3.1.4 Radioscopic Testing System SABA 2000T .................... 727 16.3.2 Methods without a priori Knowledge ................................... 727 16.3.2.1 ISAR Radioscopic Testing System............................ 727 16.3.2.2 Gayer et al.’s Method ........................................ 728 16.3.2.3 Kehoe and Parken’s Method ................................. 728 16.3.2.4 Boerner and Strecker’s Method............................... 729 16.3.2.5 Lawson and Parker’s Method ................................ 730 16.3.2.6 Mery and Filbert’s Method .................................. 730 16.3.3 Industrial Computer Tomography...................................... 731 16.4 Conclusions ................................................................... 733 References ........................................................................... 734 701

16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

16 Image Processing

for Fault Detection

in Aluminum Castings

Domingo Mery, Dieter Filbert, and Thomas Jaeger

CONTENTS

16.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70216.2 Digital Image Processing in X-Ray Testing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703

16.2.1 Image Formation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70416.2.2 Preprocessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706

16.2.2.1 Noise Removal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70616.2.2.2 Contrast Enhancement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70716.2.2.3 Shading Correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70816.2.2.4 Restoration of Blur Caused by Motion . . . . . . . . . . . . . . . . . . . . . . . 709

16.2.3 Segmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71016.2.3.1 Median Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71116.2.3.2 Edge Detection and Region Finding. . . . . . . . . . . . . . . . . . . . . . . . . . 713

16.2.4 Feature Extraction and Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71416.2.4.1 Feature Extraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71416.2.4.2 Feature Selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715

16.2.5 Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71616.2.6 Flaw Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717

16.2.6.1 Mask Superimposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71816.2.6.2 CAD Models for Casting and Flaw . . . . . . . . . . . . . . . . . . . . . . . . . . 71816.2.6.3 CAD Models for Flaws Only. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720

16.3 Defect Detection in Castings: State of the Art. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72116.3.1 Reference Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722

16.3.1.1 The MODAN-Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72216.3.1.2 Signal Synchronized Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72516.3.1.3 The PXV 5000 Radioscopic Test System. . . . . . . . . . . . . . . . . . . . . . 72616.3.1.4 Radioscopic Testing System SABA 2000T . . . . . . . . . . . . . . . . . . . . 727

16.3.2 Methods without a priori Knowledge. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72716.3.2.1 ISAR Radioscopic Testing System. . . . . . . . . . . . . . . . . . . . . . . . . . . . 72716.3.2.2 Gayer et al.’s Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72816.3.2.3 Kehoe and Parken’s Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72816.3.2.4 Boerner and Strecker’s Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72916.3.2.5 Lawson and Parker’s Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73016.3.2.6 Mery and Filbert’s Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730

16.3.3 Industrial Computer Tomography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73116.4 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734

701

Page 2: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

16.1 INTRODUCTION

Shrinkage occurs as molten metal cools during the manufacture of die-castings, whichcan cause nonhomogeneous regions within the work piece. These are manifested, forexample, by bubble-shaped voids or fractures. Voids occur when the liquid metal fails to flowinto the die or flows in too slowly, whereas fractures are caused by mechanical stresses whenneighboring regions develop different temperature gradients on cooling. Other possiblecasting defects include inclusions or slag formation.

Light-alloy castings produced for the automotive industry, such as wheel rims, steer-ing knuckles, and steering gear boxes, are considered important components for overallroadworthiness. To ensure the safety of construction, it is necessary to check every partthoroughly [1–3].

Radioscopy rapidly became the accepted way for controlling the quality of die cast piecesthrough visual or computer-aided analysis of x-ray images. The purpose of this non-destructive testing (NDT) method is to identify casting defects, which may be located withinthe piece and thus are undetectable to the naked eye. An example of such defects in a light-alloy wheel is shown in the x-ray image in Figure 16.1. The automated visual inspection ofcastings is a quality control task to determine automatically whether a casting complies witha given set of product and product safety specifications.

Over the past decades radioscopic systems have been introduced in the automotiveindustry that detect flaws without human interaction, i.e., automatically [4–6]. Comparedto a manual evaluation of x-ray images, automated detection of casting defects offers theadvantages of objectivity and reproducibility for every test. Fundamental disadvantages ofthe methods proposed to date are the complexity of their configuration and inflexibility to anychanges in the design of the work piece, which is something that people can accommodateeasily. Research and development is, however, ongoing into automated adaptive processes toaccommodate design modifications.

In recent years, automated radioscopic systems have not only raised quality, throughrepeated objective inspections and improved processes, but have also increased productivityand profitability by reducing labor costs [7].

The principal aspects of an automated x-ray inspection unit are shown in Figure 16.2.Typically, it comprises the following five steps [8]:

1. A manipulator for handling the test piece2. An x-ray source, which irradiates the test piece with a conical beam to generate an

x-ray image of the test piece

FIGURE 16.1 Voids in radioscopic images of aluminum wheels.

702 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 3: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

3. An image intensifier which transforms the invisible x-ray image into a visible one4. A CCD camera which records the visible x-ray image5. A computer to process the digital image processing of the x-ray image and then

classifies the test piece accepting or rejecting it. The computer may also controlthe manipulator for positioning the test piece in the desired inspection position,although this task is normally performed by a programmable logic controller(PLC).

Nowadays, flat amorphous silicon detectors are used as image sensors in some industrialinspection systems [9,10]. In such detectors, using a semi-conductor, energy from the x-ray isconverted directly into an electrical signal (without image intensifier). However, NDT usingflat detectors is less feasible due to their higher cost in comparison to image intensifiers.

In this chapter, we will discuss the use of image processing as a tool in the automatedvisual inspection of aluminum castings. Our chapter is organized as follows. Section 16.2introduces the reader to the image processing theory employed when inspecting aluminumcastings. Methodologies and principles will be outlined. Some application examples aregiven followed by the limitations of the applicability of the methodologies used. Section 16.3presents a survey of many of the automated visual inspection approaches adopted foraluminum castings that have been reported since 1985. Section 16.4 concludes and offerssuggestions for future research. Finally, a bibliography provides references for furtherreading.

16.2 DIGITAL IMAGE PROCESSING IN X-RAY TESTING

Two classes of regions are possible in a digital x-ray image of an aluminum casting: regionsbelonging to regular structures of the specimen, and those relating to defects. In thecomputer-aided inspection of castings, our aim is to identify these two classes automaticallyusing pattern recognition techniques.

The automatic pattern recognition process used in fault detection in aluminumcastings, as shown in Figure 16.3, consists of five steps. The first is image formation, inwhich an x-ray image of the casting under test is taken and stored in the computer. In thesecond step, image preprocessing, the quality of the x-ray image is improved in order toenhance the details of the x-ray image. The third one is called image segmentation, in whicheach region of the x-ray image is found and isolated from the rest of the scene. The fourthstep is the feature extraction. This is where the regions are measured and some significantcharacteristics are quantified. The fifth step of the fault detection is classification. Theextracted features of each region are analyzed and assigned to one of the classes (regularstructure or defect).

FIGURE 16.2 Schematic diagram of an automated x-ray testing stand.

Image Processing in Aluminum Castings 703

Page 4: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

In this section we provide an overview of these five steps. Methodologies and principleswill be outlined. Some application examples followed by limitations to the applicability ofthe used methodologies will be presented. Finally, we give an introduction to simulationof defects in x-ray images, that is normally used in order to evaluate the performance of amethod that inspects castings.

16.2.1 IMAGE FORMATION

In x-ray examination, x-ray radiation is passed through the material under test, and a detec-tor senses the radiation intensity attenuated by the material. A defect in the material modifiesthe expected radiation received by the sensor [11]. This phenomenon, called differentialabsorption, is illustrated in Figure 16.4.

The contrast in the x-ray image between a flaw and a defect-free area of the specimen isdistinctive. In an x-ray image we can see that the defects, such as voids, cracks, or bubbles,show up as bright features. The reason is that the attenuation in these areas is shorter. Hence,according to the principle of differential absorption, the detection of flaws can be achievedautomatically using image processing techniques that are able to identify unexpected regions

FIGURE 16.3 Phases of pattern recognition in automated flaw detection.

FIGURE 16.4 Differential absorption in a specimen.

704 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 5: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

in a digital x-ray image. A real example is shown in Figure 16.5 which depicts two defectsclearly.

The x-ray image is usually captured with a frame-grabber and stored in a matrix. Anexample of a digitized x-ray image is illustrated in Figure 16.6. The size of the image matrixcorresponds to the resolution of the image. In this example the size is 286� 384 pictureelements, or pixels. Each pixel has associated a gray value. This value is between 0 and 255 fora scale of 28¼ 256 gray levels. Here, ‘0’ means 100% black and a value of ‘255’ correspondsto 100% white, as illustrated in Figure 16.7. Let matrix x be the digitized x-ray image, thenthe element x(i, j) denotes the gray value of the ith row of the jth column, as shown in thematrix of Figure 16.6. The eye is only capable of resolving around 40 gray levels [12];however, for the detection of defects in aluminum castings, gray level resolution must be aminimum of 256 levels. In some applications, 216¼ 65,536 gray levels are used [9], whichallows one to evaluate both very dark and very bright regions in the same image.

FIGURE 16.5 Image formation process: (a) x-ray image of a wheel with two defects, (b) 3D plot of thegray values of the image.

FIGURE 16.6 Digital x-ray image.

FIGURE 16.7 256 gray level scale.

Image Processing in Aluminum Castings 705

Page 6: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

16.2.2 PREPROCESSING

The x-ray image taken must be preprocessed to improve the quality of the image before it isanalyzed. In this section, we will discuss preprocessing techniques that can remove noise,enhance contrast, correct the shading effect, and restore blur deformation in x-ray images.

16.2.2.1 Noise Removal

Noise in an x-ray image can prove a significant source of image degradation and must betaken into account during image processing and analysis. In an x-ray imaging system, photonnoise occurs given the quantum nature of x-rays. If we have a system that receives � photonsper pixel in a time DT on average, the number of photons striking any particular pixelin any time DT will be random. At low levels, however, the noise follows a Poisson law,characterized by the probability

p x �jð Þ ¼e��

�xx!ð16:1Þ

to obtain a value x of photons given its average � photons in a time DT. The standarddeviation of this distribution is equal to the square root of the mean.� This means that thephoton noise amplitude is signal-dependent.

Integration (or averaging) is used to remove x-ray image noise. This technique requiresn stationary x-ray images. In this technique, the x-ray image noise is modeled using twocomponents: the stationary component (that is constant throughout the n images) and thenoise component (that varies from one image to the next). If the noise component has zeromean, by averaging the n images the stationary component is unchanged, while the noisepattern decreases by increasing n. Integrating n stationary x-ray images improves the signal-to-noise ratio by a factor of

ffiffiffin

p[4,12].

The effect of image integration is illustrated in Figure 16.8 that uses n stationary imagesof an aluminum casting and shows the improvement in the quality of the x-ray image.

� At high levels, the Poisson distribution approaches the Gaussian with a standard deviation equal to the square root

of the mean: � ¼ffiffiffiffi�

p.

FIGURE 16.8 Noise removal after an averaging of n frames. The noise is reduced by factorffiffiffin

p.

706 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 7: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

The larger the number of stationary images n, the better the improvement. Normally,between 10 and 16 stationary images are taken (10� n� 16).

16.2.2.2 Contrast Enhancement

The gray values in some x-ray images lie in a relatively narrow range of the gray scale. In thiscase, enhancing the contrast will amplify the differences in the gray levels of the image.

We use a gray level histogram to investigate an x-ray image’s gray scale. The functionsummarizes the gray level information of an x-ray image. The histogram is a function h(x)where x is a gray level and h(x) denotes the number of pixels in the x-ray image that have agray level equal to x. Figure 16.9 shows how each histogram represents the distribution ofgray levels in the x-ray images.

A transformation can be applied to modify the distribution of gray level in an x-rayimage. Simple contrast enhancement can be achieved if we use a linear transformation whichsets the minimal and maximal gray values of the x-ray image to the minimal and maximalgray value of the gray level scale respectively. Thus, the histogram is expanded to occupythe full range of the gray level scale. Mathematically, for a scale between 0 and 255, thistransformation is expressed as:

y i, jð Þ ¼ 255x i, jð Þ � xmin

xmax � xminð16:2Þ

where xmin and xmax denote the minimal and maximal gray value of the input x-ray image.The output image is stored in matrix y. Figure 16.9b shows the result of the transformationapplied to the x-ray image in Figure 16.9a. We observe in the histogram of the enhanced x-ray image how the gray levels expand from ‘0’ to ‘255’. The mapping is linear, and means thata gray value equal to (xmax� xmin)/2 will be mapped to 255/2. This linear transformationis illustrated in Figure 16.10a, where the abscissa is the input gray value and the ordinate isthe output gray value.

In a similar fashion, gray input image values can be mapped using a nonlinear trans-formation y¼ f (x), as illustrated in Figure 16.10b and Figure 16.10c, whose results areshown in Figure 16.9c and 16.9d, respectively. The nonlinear transformation is usuallyperformed with a � correction [13]. In these examples, if �41 the mapping is weighted towarddarker output values, and if �51 the mapping is weighted toward brighter output values.

FIGURE 16.9 Contrast enhancement: (a) original image, (b) linear transformation (�¼ 1), (c) nonlineartransformation (�¼ 2), (d) nonlinear transformation (�¼ 1/2), (e) gray levels uniformly distributed.

Image Processing in Aluminum Castings 707

Page 8: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

Finally, we present a contrast enhancement equalizing the histogram. Here, we can alterthe gray level distribution in order to obtain a desired histogram. A typical equalizationcorresponds to the uniform histogram as shown in Figure 16.9d. We see that the number ofpixels in the x-ray image for each gray level is constant.

16.2.2.3 Shading Correction

A decrease in the angular intensity in the projection of the x-rays causes low spatial frequencyvariations in x-ray images [4,6]. An example is illustrated in Figure 16.11a, which shows anx-ray image of an aluminum plate with holes in it. Since the plate is of a constant thickness,we would expect to see a constant gray value for the aluminum part and another constantgray value for the holes. In fact, the x-ray image is darker at the corners. This deficiency canbe overcome by using linear shading correction.

In this technique, we take two images as shown in Figure 16.12. The first one, r1, of a thinplate, and the second one, r2, of a thick plate. We define i1 and i2 as the ideal gray values forthe first and second image, respectively. From r1, r2, i1, and i2, offset and gain correctionmatrices a and b are calculated assuming a linear transformation between the original x-rayimage x and corrected x-ray image y:

y i, jð Þ ¼ a i, jð Þx i, jð Þ þ b i, jð Þ ð16:3Þ

FIGURE 16.11 Shading correction: (a) original image, (b) image after shading correction. The corre-sponding gray value profiles of row number 130 are shown above the images.

FIGURE 16.10 Plots showing different transformations of the gray levels: (a) linear transformation(�¼ 1), (b) nonlinear transformation with �4 1, (c) nonlinear transformation with �5 1.

708 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 9: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

where the offset and gain matrices are computed as follows:

a i, jð Þ ¼i2 � i1

r2 i, jð Þ � r1 i, jð Þb i, jð Þ ¼ i1 � r1 i, jð Þa i, jð Þ ð16:4Þ

An example of this technique is illustrated in Figure 16.11b. In this case we obtain only twogray values (with noise), one for the aluminum part and another for the holes of the plate.

16.2.2.4 Restoration of Blur Caused by Motion

Image reconstruction involves recovering detail in severely blurred images, which is possiblewhen the causes of the imperfections are known a priori [14]. This knowledge may exist as ananalytical model, or as a priori information in conjunction with knowledge (or assumptions)of the physical system that provided the imaging process in the first place [15]. The purpose ofrestoration then is to estimate the best source image, given the blurred example and some apriori knowledge.

This section deals with blur caused by uniform linear motion, resulting from motion ofthe detector and/or the object.� The method we examine here is a new technique for thecorrection of blur [18]. It assumes that the linear motion corresponds to an integer number ofpixels and is horizontally (or vertically) aligned with sampling raster.

The proposed approach can be summarized as follows: given a gray value vector g, therow of the digitized degraded x-ray image; the unknown to be recovered is f, the corre-sponding restored row of the image. The relationship between these two components isHf¼ g, which will be used as the constraint. The matrix H is known or it can be estimatedfrom the degraded image using its Fourier spectrum [19,20].

Vector g is of N entries, while vector f is of M¼Nþ n� 1 entries (M4N), where n is thelength of the blurring process in pixels. The problem consists of solving the underdeterminedsystem Hf¼ g. However, as an infinite number of exact solutions exist for f that satisfyHf¼ g, an additional criterion is needed to find a sharp restored image: the proposed solutionis defined as the vector, in the solution space of the underdetermined system, whose first

� Other algorithms for restoration of x-ray images are given in Refs. [16,17].

FIGURE 16.12 Shading correction: (a) x-ray image for a thin plate, (b) x-ray image for a thick plate.

Image Processing in Aluminum Castings 709

Page 10: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

N components has the minimum distance to the measured data, i.e., �ff� g�� ��! min, where

�ff corresponds to the first N elements of f. A fast non-iterative algorithm for solving theunderdetermined linear system under the mentioned constraint is developed in Ref. [18] usingLagrange multipliers [14]. Here, f is estimated with:

ff ¼ �HT �Hþ PT � P� ��1

�Hþ P½ �Tg ð16:5Þ

with P a N�M matrix that is defined as P ¼ I j 0½ �, where I is a N�N identity matrix and0 is a N� (n� 1) matrix whose elements are equal to zero. On using Lagrange multipliers,� is assumed to be a very large number.

The procedure is repeated for each row of the degraded image. The restoration quality isequally as good as classical methods (see, e.g., Refs. [19,20]), while the computation loadis decreased considerably. An example is shown in Figure 16.13. Details of the aluminumcastings are not discernible in the degraded images, but are recovered in the restored image.

16.2.3 SEGMENTATION

Image segmentation is defined as the process of subdividing an image into disjointed regions[12]. In image processing for detecting faults in castings, such regions correspond to potentialdefects and the background (or regular structures). While there are many methods forsegmenting images, two approaches for segmenting potential defects in x-ray images are usedwidely within the nondestructive testing community. The first technique is based on medianfiltering while the second is a region-oriented method.

FIGURE 16.13 Restoration in simulated degraded x-ray images for different lengths of the blurring

process in pixels.

710 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 11: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

16.2.3.1 Median Filtering

2D filtering is performed in digital image processing using a small neighborhood of a pixelx(i, j) in an input image to produce a new gray value y(i, j ) in the output image, as shown inFigure 16.14. A filter mask defines the input pixels to be processed by an operator f. Theresulting value is the output pixel. The output for the entire image is obtained by shifting themask over the input image. Mathematically, the image filtering is expressed as:

y i, jð Þ ¼ f x i� p, j� pð Þ, . . . , x i, jð Þ, . . . , x iþ p, jþ pð Þð Þ ð16:6Þ

for i¼ 1, . . . ,N and j¼ 1, . . . ,M where N and M are the number of rows and columns ofthe input and output images. The size of the filter mask is, in this case, (2pþ 1)� (2pþ 1).The operator f is linear, if the resulting value y(i, j ) is calculated as a linear combinationof the input pixels:

y i, jð Þ ¼Xm

Xn

h i�m, j� nð Þx i, jð Þ ð16:7Þ

where h is called the convolution mask. The elements of h weight the input pixels. Averagingis a simple example of linear filtering. For a 3� 3 neighborhood, the convolution mask is

h ¼1

9

1 1 11 1 11 1 1

24

35

Filtering out defects detected in an x-ray image of aluminum castings will provide a referencedefect-free image. The defects are detected by finding deviations in the original image fromthe reference image. The problem is how one can generate a defect-free image from theoriginal x-ray image. Assuming that the defects will be smaller than the regular structure ofthe test piece, one can use a low pass filter that does not consider the high frequency com-ponents of the image. However, if a linear filter is used for this task, the edges of the regularstructure of the specimen are not necessarily preserved and many false alarms are raised atthe edges of regular structures.

Consequently, a nonlinear filter is used. Defect discrimination is normally performedwith a median filter. The median filter is a ranking operator (and thus nonlinear) where the

FIGURE 16.14 Digital image filtering.

Image Processing in Aluminum Castings 711

Page 12: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

output value is the middle value of the input values ordered in a rising sequence [12]. For aneven number of input numbers the median value is the arithmetic mean of the two middlevalues.

The application of a median filter is useful for generating the reference image because itsmoothes noise yet preserves sharp edges, whereas other linear low pass filters blur suchedges. Hence, it follows that small defects can be suppressed while the regular structures arepreserved. Figure 16.15 shows this phenomenon for a 1D example. The input signal x isfiltered using a median filter with nine input elements, and the resulting signal is y. We can seethat structures of length n greater than four cannot be eliminated. The third column showsthe detection x� y. Large structures of n� 5 not detected, as presented in the last two cases.

If the background captured by the median filter is constant, foreground structures couldbe suppressed if the number of values belonging to the structure is less than one half of theinput value to the filter. This characteristic is utilized to suppress the defect structures and topreserve the design features of the test piece in the image.

An example for the application of a median filter on 2D signals (images) is shown inFigure 16.16 and includes different structures and mask sizes compared to the effects of twolinear low pass filters. One can appreciate that only the median filter manages to suppress therelatively small structures completely, whereas the large patterns retain their gray values andsharp edges.

FIGURE 16.15 Median filter application on a 1D signal. The size of the median mask is nine.

FIGURE 16.16 Median filter application on an n� n structure using an m�m quadratic maskcompared to average and Gauss low pass filter application.

712 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 13: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

The goal of the background image function, therefore, is to create a defect-free imagefrom the test image. A real example is shown in Figure 16.17. In this example, from anoriginal x-ray image x we generate a filtered image y and a difference image x� y

�� ��. Bysetting a threshold, we obtain a binary image whose pixels are ‘‘1’’ (or white), where the grayvalues in the difference image are greater than the selected threshold. After an erosion anddilation technique we discard isolated pixels that do not conform a large enough region[12,13]. The remaining pixels correspond to the detected flaws. Modifications of the medianfilter will be explained later in Section 16.3.1.1.

16.2.3.2 Edge Detection and Region Finding

This approach attempts to detect the potential defects in an x-ray image in two steps: edgedetection and region finding [21,22]. In the first step, the edges of the x-ray image are detected.The edges correspond to pixels of the image in which the gray level changes significantly overa short distance [12]. The edges are normally detected using gradient operators. In the secondstep, the regions demarcated by the edges are extracted. The key idea of this two step basedapproach is that the existing defects present significant gray level changes compared totheir surroundings. A Laplacian of Gaussian (LoG) kernel and a zero crossing algorithm[12,23,24] can be used to detect the edges of the x-ray images. The LoG-operator involves aGaussian low pass filter, which is good for the pre-smoothing of the noisy x-ray images. TheLoG-kernel is defined as the Laplacian of a 2D-Gaussian function:

hLoG m, nð Þ ¼1

2��42�

m2 þ n2

�2

� �exp �

m2 þ n2

2�2

� �ð16:8Þ

The parameter � defines the width of the Gaussian function and, thus, the amount ofsmoothing and the edges detected (see Figure 16.18). Using Equation 16.7 we calculate animage in which the edges of the original image are located by their zero crossing. The detectededges correspond to the maximal (or minimal) values of the gradient image. The binary edgeimage obtained should reproduce real flaws’ closed and connected contours that demarcateregions. Figure 16.19 illustrates the results obtained on an x-ray image by applying thismethod.

FIGURE 16.17 Defect detection using median filtering: (a) original x-ray image, (b) filtered x-ray

image, (c) difference image, (d) binary image using a threshold, (e) eroded image, (f) dilated imagesuperimposed onto original image.

Image Processing in Aluminum Castings 713

Page 14: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

16.2.4 FEATURE EXTRACTION AND SELECTION

Segmented potential defects frequently set off false alarms. An analysis of the segmentedregions, however, can improve the effectiveness of fault detection significantly. Measuringcertain characteristics of the segmented regions ( feature extraction) can help us to distinguishthe false alarms, although some of the features extracted are either irrelevant or are not cor-related. Therefore, a feature selection must be performed. Depending on the values returnedfor the selected features, we can try to classify each segmented region in one of the followingtwo classes: regular structure or defect. In this section we concentrate on the extraction andselection of features, whereas in the next section we will discuss the classification problem.

16.2.4.1 Feature Extraction

In this section, we will explain the features that are normally used in the classification ofpotential defects. In our description, features will be divided into two groups: geometric andgray value features.� We will use Figure 16.20 as our example in the description of thefeatures.

� A detailed description of these features can be found in Ref. [25].

FIGURE 16.20 Example of a region: (a) x-ray image, (b) segmented region, (c) 3D representation of

the gray values.

FIGURE 16.19 Segmentation by edge detection and region finding: (a) original x-ray image, (b) second

derivate using LoG-operator, (c) zero-crossing image, (d) and (e) detected regions.

FIGURE 16.18 LoG-operator: (a) original x-ray image; edge detection with (b) �¼ 0.8, (c) �¼ 1.3, and(d) �¼ 2.5.

714 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 15: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

Geometric Features: Provide information on the size and shape of the region. Size features,such as area, perimeter, height, and width, are given in pixels. For example, in the region ofFigure 16.20, the area and the perimeter are A¼ 45 and L¼ 24 pixels, respectively. Shapefeatures are usually attributed coefficients without units. An example is roundness that isdefined as:

R ¼4A�

L2ð16:9Þ

The roundness R is a value between 1 and 0. R¼ 1 means a circle, and R¼ 0 corresponds to aregion without area. In our example R¼ 0.98.

Other shape features are obtained by calculating the central moments of the regions, andthe Hu moments [26,27]. These normalized moments are invariant under magnification,translation, and rotation of the region.

Fourier descriptors may also be a good choice for establishing the shape of a region [28].They are computed as the discrete Fourier transformation of the boundary’s coordinates.

Gray Value Features: Gray value features provide information on the brightness of theregion. The mean gray value is defined by

G ¼1

A

Xi, j2<

x i, j½ � ð16:10Þ

where < is the set of pixels of the region, A the area, and x(i, j ) the gray level of pixel (i; j ).A 3D representation of the gray values of the region and its neighborhood of our exampleis shown in Figure 16.20c. In this example, ‘‘0’’ means 100% black and ‘‘255’’ corresponds to100% white. Similarly, one can compute the mean gradient in the boundary and the meansecond derivate in the region. The first feature provides information about the changes in thegray values at the boundary of the region, whereas the second indicates whether the region isbrighter or darker than its surroundings [25].

Contrast is a very important feature in fault detection, as the differences in the grayvalues are good for distinguishing a region from its neighborhood. The smaller the gray valuedifference, the smaller the contrast. There are, however, many definitions of contrast. Someare given in Ref. [29]:

C1 ¼G� GN

GN, C2 ¼

G� GN

Gþ GN, and C3 ¼ ln G=GNð Þ ð16:11Þ

where G and GN denote the mean gray value in the region and in the neighborhoodrespectively. Figure 16.20 is an example of a high contrast region. Additional characteristicsare texture features that take into account the distribution of the gray values in the region[12,30]. Texture features can characterize defects very well, but are heavy on computing time.

16.2.4.2 Feature Selection

In feature selection we have to decide just which features of the regions are relevant to theclassification. The n extracted features are arranged in an n-vector: w ¼ w1 � � � wn½ �

T thatcan be viewed as a point in a n-dimensional space. The features are normalized as:

~wwij ¼wij � �wwj

�jfor i ¼ 1, . . . , N0 and j ¼ 1, . . . , n ð16:12Þ

wij denotes the jth feature of the ith feature vector, N0 is the number of the sample, and �wwj and�j are the mean and standard deviation of the jth feature. The normalized features have zeromean and a standard deviation equal to one.

Image Processing in Aluminum Castings 715

Page 16: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

The key idea of the feature selection is to select a subset of m features (m5 n) that leadsto the smallest classification error. The selected m features are arranged in a new m-vectorz ¼ z1 � � � zm½ �

T. The selection of the features can be done using sequential forwardselection [31]. This method selects the best single feature and then adds one feature at a timethat, in combination with the selected features, maximizes classification performance. Theiteration is stopped once no considerable improvement in the performance is achieved onadding a new feature. By evaluating selection performance we ensure: (a) a small intraclassvariation, and (b) a large interclass variation in the space of the selected features. For the firstcondition the intraclass-covariance is used:

Cb ¼XNk¼1

pk �zzk � �zz½ � �zzk � �zz½ �T

ð16:13Þ

where N means the number of classes, pk denotes the a priori probability of the kth class,�zzk and �zz are the mean value of the kth class and the mean value of the selected features. Forthe second condition the interclass-covariance is used:

Cw ¼XNk¼1

pkCk ð16:14Þ

where the covariance matrix of the kth class is given by:

Ck ¼1

Lk � 1

XLk

j¼1

zkj � �zzk� �

zkj � �zzk� �T

ð16:15Þ

with zkj the jth selected feature vector of the kth class, Lk is the number of samples of thekth class. Selection performance can be evaluated using the spur criterion for the selectedfeatures z:

J ¼ spur C�1w Cb

� ð16:16Þ

The larger the objective function J, the higher the selection performance.

16.2.5 CLASSIFICATION

Once the proper features are selected, a classifier can be designed. Typically, the classifierassigns a feature vector z to one of the two classes: regular structure or flaw, that are assigned‘‘0’’ and ‘‘1,’’ respectively. In statistical pattern recognition, classification is performed usingthe concept of similarity: patterns that are similar are assigned to the same class [31].Although this approach is very simple, a good metric defining the similarity must beestablished. Using a representative sample we can make a supervised classification finding adiscriminant function d(z) that provides us with information on how similar a feature vectorz is to the feature vector of a class. Figure 16.21a shows the case for just one feature.

Some of the most important classifiers in statistical pattern recognition are:

Linear Classifier: In which a linear or quadratic combination of the selected features is usedfor a polynomial expansion of the discriminant function d(z). If d(z)4 � then z is assignedto class ‘‘1,’’ otherwise to class ‘‘0.’’ Using a least-squares approach, function d(z) can beestimated from an ideal known function d�ðzÞ, that has been obtained from the representativesample [4].

716 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 17: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

Threshold Classifier: The decision boundaries of class ‘‘1’’ define a hypercube in featurespace, i.e., if the m features are located between decision thresholds z01 � z1 � z001 and

�z0m � zm � z00mÞ then the feature vector is assigned to class ‘‘1.’’ The thresholds are chosen fromthe representative sample [32].

Nearest Neighbor Classifier: A mean value �zzk of each class of the representative sampleis calculated. A feature vector z is assigned to class ‘‘k’’ if the Euclidean distance z� �zzkk k

is minimal. The mean value �zzk can be viewed as a template [32].

Mahalanobis Classifier: The Mahalanobis classifier employs the same concept as the nearestneighbor classifier. However, it uses a new distance metric called the ‘‘Mahalanobisdistance.’’ The Mahalanobis distance between z and �zzk is defined as:

dk z, �zzkð Þ ¼ z� �zzk½ �TC�1

k z� �zzk½ � ð16:17Þ

The Mahalanobis classifier takes into account errors associated with prediction measure-ments, such as noise, by using the feature covariance matrix to scale features according totheir variances [33].

Bayes Classifier: The feature vector z is assigned to class ‘‘k’’ if the probability that zbelongs to this class is maximal. This conditional probability can be expressed as:

p kjzð Þ ¼p zjkð Þpkp zð Þ

ð16:18Þ

where pðzjkÞ denotes the conditional probability of observing feature vector z given class ‘‘k,’’p(z) means the probability that feature vector z will be observed given no knowledge aboutthe class, and pk is the probability of occurrence of class ‘‘k’’ [32,33].

The effectiveness of the classification can be measured in terms of false positive or falsenegative errors. False positive errors refer to cases where a segmented region is assigned toclass ‘‘defect’’ when it is a regular structure, and false negative errors refer to undetecteddefects. Ideally, both should be zero.

Defining S0 and S1 as the number of regular structures (class ‘‘0’’) and real flaws (class‘‘1’’) existing in the sample, after classification we have the situation where the regular S0

structures are classified as S00 regular structures and S01 defects, i.e., S0¼S00þS01.Similarly, the existing S1 flaws are classified as S10 regular structures and S11 defects, i.e.,S1¼S10þS11 (see Figure 16.21b).

S01 and S10 correspond to false positive and false negative errors, respectively. Suchconcepts are also referred to in literature as the false acceptance rate (FAR) and false rejectedrate (FRR), defined as FAR¼S01/S0 and FRR¼S10/S1. A classification can be tuned to adesired value of FAR. However, by decreasing the FAR of the system, the FRR wouldincrease and vice versa. The receiver operation curve (ROC), illustrated in Figure 16.21c, isa plot of FAR vs. FRR which facilitates an assessment of recognition system performanceat various operating points [31].

16.2.6 FLAW SIMULATION

A good way of assessing the performance of a method for inspecting castings is to exam-ine simulated data. This evaluation allows one the possibility of tuning the parametersof the inspection method and of testing how well the method works in critical cases.

Image Processing in Aluminum Castings 717

Page 18: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

The nondestructive testing and evaluation community use three approaches to produce thissimulated data [34]:

� Mask superimposition onto real x-ray images� CAD models for castings and flaws� CAD models for flaws only and superimposition onto real x-ray images

16.2.6.1 Mask Superimposition

The first technique attempts to simulate flaws by superimposing masks with different grayvalues onto real x-ray images [5,6,35]. This approach is quite simple, as it neither requires acomplex 3D model of the object under test nor of the flaw. It also provides a real x-ray imagewith real disturbances, albeit with simulated flaws.

In this technique, the original gray value I0 of a pixel (u, v) of an x-ray image is altered by:

In u, vð Þ ¼ I0 u, vð Þ 1þM u� u0, v� v0ð Þð Þ ð16:19Þ

with In(u, v) the new grey value and M the mask that is centered in pixel (u0, v0), whereM(i, j )is defined in the interval �n/2� i� n/2 and �m/2� j�m/2. Three typical masks are shownin Figure 16.22. The Gaussian mask achieves the best simulation.

16.2.6.2 CAD Models for Casting and Flaw

The second approach simulates the entire x-ray imaging process [36,37]. In this approach,characteristics of the x-ray source, the geometry, and material properties of objects and theirdefects, as well as the imaging process itself, are modeled and simulated independently.Complex objects and defect shapes can be simulated using CAD models.

FIGURE 16.21 Classification: (a) distribution of the classes using one feature, (b) table of classification

performance, (c) receiver operation curve.

718 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 19: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

The principle of the simulation is shown in Figure 16.23. The x-ray may intersect differentparts of the object. The intersection points between the modeled object with the corre-sponding x-ray beam that is projected into pixel (u, v) are calculated for each pixel (u, v) of thesimulated image.

X-ray attenuation law forms the basis of this simulation approach [38]:

’ ¼ ’0 exp ��xð Þ ð16:20Þ

where ’0 is the incident radiation intensity, ’ the transmitted intensity, x the thickness ofthe object under test, and � the energy dependent linear attenuation coefficient associatedwith the material. According to attenuation law, the gray value of a pixel of the simulatedimage can be computed as:

I ¼ A’0 Eð ÞDO exp �Xi

�i Eð Þxi

!þ B ð16:21Þ

where A and B are linear parameters of I, ’0(E) is the incident radiation intensity with energyE, DO is the solid angle that corresponds to the pixel observed from the source point, �i(E)designates the attenuation coefficient associated with the material i at the energy E, and xi thetotal path length through the material i. Since the x-ray source is modeled as a raster of pointsources, rays from every source point are traced to all pixels of the simulated image.

FIGURE 16.23 X-ray image simulation using CAD models.

FIGURE 16.22 Flaw simulation using (a) square, (b) circle, and (c) Gaussian masks.

Image Processing in Aluminum Castings 719

Page 20: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

A flaw, such as a cavity, can be simulated as a material with no absorption. In Figure 16.4this simulation is shown schematically. An x-ray beam penetrates an object which has acavity with thickness d. In this case, from Equation 16.20 the transmitted radiation ’d isgiven by:

’d ¼ ’ x� dð Þ ¼ ’0 exp ��ðx� d Þð Þ ¼ ’ xð Þ exp �dð Þ ð16:22Þ

where we assume that the absorption coefficient of the cavity is zero. If the flaw is anincrusted material, its absorption coefficient �d must be considered in Equation 16.22:

’d ¼ ’0 exp ��ðx� d Þð Þ exp ��ddð Þ ¼ ’ xð Þ exp dð�� �dÞð Þ ð16:23Þ

Some complicated 3D flaw shapes are reported in Ref. [36]. The defect model is coupled witha CAD interface yielding 3D triangulated objects. Other kinds of flaws like cracks can also beobtained using this simulation technique.

Although this approach offers excellent flexibility for the setting of the objects and flawsto be tested, it has three disadvantages to the evaluation of the inspection methods’ per-formance: (a) the x-ray image of the object under test is simulated (it would be better ifwe could count on real images with simulated flaws); (b) the simulation approach is onlyavailable when using a sophisticated computer package; (c) the computing time is expensive.

16.2.6.3 CAD Models for Flaws Only

This approach simulates only the flaws and not the whole x-ray image of the object under test[39]. This method can be viewed as an improvement of the first-mentioned technique (Section16.2.6.1) and the 3D modeling for the flaws of the second one (Section 16.2.6.2). In thisapproach, a 3Dmodeled flaw is projected and superimposed onto real x-ray images of a homo-geneous object according to the exponential attenuation law for x-rays (Equation 16.20).

The gray value I registered by the CCD-camera can be expressed as a linear function ofthe transmitted radiation ’:

I xð Þ ¼ A’ xð Þ þ B ð16:24Þ

where A and B are the linear parameters of I, and x the thickness of the object under test. Ifthe penetrated object has a cavity with thickness d as shown in Figure 16.4 the transmittedradiation is given by Equation 16.22. In this case the gray value registered by the CCDcamera is calculated then from Equation 16.24 as:

I x� dð Þ ¼ A’ xð Þ exp �dð Þ þ B ð16:25Þ

Substituting the value of A’(x) from Equation 16.24 we see that Equation 16.25 may bewritten as:

I x� dð Þ ¼ IðxÞ � Bð Þ exp �dð Þ þ B ð16:26Þ

Parameter B can be estimated as follows: the maximal gray value Imax in an x-ray image isobtained when the thickness is zero. Additionally, the minimal gray value Imin is obtainedwhen the thickness is xmax. Substituting these values in Equation 16.24, it yields:

Imax ¼ A’0 þ BImin ¼ A’0 exp ��xmaxð Þ þ B

720 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 21: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

From these equations, we may compute the value for B:

B ¼ Imax �DI

1� exp ��xmaxð Þð16:27Þ

where DI¼ Imax� Imin. Usually, Imax and Imin are 255 and 0 respectively.Using Equation 16.26, we can alter the original gray value of the x-ray image I(x) to

simulate a new image I(x�d ) with a flaw. A 3D flaw can be modeled, projected, andsuperimposed onto a real x-ray image. The new gray value of a pixel, where the 3D flawis projected, depends on four parameters: (a) the original gray value I(x); (b) the linearabsorption coefficient of the examined material �; (c) the maximal thickness observable inthe x-ray image xmax; and (d) the length of the intersection of the 3D flaw with the modeledx-ray beam d, that is projected into the pixel. In Ref. [39] an ellipsoidal model for a flawis described in detail. Using this tool a simulation of an ellipsoidal flaw of any size andorientation can be made anywhere in the casting. This model can be used for flaws likeblowholes and other round defects. Two examples are shown in Figure 16.24. The simulatedflaws appear to be real due to the irregularity of the gray values. Other complex defect shapescan be simulated using CAD models.

This technique presents two advantages: simulation is better than with the first technique;and with respect to the second, this technique is faster given the reduced computationalcomplexity. However, the model used in this method has four simplifications that were notpresumed in the second simulation technique: (a) the x-ray source is assumed as a sourcepoint; (b) there is no consideration of noise in the model; (c) there is no consideration of thesolid angle DO of the x-ray beam that is projected onto a pixel; and (d) the spectrum of theradiation source is monochromatic.

16.3 DEFECT DETECTION IN CASTINGS: STATE OF THE ART

In this section different methods for the automated recognition of casting defects using imageprocessing will be presented. These methods have been described in the literature within thepast eighteen years and are considered to be the state of the art in this field. One can see thatthe approaches to detecting can be grouped into three groups [3]:

1. Approaches where a filtering adapted to the structure is performed, which will bedescribed in Section 16.3.1

2. Approaches using pattern recognition, expert systems, artificial neural networks,general filters, or multiple view analyses to make them independent of the positionand structure of the test piece, as described in Section 16.3.2

FIGURE 16.24 Simulated ellipsoidal flaws using the third technique.

Image Processing in Aluminum Castings 721

Page 22: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

3. Approaches using computer tomography to make a reconstruction of the cast pieceand thereby detect defects, as described in Section 16.3.3

16.3.1 REFERENCE METHODS

In reference methods it is necessary to take still images at selected programmed inspectionpositions. A test image is then compared with the reference image. If a significant difference isidentified, the test piece is classified as defective. In order to use a stored reference image(golden image), the distribution of gray values in the image must correlate to the currentimage. This makes a very precise positioning of the piece as well as very strict fabricationtolerances and the reproducibility of the x-ray parameters during imaging indispensable.Small variations in these variables lead to great differences between the two images. Analternative approach was suggested by Klatte (1985), whereby the reference image iscalculated by filtering directly from the test image [40].

A schematic block diagram for this detection method for the automated recognition ofdie casting defects is presented in Figure 16.25. To reduce the noise level, multiple imagestaken in a short period of time are averaged (integration) for each programmed position.As shown in Section 16.2.2.1, to build an arithmetic mean a signal to noise ratio is reachedwhich is proportional to

ffiffiffin

pwith n resulting from the number of images added together.

At first, a defect-free image y is estimated from each integrated x-ray image x using a filter.In this method each test position p has a filter (filterp) which consists of several small masks.The size of these masks and the values for their coefficients should be chosen so that theprojected structure of the test piece at position p coincides with the masks’ distribution. Afterthis, an error difference image x=y is calculated. Casting defects are then detected when asufficiently large difference between x-ray image and reference image occurs. The result of thebinary segmentation is shown as e in Figure 16.25.

16.3.1.1 The MODAN-Filter

The modified median filter,MODAN-Filter, was developed by Heinrich in the 1980s to detectcasting defects automatically [5,6,41]. With the MODAN-Filter it is possible to differentiateregular structures of the casting piece from casting defects.

The MODAN-Filter is a median filter with adapted filter masks. As explained in Section16.2.3.1, a median filter is a ranking operator where the output value is the middle value ofthe input values ordered in a rising sequence. If the background captured by the median filteris constant, it is possible that structures in the foreground will be suppressed if the number ofvalues belonging to the structure is less than one half of the input value to the filter. Thischaracteristic is utilized to suppress the defect structures and to preserve the design featuresof the test piece in the image.

FIGURE 16.25 Reference method for automated detection of casting defects.

722 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 23: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

The goal of the background image function, thus, is to create a defect-free image from thetest image. When calculating the background image function, the MODAN-Filter is used inorder to suppress only the casting defect structures in the test image. Locally variable masksare used during MODAN-Filtering by adapting the form and size of the median filter masksto the design structure of the test piece. This way, the design structure is maintained in thetest image (and the defects are suppressed). Additionally, the number of elements in theoperator are reduced in order to optimize the computing time by not assigning all positionsin the mask (sparsely populated median filter [12]).

Different filter masks are suggested by Heinrich [6]. He has developed automatic andinteractive procedures for selecting the MODAN-Filter masks which takes the adaptation tothe test piece structure into account. In both procedures the testing positions are chosenmanually to ensure that every volume element of the cast piece is inspected. In the automaticprocedure the mask is selected for each pixel, which minimizes an objective function for thesegment of the test piece. Heinrich suggests the following objective function:

Qij d, eð Þ ¼ Qdij d, eð Þ þQs

ij d, eð Þ þQmij d, eð Þ ð16:28Þ

The coordinates of the pixel are given by (i, j ), and (d, e) represent the height and width ofthe mask. Qd, Qs, and Qm denote the detection defects, spurious reading,� and the maskmatrix size, respectively. The error-free reference image is estimated for the three input valuesas follows:

y i, jð Þ ¼ median x1, x2, x3ð Þ ð16:29Þ

with

x1 ¼ x i, jð Þ

x2 ¼ x iþ dij, jþ eij�

x3 ¼ x i� dij, j� eij�

where y(i, j ) are the gray values in the reference image and x(i, j ) in the test image at pixel(i, j ). The filter direction of the masks is determined by the distances dij and eij. Castingdefects are detected when

y i, jð Þ � x i, jð Þ�� ��4�ij ð16:30Þ

This makes it possible to create a good adaptation to the structure of the piece; however, agreater data storage capacity is needed because of the different filter masks used for eachpixel. The storage requirements can be reduced in the interactive procedure by choosing thesame mask for all rectangular areas in the interactive procedure. This means that

dij ¼ dkeij ¼ ek

for i 0k � i � i1k j 0k � j � j1k ð16:31Þ

where i 0k , i1k, j

0k , and j1k define the boundaries of the kth rectangular mask. The adaptation

to the structure is not as exact in this case as in the first procedure.

� For three input values of the MODAN-Filter ðx1,x2, x3Þ the detection error and spurious reading is defined as

x2 � x1j j þ x2 � x3j j and x2 �medianðx1,x2,x3Þ respectively [6].

Image Processing in Aluminum Castings 723

Page 24: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

The interactive procedure is shown in Figure 16.26: for every testing position masks withhorizontal, vertical, and both diagonal filter directions are tested for spurious readings ascompared to a defect-free casting. In this step it is decided which direction will not be applied.Next, the objective function (Equation 16.28) is rated in order to select the best mask. Thefilter masks are to be selected so that variations of the regular structures in the test piece donot lead to spurious readings. Finally, individual filter sectors are combined.

Hecker proposes a method in Ref. [42] for the automatic adaptation of the masks to theregular structures of the test piece. For the correct choice of a mask it is necessary to satisfytwo criteria: (a) the appropriate gray values for the structure in the mask must be constant,and (b) the size of the mask must be at least twice as large as in the extent of the casting defectto be found. To fulfill the first criterion, the mask direction is chosen to be perpendicular tothe direction of the gradient of the piece’s contour. The size of the mask is chosen accordingto the testing specifications for the extent of the expected casting defect. The method is shownin Figure 16.27 (compare with Figure 16.25). Only four directions of the gradient are applied:[0–180], [45–225], [90–270], and [135–315], which are shown as four different grayvalues in Figure 16.8. The method generates rectangular regions as appropriate test regions,which have masks with identical directions and sizes.

In Ref. [35] Hecker improved the automatic parameterization of the MODAN-Filter. Themethod which he calls optimized MODAN-Filtering allocates to each pixel the mask from amask pool which gives the smallest amplitude error. For this search, representative pieceimages are used which were taken of the same piece at the same position. The amplitude erroris described by Hecker as the difference between the true expanse of the error depth from the

FIGURE 16.27 Automatic mask selection for MODAN-Filter and detection. (From Ref. [42]. With

permission.)

FIGURE 16.26 Interactive method for mask selection in a MODAN-Filter.

724 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 25: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

detected value. The pool mentioned above includes 128 different masks with three inputvalues. The masks are distributed among sixteen different mask sizes (16, 17, . . . , 31 pixels)along eight different directions ([0–180], [22.5–202.5], . . . , [157.5–337.5]).

16.3.1.2 Signal Synchronized Filter

Hecker developed the signal synchronized filter in Ref. [35] to calculate the background imagefunction. This method generalizes the equation used for the MODAN-Filter (Figure 16.26):

y i, jð Þ ¼ median x i, jð Þ, x iþ dij1, jþ eij1�

, . . . , x iþ dijns , jþ eijns� � �

ð16:32Þ

where the filter parameters (dijk, eijk) are chosen so that the objective function

Qijk dijk, eijk�

¼XNR

m¼1

xm i, jð Þ � xm iþ dijk, jþ eijk� � �2

ð16:33Þ

is minimized when the condition ðdijk, eijkÞ 6¼ ðdl, eijlÞ and dijk, eijk4�min for k, l ¼ 1, . . . , nswith k 6¼ l. The objective function considers NR representative piece images fx1g, . . . , fxNR

g,which were obtained from the same cast piece and same position. During the experimentsonly three input values (ns¼ 2) are processed (see Figure 16.28). In order to determine theparameters, the number of representative piece images reportedly required is 20�NR� 30.

Beyond this, Hecker developed the weighted median operator, in which the input valuex iþ dijk, jþ eijk�

is entered via

aijk � x iþ dijk, jþ eijk�

þ bijk

in Equation 16.32 for k ¼ 1, . . . , ns. For the case of the weighted median operator, theobjective function is:

Qijk aijk, bijk, dijk, eijk�

¼XNR

m¼1

A� aijk Bþ bijk� �2

ð16:34Þ

FIGURE 16.28 Weighted synchronized filtering (for unweighted filters aijk¼ 1 and bijk¼ 0).

Image Processing in Aluminum Castings 725

Page 26: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

with:

A ¼ xm i, jð Þ

B ¼ xm iþ dijk, jþ eijk�

Once (dijk, eijk) are identified in Equation 16.34, one can calculate the coefficients (aijk, bijk) tominimize the objective function by linear regression:

aijk ¼NR

PAB�

PAP

B

NR

PB2 �

PB

� 2bijk ¼

PAP

B2 �P

ABP

B

NR

PB2 �

PB

� 2ð16:35Þ

with summations from m¼ 1 to m¼NR. Since the coefficients (aijk, bijk) are dependent ondijk and eijk, the optimization problem can be formulated, so that the objective function isonly a function of the distance parameter (dijk, eijk).

As the absolute minimum of the objective function is found by searching, the deter-mination of the filter parameters presents an enormous computational effort. To para-meterize the filter at N positions of the test piece, NR representative piece images per position,and NI�NJ pixels per image one requires NN2

I N2JNR comparative operations. When using

the weighted median operator, another 8þ 2NR multiplications and 3þ 3NR summationsmust be performed for each comparison to determine the parameters a and b in Equation16.35. Typically, the search for optimal parameters for a test piece takes several weeks. Toreduce the computing time Hecker recommends, among other things, that the referenceimages be subsampled and the reference area be limited where the optimal distance betweend and e are sought. Obviously, there must be a compromise between the reduction ofcomputing time and the robustness of the detection. For this reason the reduced computingtime required for a robust detection is not yet acceptable for industrial application.

16.3.1.3 The PXV 5000 Radioscopic Test System

The radioscopic test system PXV 5000 was developed in the early 1990s by Philips IndustrialX-ray GmbH as a fully automatic radioscopic testing device [1,43]. The system was furtherdeveloped by YXLON International X-ray GmbH.�

The testing system evaluates a random sample of a defect-free test piece in a learningprocess. Every structure and every irregularity that the system finds in the test piece isclassified as a regular structure and entered into an appropriate library [44]. The essentialsteps in the PXV 5000 system (see block diagram in Figure 16.29) are discussed below [2]:

Integration: To suppress the noise level, depending on the application, 4 to 16 x-ray imagesare integrated at the same test piece position.

Filtering: The PXV 5000 makes the application of up to eight processing steps per position,in which different filters can be selected from a long list of filter algorithms and masks whichcan be combined freely. In this way, a defect-free x-ray image can be identified in the testimage. A difference image is generated from the comparison of both images.��

� The company YXLON International X-ray GmbH was created in 1997 from the German company Philips X-ray

GmbH and the Danish company Andrex GmbH.�� A new filtering approach – called AI (Automatic Inspector) – based on neural networks has been recently

developed by YXLON [45,46].

726 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 27: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

Masking: In this step, all irrelevant structures are removed which are located outside of afreely definable mask.

Segmentation: Using a two-threshold procedure, potential defect structures are segmented.The higher threshold value serves to detect the potential defect and the lower to detect theprojected size in the image.

Feature extraction: Features are extracted (e.g., center, area, perimeter, Feret coordinates,�

measure of compactness, extent, minimum, maximum, and average gray level value) from thesegments which describe their properties.

Matching and classification: By comparison of the model’s features from which they wereextracted during the learning process and stored in a library, it is possible to eliminate theregular structures of the piece.

According to YXLON, only three defects were detected during the inspection of600 aluminum die cast pieces. Furthermore, all casting defects larger than 1.56mm2 weredetected.

16.3.1.4 Radioscopic Testing System SABA 2000T

The fully automatic radioscopic examination device Seifert Automatic Image Evaluation(SABA) was developed in the late 1980s by the company Rich. Seifert & Co. [47]. Continualimprovements in mechanical drives and computer speeds by Seifert made it possible todevelop the radioscopic examination device SABA-2000 in the year 1994 [48] and the SABA-2000T in 1998 [49], which reached higher digital image resolutions and faster testing speeds.According to the Seifert company, as reported in Ref. [34], the detection approach used in theSABA series has remained unchanged, as it is based on an optimization of the MODAN-Filter (see Section 16.2.1), as developed in the 1980s for the approximation of a defect-freex-ray image. The detection of casting defects is performed as in Figure 16.25. This testingsystem determined only two deviations during the inspection with 1034 concurring decisions[47,50].

16.3.2 METHODS WITHOUT A PRIORI KNOWLEDGE

Methods will be described in this section which can detect casting defects in a test piecewithout prior knowledge of the piece’s structure.

16.3.2.1 ISAR Radioscopic Testing System

The Intelligent System for Automated Radioscopic testing (ISAR) was developed by theFraunhofer Institute for Integrated Circuits (IIS-A) in the 1990s [51,52]. Inspection is

� Coordinates of the lower left corner and upper right corner for the smallest rectangle circumscribing the segment.

FIGURE 16.29 Block diagram of the detection approach used in the PXV 5000.

Image Processing in Aluminum Castings 727

Page 28: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

performed with the aid of a COMMED-Filter (COMbined MEDianfilter), also developed bythe Fraunhofer Institute.

The die cast pieces are identified by the system, so that an examination specifically forthat piece can be performed. After the die cast piece is identified, x-ray parameters, testingcriteria, translocation of the handling device, and inspection positions are selected.

According to IIS-A, the COMMED-Filter can detect casting defects without a prioriknowledge of the test piece structure. The algorithm can differentiate between the structure ofthe test piece (edges, corners, bore holes, etc.) and structures which are not part of the piece.During the testing of wheel rims, for example, the time for image analysis for an aluminumwheel with a diameter of 1700 was about 35 sec for the required 25 different positions.

16.3.2.2 Gayer et al.’s Method

This method for defect detection was originally published in 1990 by Gayer et al. for thetesting of welding seams [53]. But the algorithm can also be used for the recognition ofcasting defects. The proposed method can be summarized as having two steps:

1. A quick search for potential defects in the x-ray image: assuming that the defectswill be smaller than the regular structure of the test piece, potential defects areclassified as those regions of the image where higher frequencies are significant.The spectrum of the x-ray image is determined with the help of a fast Fouriertransformation, which is calculated either row by row or column by column in little32� 32 windows. When the sum of the higher frequencies of a window is greaterthan a given threshold value, the entire window is marked as potentially defective.Another possibility is suggested by the authors as part of this task: a window isselected as potentially defective when the sum of the first derivative of the rows andcolumns of a window is large enough.

2. Identification and location of the true defect: because of the time consuming natureof this step, only those regions which were previously classified as being potentiallydefective are studied here. Two algorithms were developed here as well. The firstleads to a matching� between the potential defect and typical defects which arestored in a library as templates. Whenever a large resemblance between thepotential defect and a template is found, the potential defect is classified as a truedefect. The second algorithm estimates a defect-free x-ray image of the test piece bymodeling every line of an interpolated spline function without special considerationfor the potentially defective region. Following this, the original and the defect-free images are compared. True defects are identified when large differences occurcompared to the original input image.

16.3.2.3 Kehoe and Parker’s Method

In 1992 Kehoe and Parker presented in Ref. [54] an intelligent, knowledge-based castingdefect detection which utilizes an image processor and an expert system to automaticallyrecognize die casting defects. The method consists essentially of two steps:

Detection and Analysis: At first, possible defects are segmented in small regions by adaptivethresholding [30]. Then the detected possible defects are fused by dilation and erosion(closing) [12]. Finally, geometric characteristics are extracted from the fused regions.

Classification: By using an expert system the regions are segregated into defect classes, e.g.,bubbles, slack, cracks, etc.

� Matching is performed with a Sequential Similarity Detection method.

728 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 29: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

This system was investigated in the laboratory with eight x-ray images and comparedwith visual detection. The automated detector was able to identify more defects than humanoperators could find. The difficulty with this method lies in the creation of a knowledge databank which includes all possible defects.

16.3.2.4 Boerner and Strecker’s Method

At the end of the 1980s Boerner and Strecker presented in Ref. [4] a method for theautomated casting defect recognition which they had developed on their own at the PhilipsResearch Laboratory in Hamburg. As usual, the method is centered on the analysis ofindividual x-ray images taken at the desired position of the test piece. After improving theimage quality with a look-up-table [12] and shading correction (see Section 16.2.2.3), theprocedure extracts the feature to be segmented in every pixel of the x-ray image.

A classifier is designed to segregate every pixel (i, j ) into class k. There are typically onlytwo classes: the class k¼ 1 for a regular structure of the piece and the class k¼ 2 for defects.In general, the method is valid for NK classes.

With the help of a decision function, the image’s pixels are classified. The decisionfunctions are calculated as linear functions with the features:

dk i, jð Þ ¼ ak0 þXnp¼1

akpzp i, jð Þ ð16:36Þ

or as quadratic functions with the features

dk i, jð Þ ¼ ak0 þXnp¼1

akpzp i, jð Þ þXnp¼1

Xnq¼p

ak, p, qzp i, jð Þzq i, jð Þ ð16:37Þ

for k ¼ 1, . . . ,NK. Here zpði, jÞ are the values of the pth extracted feature of the pixel (i, j ) forp ¼ 1, . . . , n and ak0, ak1, . . . are the linear parameters in the decision function. Using a linearregression, these parameters are determined in a learning phase by minimization of thequadratic distance between dkði, jÞ and the idealized decision function d �

k ði, jÞ. The functiond �k ði, j Þ is determined manually out of a random learning sample and assumes the value of 1

or 0 depending on whether the pixel ði, j Þ belongs to class k or not.Once the classifier has been learned, a pixel (i, j ) in a test image is placed in class

k when dk i, jð Þ � dk0 i, jð Þ4�k, for k0 ¼ 1, . . . ,NK where �k is the threshold value for thepth class.

Following this, the defective neighboring pixels are combined to build regions. Finally, aregion is detected as being defective if it has a circular form and covers a large enough area.

Boerner and Strecker suggested that the difference between the original image and itsimage filtered by a DoG� or median methods and the rotation invariant Zernike feature benamed pixel features. The latter designates the use of the gray value of the pixel relative toits surroundings developed in a series of Zernike polynomes [56]. According to the authors,92% of all defects were recognized with less than 4% false detection in an inspection of 200die cast pieces. However, the method can only detect circular defects.

� The DoG (Difference of Gaussians) filter is calculated as the difference between two Gauss filters. This filtration

corresponds to a band pass filter [12,55].

Image Processing in Aluminum Castings 729

Page 30: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

16.3.2.5 Lawson and Parker’s Method

In 1994 Lawson and Parker proposed in Ref. [57] that artificial neural networks (ANN) beused for the automated detection of defects in x-ray images. The method generates a binaryimage from the test image where each pixel is either 0 when a regular structure feature of thepiece or 1 when a defect is detected. This entails the supervised learning of a multi-layerperceptron network (MLP) where the attempt is made to obtain a detection from trainingdata. A back propagation algorithm is used for the assignment of weightings within theMLP [58].

The authors use one of two hidden layers in the network topography of the ANN, wherethe input signal corresponds to a window of m�m gray values in the x-ray image. The outputsignal is the pixel at the image center in the binary image. Since the threshold value functionfor the neurons are sigmoidal in this method, a threshold is used to obtain a binary outputsignal.

The two hidden layers each have ten cells. During the investigation it was determined thatthe size of the window for the input signal must be larger than 7� 7 (m4 7), otherwise,convergence will not be obtained in the learning phase. A group of 50,000 randomly chosenwindows were used as the basis of the training data.

The desired detection in the training data was obtained with a segmenting procedurebased on an adaptive threshold. During the experiments of five x-ray images, Lawson andParker show that the detection using ANN is superior to the segmenting method usingadapted thresholds. The defects were found successfully and there were no false detections.

16.3.2.6 Mery and Filbert’s Method

A new method for the automated inspection of aluminum die cast pieces with the aid ofmonocular x-ray image sequences was presented recently by Mery and Filbert [21,22,59]. Theprocedure is able to perform casting defect recognition in two stages with a single filter andwithout a priori knowledge of the test piece structure automatically.

In the first step, an edge detection procedure based on the Laplacian-of-Gaussian isemployed to find abrupt changes in gray values (edges) in every x-ray image. Here, the zerocrossings of the second derivative of the Gauss low-pass filtered image are detected [12].These edges are then utilized to search for regions with a certain area and a high contrast levelcompared to their surroundings,� as shown in Section 16.2.3.2.

In the second step, the attempt is made to track the hypothetical casting defects in thesequence of images. False detections can be eliminated successfully in this manner, since theydo not appear in the following images and, thus, cannot be tracked. In contrast, the truecasting defects in the image sequence can be tracked successfully because they are located inthe position dictated by the geometric conditions.

The tracking of the hypothetical casting defects in the image sequence is performedaccording to the principle of multiple view analysis [60–62]. Multi-focal tensors are appliedto reduce the computation time. Following a 3D reconstruction of the position of thehypothetical casting defect tracked in the image sequence, it is possible to eliminate thosewhich do not lie within the boundaries of the test piece.

The elements of this method were tested in a laboratory prototype on real and simulatedcases and the preliminary results of detection experiments are promising (100% of all castingdefects recognized in 16 image sequences with no false detections). Above and beyond this,the required computing time is acceptable for practical applications. As the performance of

� Other methods for segmenting hypothetical casting defects, such as in the PXV 5000 (see Section 16.3.1.3), could be

used in this first step [2].

730 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 31: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

this method has only been tested on a limited number of image sequences, it will be necessaryto analyze a broader databank.

16.3.3 INDUSTRIAL COMPUTER TOMOGRAPHY

Another method for the automated detection of casting defects is the (x-ray) computertomography, which also analyzes the weakening of x-rays as they pass through an object.In contrast to radioscopic testing, two-dimensional computer tomography produces a cross-section of the test piece�: two-dimensional images of a flat slice through the investigatedobject are created out of one-dimensional projections. The projections show the profiles ofx-rays weakened by the object, which are measured as a function angularly dependent of theabsorption. The emitter must be led around the object in the plane of interest (or the object isrotated) to obtain measurements at different angular positions. This differentiates computertomography from traditional radioscopic techniques, where the irradiated image is a two-dimensional projection of the object under investigation. The structures contained in theplane of radiation at different depths within the object can be displayed in the cross-sectionalimage of the computer tomographic reconstruction without overlap (see Figure 16.30).

For the calculation of the object’s cross-sectional plane from the measured projections, agreat number of algorithms are available which can be classified in general as transformationmethods or series development approaches. The methods used in nondestructive materialstesting typically belong to the transformation methods. These are based on the projectionslice theorem, which states that a one-dimensional Fourier transformation of a projection P�

at the angle � is equal to the two-dimensional Fourier transformation of the object functionalong a straight line through the origin in Fourier coordinates at the angle � [63,64] (seeFigure 16.31). The projection P� as a function f(x, y) here at the angle � is designated asthe entirety of all line integrals of this angle. A line integral P� along a straight line l fromA to B is defined as

p� rð Þ ¼

Zl

f x, yð Þ ds ð16:38Þ

� The word ‘‘tomography’’ is derived from the Greek words � �oo�o& and graphos and is equivalent to cross-sectional

image. The term ‘‘computer’’ corresponds more directly to computation than computer as such.

FIGURE 16.30 Comparison between a conventional x-ray image and the result of a computer

tomographic reconstruction.

Image Processing in Aluminum Castings 731

Page 32: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

where f (x, y) describes the two-dimensional distribution of the x-ray absorption coefficientin the cross-section of the irradiated object, and the straight line l describes the path of asingle monoenergetic x-ray beam from the x-ray source through the object to the detectorelement. The x-ray beam is weakened according to the corresponding law of radiationabsorption:

I ¼ I0 exp �

Zl

� x, yð Þ ds

� �ð16:39Þ

where �(x, y) describes the two-dimensional distribution of the x-ray absorption coefficientwhich corresponds to the image function f (x, y). In Equation 16.39 I0 stands for the radiationemitted from the x-ray source and I is the radiation incident on the detector after beingweakened by the object. After rearranging Equation 16.39, the value measured at the detectorresults:

p� ¼ lnI0I

� �¼

Zl

� x, yð Þ ds ð16:40Þ

A projection P� at the angle � is obtained through realization of a parallel beam geometry,e.g., by shifting the radiation emitter-detector arrangement radially after each measurement.The reconstruction of the object function f(x, y) from its projections presents a typical inverseproblem [65].

In practice, however, these ideal conditions cannot be realized [66]. Only a limitednumber of projection measurements are available for reconstruction, and these are generatedfrom a limited number of line integrals. And thus, a two-dimensional function cannot beuniquely defined. Different image functions can always be created which possess the sameprojection.

For three-dimensional computer tomography, methods are used which analyze two-dimensional projections.� Feldkamp describes a mathematical method in Ref. [67] for the

� The problems founded in the principle of tomography persist: three-dimensional results also exhibit a dimension

one higher than the projections which are analyzed (two-dimensional ‘‘images’’).

FIGURE 16.31 Projection slice theorem.

732 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 33: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

calculation of three-dimensional results with a cone beam projection. Other methods adhereto another approach, whereby the results of conventional 2D tomography are layered on topof each other according to their respective positions in the object and the values between theindividual (reconstructed) object planes are interpolated.

Common to all of the methods using transformation is the use of filters with lowpasscharacteristics. This has a negative impact especially on the use in casting piece inspection,since great discontinuities in the measured values result from the object edges in theprojections (highly absorptive material next to hollow spaces in the design). This leads tolarge artifacts, which can make image analysis impossible. In order to obtain high localresolution in the reconstructed object, it is desirable that the x-ray tube have as small a focalpoint as possible. In microfocus computer tomography (mCT) resolutions on the order of afew mm are obtainable. To penetrate the aluminum die cast pieces with relevant materialthickness for use in the automotive industry, a minimum energy level is needed which liesabove the specifications of most microfocal tubes. The problem posed lies in the heatremoval, which must occur rapidly enough that any possible damage to the tube is prevented.

Furthermore, computer tomography is a very time intensive process requiring a minimummeasurement time for adequate signal to noise ratios as well as a minimum number ofprojections for the desired local resolution. As a result of the physical reasons which dictatethat a minimum measurement time be given for each angular position, the only remainingway to reduce the measurement time is to reduce the number of measurement positions.In those cases where measurement data are lacking, one speaks of a ‘‘limited data problem’’[68]. Apart from the reduced measurement time, it can be desirable in industrial applicationsto analyze only selected projections for reconstruction. Reasons for these selections maylie both in the difficulty in obtaining data for certain angular positions or regions and inthe projections of certain objects which are unsuitable for analysis (e.g., polyvalent x-rayabsorption properties, inadequate signal to noise ratio for all angular positions). No indus-trial applications are known to the authors for this area of ‘‘limited data problems.’’ Researchwork is underway with different approaches to optimizing the computations as well asmodifications to known algorithms.

16.4 CONCLUSIONS

In this chapter, we have discussed the use of image processing as a tool in the automateddetection of faults in aluminum castings. We also presented an overview of the theory ofimage processing that it normally entails.

Additionally, the fundamental principles of various methods for the automated detectionof die casting defects have been explained. These methods have been published over the pasteighteen years and plot industry and academic development of the sector.

The detection approaches were, roughly speaking, divided into three groups: referencemethods, methods without a priori knowledge, and computer tomography.

Methods from the first group have become the most widely established in industrialapplications owing to their high detection performance. Complicated filtering, which istailored to the test piece, hinders these methods, however. Typically, this optimization processtakes two or more weeks, depending on whether it is performed manually or automatically.

The existence of common properties that define all casting defects well and also differ-entiate them from design features of the test pieces are prerequisites for using methods fromthe second group. These prerequisites are often only fulfilled in special testing situations.

The industrial use of computer tomography for the inspection of die cast parts for theautomotive industry is currently limited to materials research and development as well as tothe inspection of especially important and expensive parts [69,70]. Such systems require

Image Processing in Aluminum Castings 733

Page 34: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

considerable time for measurements and economically priced systems also have insufficientresolution to detect small defects.

REFERENCES

1. Kosanetzky, J.-M. and Putzbach, H., Modern x-ray inspection in the automotive industry. In

Proc. 14th World Conference of NDT (14th–WCNDT), New Delhi, Dec. 8–13, 1996.2. Mery, D., Filbert, D., and Parspour, N., Improvement in automated aluminum casting inspec-

tion by finding correspondence of potential flaws in multiple radioscopic images. In Proceedings

of the 15th World Conference on Non-Destructive Testing (15th–WCNDT), Rome, Oct. 15–21,2000.

3. Mery, D., Jaeger, Th., and Filbert, D., Automated quality control of castings – state of the art.

tm – Technisches Messen, 68(7–8), 2001 (in German).4. Boerner, H. and Strecker, H., Automated x-ray inspection of aluminum casting. IEEE Trans.

Pattern Analysis and Machine Intelligence, 10(1), 79–91, 1988.5. Filbert, D., Klatte, R., Heinrich, W., and Purschke, M., Computer aided inspection of castings.

In IEEE-IAS Annual Meeting, pp. 1087–1095, Atlanta, USA, 1987.6. Heinrich, W., Automated Inspection of Castings using X-Ray Testing. PhD thesis, Institute

for Measurement and Automation, Faculty of Electrical Engineering, Technical University of

Berlin, 1988 (in German).7. Brandt, F., The use of x-ray inspection techniques to improve quality and reduce costs.

The e-Journal of Nondestructive Testing & Ultrasonics, 5(5), May 2000.

8. Mery, D., Jaeger, Th., and Filbert, D., Fully automated x-ray inspection: Non-destructivetesting in industrial applications. Materialprufung, 43(11–12), 433–441, 2001 (in German).

9. Jaeger, Th., Heike, U., and Bavendiek, K., Experiences with an amorphous silicon arraydetector in an ADR application. In International Computerized Tomography for Industrial

Applications and Image Processing in Radiology, DGZfP Proceedings BB 67-CD, pp. 111–114,Berlin, March 15–17, 1999. Deutsche Gesellschaft fur Zerstorungsfreie Prufung e.V.

10. Bavendiek, K., Krause, A., and Beyer, A., Durchsatzerhohung in der industriellen

Rontgenprufung – Eine Kombination aus innovativem Prufablauf und optimierter Bildaus-wertung. In DGZfP Jahrestagung, volume Berichtsband 63.1, pp. 301–306, Bamberg, 7–9 Sept.1998. Deutsche Gesellschaft fur Zerstorungsfreie Prufung e.V.

11. Halmshaw, R., Non-Destructive Testing. London: Edward Arnold, 2nd edition, 1991.12. Castleman, K.R., Digital Image Processing. Englewood Cliffs, New Jersey: Prentice-Hall, 1996.13. MathWorks Inc., Image Processing Toolbox for Use with MATLAB: User’s Guide.

The Math-Works Inc., January 1998.14. Andrews, H. and Hunt, B., Digital Restoration. Prentice-Hall, NJ: Englewood Cliffs, 1977.15. Bates, R. and McDonnell, M., Restoration and Reconstruction. The Oxford Engineering Science

Series; 16. New York: Oxford University Press, 1986.

16. Purschke, M., Verbesserung der Detailerkennbarkeit in Rontgendurchleuchtungsbildern durchdigitale Bildrestauration. PhD thesis, Institut fur Allgemeine Elektrotechnik, TechnischeUniversitat Berlin, 1989.

17. Mery, D. and Filbert, D., Restauration bewegungsunscharfer Rontgenbilder. In Berichtsbandder Jahrestagung der Deutschen, Osterreichischen und Schweizerischen Gesellschaft furZerstorungsfreie Prufung (DACH), Innsbruck, Austria, 29–31 May 2000.

18. Mery, D. and Filbert, D., A fast non-iterative algorithm for the removal of blur causedby uniform linear motion in x-ray images. In Proceedings of the 15th World Conference onNon-Destructive Testing (15th–WCNDT), Rome, Oct. 15–21, 2000.

19. Sondhi, M., Image restoration: The removal of spatially invariant degradations. Proc. IEEE,60(7), 842–853, 1972.

20. Gonzalez, R. and Wintz, O., Digital Image Processing. Massachusetts: Addison-WesleyPublishing Co., 3rd edition, 1991.

21. Mery, D., Automated Flaw Detection in Castings from Digital Radioscopic Image Sequences.Verlag Dr. Koster, Berlin, 2001 (Ph.D. Thesis in German).

734 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 35: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

22. Mery, D. and Filbert, D., Flaw tracking in a sequence of digital x-ray images: A new method

of automated quality control of castings. tm – Technisches Messen, 67(4), 160–165, 2000(in German).

23. Marr, D. and Hildreth, E., Theory of edge detection. Proc. Roy. Soc. London, B(207), 187–217,1980.

24. Faugeras, O., Three-Dimensional Computer Vision: A Geometric Viewpoint. Cambridge, MA,London: The MIT Press, 1993.

25. Mery, D. and Filbert, D., Classification of potential defects in automated inspection of

aluminium castings using statistical pattern recognition. In 8th European Conference onNon-Destructive Testing (ECNDT 2002), Barcelona, 17–21 Jun, 2002.

26. Hu, M.-K., Visual pattern recognition by moment invariants. IRE Trans. Info. Theory IT(8),

179–187, 1962.27. Sonka, M., Hlavac, V., and Boyle, R., Image Processing, Analysis, and Machine Vision. Pacific

Grove, CA, PWS Publishing, 2nd edition, 1998.28. Persoon, E. and Fu, K.S., Shape discrimination using Fourier descriptors. IEEE Trans.

Systems, Man, and Cybernetics, SMC-7(3), 170–179, 1977.29. Kamm, K.-F., Grundlagen der Rontgenabbildung. In Ewen, K., editor, Moderne Bildgebung:

Physik, Geratetechnik, Bildbearbeitung und -kommunikation, Strahlenschutz, Qualitatskontrolle,

pp. 45–62, Stuttgart, New York: Georg Thieme Verlag, 1998.30. Jahne, B., Digital Image Processing. Berlin, Heidelberg Springer: 4th edition, 1997.31. Jain, A.K., Duin, R.P.W., and Mao, J., Statistical pattern recognition: A review. IEEE Trans.

Pattern Analysis and Machine Intelligence, 22(1), 4–37, 2000.32. Fukunaga, K., Introduction to Statistical Pattern Recognition. San Diego: Academic Press, Inc.,

2nd edn, 1990.

33. Ruske, G., Automatische Spracherkennung. Munchen–Wien: Oldenburg, 1988.34. Mery, D., Flaw simulation in castings inspection by radioscopy. INSIGHT, Journal of the

British Institute of Non-Destructive Testing, 43(10), 664–668, 2001.35. Hecker, H., A New Method to Process X-Ray Images in the Automated Inspection of Castings.

PhD thesis, Institute for Measurement and Automation, Faculty of Electrical Engineering,Technical University of Berlin, 1995 (in German).

36. Tillack, G.-R., Nockemann, C., and Bellon, C., X-ray modelling for industrial applications.

NDT&E International 33(1), 481–488, 2000.37. Freud, N., Duvauchelle, P., and Babot, D., Simulation of x-ray NDT imaging techniques.

In Proceedings of the 15th World Conference on Non-Destructive Testing (15th–WCNDT),

Rome, Oct. 15–21, 2000.38. Haken, H. and Wolf, H.C., The Physics of Atoms and Quanta: Introduction to Experiments and

Theory. Berlin, Heidelberg: Springer, 5th edition, 1996.39. Mery, D., A new algorithm for flaw simulation in castings by superimposing projections of 3D

models onto x-ray images. In Proceedings of the XXI International Conference of the ChileanComputer Science Society (SCCC-2001), pp. 193–202, Punta Arenas, 6–8 Nov. 2001. IEEEComputer Society Press.

40. Klatte, R., Computer aided X-ray testing for objective quality control of workpieces. PhD thesis,Institute for Measurement and Automation, Faculty of Electrical Engineering, TechnicalUniversity of Berlin, 1985 (in German).

41. Heinrich, W., Ein zeitoptimaler Rangordnungsoperator fur die Automatisierung derradiologischen Gußteilprufung. Technischer Bericht 123, Institut fur Allgemeine Elektrotech-nik, Technische Universitat Berlin, 1987.

42. Hecker, H. and Filbert, D., Rontgendurchleuchtungsprufung: Automatische Anpassung einesPrufsystems an Prufaufgaben. In DGZfP Jahrestagung, volume Berichtsband 33.2, pp. 655–660,Fulda, 27–29 April 1992. Deutsche Gesellschaft fur Zerstorungsfreie Prufung e.V.

43. Hecker, H., PXV 5000.2, Vollautomatische Rontgenprufung, Bedienungsanleitung. Technischer

Bericht, Philips Industrial X-Ray GmbH, Hamburg, 1996.44. Kosanetzky, J.-M., Optimierung des Produktionsprozesses in der Gießerei-Industrie durch

vollautomatische Rontgenprufung. In DGZfP Jahrestagung, volume Band 59.2, Dresden, 1997.

Deutsche Gesellschaft fur Zerstorungsfreie Prufung e.V.

Image Processing in Aluminum Castings 735

Page 36: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

45. Theis, G. and Kahrs, T., Vollautomatische Inline-Rontgenprufung von Aluminumradern.

In DGZfP Jahrestagung, Berlin, 21–23 Mai 2001. Deutsche Gesellschaft fur ZerstorungsfreiePrufung e.V.

46. YXLON, The new image of automatic defect recognition. Technical Articles of YXLONInternational, 2002. http://www.yxlon.com.

47. Schaefer, M. and Purschke, M., Vollautomatische Rontgenprufung – zuverlassig undwirtschaftlich. Sonderausdruck der Zeitschrift ‘Qualitat und Zuverlassigkeit’ 36(7), 1991.Munchen.

48. Purschke, M. and Schulenburg, H., Neue Moglichkeiten der objektiven Durchleuchtungs-prufung. In DGZfP Jahrestagung, pp. 145–151, Timmendorfer Strand, 9–11 Mai 1994. DeutscheGesellschaft fur Zerstorungsfreie Prufung e.V.

49. Purschke, M. and Schulenburg, H., Fortschritte der vollautomatischen Rontgenprufung.In DGZfP Jahrestagung, volume Berichtsband 63.1, pp. 309–317, Bamberg, 7–9 Sept. 1998.Deutsche Gesellschaft fur Zerstorungsfreie Prufung e.V.

50. Deutsche Gesellschaft fur Zerstorungsfreie Prufung e.V, Radioskopie, Unterlagen fur den

Grundkurs Stufe 2. Deutsche Gesellschaft fur Zerstorungsfreie Prufung e.V., 1996. RS2 2.96.51. Wenzel, T., ISAR: Ein intelligentes System zur automatischen Rontgenprufung. Fraunhofer –

Institut fur Integrierte Schaltungen, Erlangen, 1996.

52. Wenzel, T. and Hanke, R., Fast image processing on die castings. In Anglo-German Conferenceon NDT Imaging and Signal Processing, Oxford, 27–28 March, 1998.

53. Gayer, A., Saya, A., and Shiloh, A., Automatic recognition of welding defects in real-time

radiography. NDT International 23(4), 131–136, 1990.54. Kehoe, A. and Parker, G.A., An intelligent knowledge based approach for the automated

radiographic inspection of castings. NDT & E International 25(1), 23–36, 1992.

55. Canny, J., A computational approach to edge detection. IEEE Trans. Pattern Analysis andMachine Intelligence, PAMI-8(6), 679–698, 1986.

56. Wallin, A. and Kubler, O., Complete sets of complex Zernike moment invariants and therole of the pseudoinvariants. IEEE Trans. Pattern Analysis and Machine Intelligence, 17(11),

1106–1110, 1995.57. Lawson, S.W. and Parker, G.A., Intelligent segmentation of industrial radiographic images

using neural networks. In Machine Vision Applications and Systems Integration III, Proc. of

SPIE, volume 2347, pp. 245–255, November 1994.58. Bothe, H.-H., Neuro-Fuzzy-Methoden: Einfuhrung in Theorie und Anwendungen. Berlin,

Heidelberg: Springer, 1998.

59. Mery, D. and Filbert, D., Automated inspection of moving aluminium castings. In 8th EuropeanConference on Non-Destructive Testing (ECNDT 2002), Barcelona, 17–21 June 2002.

60. Hartley, R., Lines and points in three views and the trifocal tensor. International Journalof Computer Vision, 22(2), 125–150, 1997.

61. Hartley, R.I. and Zisserman, A., Multiple View Geometry in Computer Vision. Cambridge:Cambridge University Press, 2000.

62. Mery, D. and Filbert, D., The epipolar geometry in the radioscopy: Theory and application.

at – Automatisierungstechnik, 48(12), 588–596, 2000 (in German).63. Bracewell, R.N., Strip integration in radio astronomy. Astrophysical Journal of Physics, 9,

198–217, 1956.

64. Radon, J., Uber die Bestimmung von Funktionen durch ihre Integrale langs gewisserMannigfaltigkeiten. Ber. Sachs. Akad. Wiss., Math. Phys. Kl.(69), 262–277, 1917.

65. Groetsch, C.W., Inverse Problems in the Mathematical Sciences. Wiesbaden: Vieweg,

Braunschweig, 1993.66. Kak, A.C. and Slaney, M., Principles of Computerized Tomographic Imaging. New York: IEEE,

1988.67. Feldkamp, L.A., Davis, L.C., and Kress, J.W., Practical cone-beam algorithm. Journal of the

Optical Society of America A-Optics Image Science and Vision, 1(6), 612–619, 1984.Bibliography, 57.

68. Jaeger, Th. Optimierungsansatze zur Losung des limited data problem in der Computertomo-

graphie. Berlin: Verlag Dr. Koster, 1997.

736 Analytical Characterization of Aluminum, Steel, and Superalloys

Page 37: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray

69. Bauscher, I. and Hassler, U., Fortschritte in der Computertomographie. In Berichtsband der

Jahrestagung der Deutschen, Osterreichischen und Schweizerischen Gesellschaft fur Zerstorungs-freie Prufung (DACH), Innsbruck, Austria, 29–31 Mai 2000.

70. Maisl, M., Reiter, H., Purschke, M., Zabler, E., and Rosenberger, M., Industrielle3DComputertomographie. In Berichtsband der Jahrestagung der Deutschen, Osterreichischen

und Schweizerischen Gesellschaft fur Zerstorungsfreie Prufung (DACH), Innsbruck, Austria,29–31 Mai 2000.

Image Processing in Aluminum Castings 737

Page 38: 16 Image Processing for Fault Detection in Aluminum Castingsdmery.sitios.ing.uc.cl/Prints/Chapters/2005-TayloFrancis-Castings.pdfthrough visual or computer-aided analysis of x-ray