Development of Stand Alone Application Tool for Processing and Quality Measurement of Weld Imperfection Image Captured by μ-Focused Digital Radiography Using MATLAB-Based Graphical User Interface

Digital radiography incresingly is being applied in the fabrication industry. Compared to filmbased radiography, digitally radiographed images can be acquired with less time and fewer exposures. However, noises can simply occur on the digital image resulting in a low-quality result. Due to this and the system’s complexity, parameters’ sensitivity, and environmental effects, the results can be difficult to interpret, even for a radiographer. Therefore, the need of an application tool to improve and evaluate the image is becoming urgent. In this research, a user-friendly tool for image processing and image quality measurement was developed. The resulting tool contains important components needed by radiograph inspectors in analyzing defects and recording the results. This tool was written by using image processing and the graphical user interface development environment and compiler (GUIDE) toolbox available in Matrix Laboratory (MATLAB) R2008a. In image processing methods, contrast adjustment, and noise removal, edge detection was applied. In image quality measurement methods, mean square error (MSE), peak signal-to-noise ratio (PSNR), modulation transfer function (MTF), normalized signal-to-noise ratio (SNRnorm), sensitivity and unsharpness were used to measure the image quality. The graphical user interface (GUI) wass then compiled to build a Windows, stand-alone application that enables this tool to be executed independently without the installation of MATLAB.


Introduction
Non-destructive testing (NDT) is an applied technology for inspecting materials.Other common applications are to assist in product development, screen or sort incoming materials, monitor, improve or control manufacturing processes, and inspect for in-service damage.Radiography testing is one the most commonly used NDT techniques in welding industries (Pardikar 2008).Since the discovery of X-rays in 1895, film has been the primary medium for capturing, displaying, and storing radiographic images.The processing of X-ray film includes development, fixing, washing and drying to obtain an image that shows the defect.An inspector is then required in the interpretation process for the acceptance based on standard or industry requirements.
Nowadays, digital radiography is progressively replacing conventional, film-based radiographic techniques because it provides higher image quality, more effective use of radiation, and more efficient work practice thanks to the ability in affords to by pass chemical processing.Digital radiography also allows for digital file transfers and easy enhancement of images.Furthermore, less radiation is required to produce an image of similar quality to those produced by conventional radiography.Digital radiography is a form of X-ray imaging, where digital X-ray sensors such as charge-coupled devices (CCD) and flat-panel detectors (FPD) are used instead of traditional radiographic film.A comparison between film-based and digital radiography image properties is summarized in Table 1 (Edwin and Williamson 2002) .
Recently, numerous software programs such as Quick MTF, I See (Noorhazleena 2010), ImageJ, and Imatest have emerged and serve to improve and evaluate image quality.However, there still exists a deficit in the market a comprehensive analyzing and reporting tool that is particularly tailored to the needs of the modern welding industry.In this investigation, an application tool for image processing and image quality is designed for analyzing welding imperfections captured by digital radiography.The following article is comprised of three main sections (1) introduction and theoretical background (2) image processing method and (3) image quality measurement methods.In the first part, the theoretical background of the tool, is introduced.In the second part, of image processing methods for noise removal, intensity adjustment, and edge detection are disdussed.The third part image quality measurement, is used to analyze the image based on modulation transfer function (MTF), image sensitivity using image quality indicators (IQI), single wire (10 FE EN), image unsharpness using IQI duplex wire , and normalized signal noise ratio (SNR norm ) using a step wedge.

Basic Principle and System Overview of µ-Focused Digital Radiography
In this investigation, images were acquired using a NDT analyzer model: m-225D (GE Phoenix X-ray), Systems, Wunsdorf, Germany) with a digital image chain for enhanced contrast and superior resolution.This µ-focused digital radiography has 9" triple-, 6" dual-and 6" single-field image intensifiers.Radiographs were acquired using a 1000 x 1000 pixel-CCD camera with a 12-bit image format.Figure 1 shows an overview of the image intensifier system.The incoming X-rays are converted into a visible light.A photo cathode converts the visible light into electrons which are then accelerated and focused onto a fluorescent screen.On the screen, a bright, small and visible X-ray image appears and is received by the CCD camera.An X-ray tube is used to control the radiation for higher detectability of small details of weld defects.A smaller focus size indicates smaller geometrical unsharpness to produce a sharper image (Nadila et al. 2010).Figure 2 shows µ-focused digital radiography equipment, its system overview and a sample of a radiographed image.Equation (1) shows the relationship between focus spot size (f), focus-todetector distance (FDD), focus-to-object distance (FOD), and geometrical unsharpness (U). (1)

MATLAB-Based Graphical User Interface Development
In graphical user interface (GUI) development, the image processing method and the corresponding tool for the measurement of image quality were designed and developed by using three main tool boxes incorporated in the MATLAB Graphical User Interface Development Environment and Compiler (GUIDE).The image processing toolbox has a variety of methods which can be used to enhance the image.The generated codes were integrated within the GUI to develop a complete function for the interface of the application tool.The developed GUI was then compiled using the MATLAB compiler.A standalone application is an executable program that includes a selection of Windows standalone applications adding the m-file to main functions, building the m-file, and then packaging the compiled file.Figure 3 shows a model development process that explains the development of GUI up to the execution process.Figure 4 shows the main page of image processing and image quality measurement tools that provide three main parts, namely theoretical background, an image processing method, and image quality measurement techniques.In addition, Figure 5 shows the contents of each part.

Image Processing Method (IPM)
The image processing method (IPM) is divided into four parts which are noise removal, intensity adjustment, edge detection, and other methods.The main purpose of these methods is to bring out the details of an image.A low-contrast image can be adjusted by modifying the pixel intensity of the input image (Xie et al. 2009).The methods that were selected for this process are based on the MATLAB image processing toolbox which contains Gaussian, adaptive filtering, medians, etc.It is important to choose a suitable image processing method due to the requirements of welding image enhancement is to improve image quality and vision effects which act as the foundation of a welding defects analysis (Han et al. 2009).Figure 6 shows the components in IPM, including (1) an image before and The principle of enhancement techniques is to process an image so that the result is more suitable than the original image for the specific application (Rafael and Richard 1992).The IPM consists of two main parts, which are noise removal and intensity adjustment by histogram equalization.

Noise Removal Method
Noise removal provides a smoothing effect on the image.A median filter is an alternative approach to reduce the noise that preserves better edge by replacing the grey level of each pixel with the median of the grey levels in the neighborhood of that pixel.The MATLAB functions of imnoise and medfilt removed the noise with less edge blurring.Imnoise represents as randomly occurring white and black pixel, which is then restored by medfilt2, to reduce noise and preserve the edge.The median filter is represented using Eqn.
(2), where N(x,y) is the immediate neighbors of pixel (x,y): (2) The Gaussian filter can be shaped by the user in terms of size and standard deviation.A Gaussian low pass filter can remove noise sufficiently by using Eqn.
(3).where u is the standard deviation of the Gaussian filter. (3) The average filter replaced the value of the center pixel by averaging the value of the neighborhood pixels.The image after neighborhood smoothing is illustrated by Eqn. ( 4), where M is the total points of the neighborhood pixel and S is a neighborhood of point (x, y).
(4) An adaptive filter is a class of filters that change their characteristics according to the values of the gray scales under the mask by using the local statistical properties.A wiener filter (wiener 2) is one of the (5) A disk filter or circular averaging filter (pillbox) is also a method used in an image processing tool and provides a blurring effect.It is defined by Eqn. ( 6), where, R is a defocused radius.Increasing the radius of the filter can give more of a blurring effect on the image.The value of the radius chosen for this method was 3. (6)

Contrast Enhancement Method
An important method that can be used to alter the image is histogram equalization (HE).HE is widely used for contrast enhancement to improve image brightness and to provide an effect on the dynamic range stretching (Yeong-Taekgi 1997).The HE method usually increases the global contrast of images, especially when the usable data of the image is represented by close contrast values.Through the adjustment, the intensities can be better distributed on the histogram.This allows areas of lower local contrast to gain higher contrast.HE accomplishes this by effectively spreading out the most frequent intensity values.Thus, it can increase the contrast quality with the result that the weld discontinuities on the film can to be clearly seen.The formula for histogram equalization is given in Eqn. ( 7), where r k is the input intensity, S k is the processed intensity, k is the intensityand range (0.0-1.0), n j is the frequency of intensity, and j and n is the sum of all frequencies.
(7) As a result, the dynamic range of the histogram is stretched evenly flat where the gray levels have uniform probability density.Figure 7 shows the interface of the contrast enhancement results after using HE.

Image Quality Measurement Method (IQM)
The quality of the enhanced image is further analyzed in terms of noise, sensitivity, unsharpness, mod-ulation transfer function (MTF), and the ratio of signal to noise.The noise is measured based on the mean square error (MSE) and peak single-to-noise ratio (PSNR).Besides that, the image quality indicator (IQI) has been used to evaluate the sensitivity and unsharpness of the image.The MTF is measured on a region of interest (ROI) on a tungsten plate, which produces a clear, distinct edge.The measurement of signal-to-noise ratio (SNR) is carried out on a step wedge with five (5) different thicknesses.The quality measurements that are used to measure the image quality are summarized as follow:

(a) MSE and PSNR
Besides visual evaluation by a human interpreter, the performance of an enhanced image can be evaluated quantitatively using MSE and PSNR.The MSE represents the cumulative squared error between the processed and the original image, whereas PSNR represents a measure of the peak error and is measured in decibel (dB) units.Eqns.( 8) and ( 9 PSNR is the ratio of the peak signal power to the average noise power.It represents the ratio between a maximum of the signal (R 2 ) and the MSE ([I(x,y) and I'(x,y)]).R 2 is the maximum peak-to-peak swing of the signal, whereby R is 255 for 8-bit images.The processed image is considered better quality when the MSE is low and the PSNR is a high in value.

(b) Measurement of Sensitivity and Image Unsharpness using IQI
IQI is used to control the quality of a radiograph that can improve visualization on the film.Two common types of IQI for assessing radiographic quality are IQI single wire (10 FE EN) and IQI duple wire (EN462-5).For IQI single wire, the last visible wire on a radiographic image is considered as the contrast sensitivity of the wire which can be calculated using Eqn.(10). (10)

Development of Stand Alone Application Tool for Processing and Quality Measurement of Weld Imperfection Image
Captured by µ-Focused Digital Radiography Using MATLAB-Based Graphical User Interface LSF can be considered as a line of continuous holes placed very close together.Mathematically, the line spread function is the first derivative of the ESF.LSF is given by Eqn. ( 13).
(13) High spatial frequency means more line pairs (black and white stripes) can be observed in one millimeter.The Fourier transforms (FT) method changes the pixel form to spatial frequency in terms of a line pair per millimeter (lp/mm).In most cases, FT is used to convert images from the spatial domain into the frequency domain and vice-versa.The FT is also an important image processing tool that is used to decompose an image into its sine and cosine components.The output of the transformation represents the image in the Fourier or frequency domain, while the input image is the spatial domain equivalent.In the Fourier domain image, each point represents a particular frequency contained in the spatial domain image.The MTF equation is given in Eqn. ( 14).Theoretically, SNR increases with the square root of the detector's pixel area under the same radiation quality and exposure time (Ewert et al. 2007).The standard pixel area should be normalized using SNR norm to allow a comparison of different detectors.The proposed equivalent square pixel area is 88.6x88.6 µm 2 and the detector's basic spatial resolution, (SR b ) is calculated by using Eqn.( 11).The SNR norm can be obtained using Eqn.( 16). ( 16) Experimentally, the SNR norm is measured using the step wedge method (Pardikar 2008).Important parameters such as exposure time, current and voltage are used to acquire the image.Based on the theoretical and experimental facts, SNR norm is inversed proportional to the thickness.The SNR is reduced as the thickness is increased.Figure 8 shows the layout of the IQM method and shows the MTF results.

Execution, Operation and Results Using the Application Tool
In this research, a flawed specimen from Sonaspection, (No. U-C-15) was captured and the radiographed image was enhanced using various methods.Prior to the calculation of ESF, LSF and MTF, the isotropic pixel spacing based on the detector specifications of the CCD camera and pixel subdivision are determined within a the range of 0.03 to 0.15 (Samei et al. 1998).Figure 9 shows the flow chart for the process involved in image processing and the IQM tool.
In this study, a flawed specimen with a thickness of 12 mm was made of carbon steel.The radiographed image of the specimen was captured using the parameters listed in Table 3.The original image was then processed using five different noise removal methods.The results are shown in Table 4.
Theoretically, a high PSNR and low MSE indicate a better result.This is due to the fact that the image has less signal loss after the enhancement with the image processing method.The result of the spatial frequency in lp/mm (MTF) is obtained by defining a clear distinct edge on the image such as using a tungsten plate.Figure 10 shows the results of noise measurement of MSE and PSNR and spatial frequency in lp/mm with normalized SNR. Figure 11 shows the usage of a step wedge on different thicknesses of materials for SNR norm calculation.Table 5 shows the results of the SNR and SNR norm for four radiographed images with different thicknesses.The ninth wire in Figure 12 can be clearly seen.By referring to the IQI duplex wire table, the total unsharpness is 0.40 mm.
Based on the results in Table 4, the original and enhanced images of a radiographic weld image was improved in terms of three parameters MSE, PSNR and MTF.Five methods of the noise removal show the smoothing effect on the radiographed image and the results show higher MTF values compared to the original image.Low values of MSE and high levels of PSNR were obtained indicating a quality improvement compared to the original image.

Development of Stand Alone Application Tool for Processing and Quality Measurement of Weld Imperfection Image
Captured by µ-Focused Digital Radiography Using MATLAB-Based Graphical User Interface

Conclusion and Further Recommendation
In this study, an application tool for image enhancement and image quality measurement was developed using MATLAB GUI.This tool allows the user to determine the parameter value, select methods for image enhancement, and display the respective results.The results show some improvement on the radiographed image based on MSE and PSNR.The processed images show increasing spatial frequency at 20% MTF by using all methods of noise removal as shown in Table 4. MATLAB-based GUI provides good performance in developing this application tool in the matter of time and cost effectiveness.Due to the fact that the record of welding results is an important matter in the industry, a comprehensive application tool that includes a reporting tool should be further developed.It is predicted that the future of radiography will be digital in the welding fabrication industry, therefore, it would behoove the interpreter or operator should be familiar with technical principles and image quality criteria.

Figure 5 .
Figure 5. Example of content in theoretical background

Figure 6 .
Figure 6.Image processing method (IPM) interface.(1) Image before and after processed with its histogram, (2) View window and (3) Selection menu of image processing method ) show the equation for MSE and PSNR, where M and N are the height and width of the image respectively.I(x,y) is the original image and I'(x,y) is the processed image.
Measurement of Normalized Signal Noise Ratio (SNR norm )SNR is a technical term used in digital radiography to quantify the amount of corruption signal caused by noise.The SNR imposes the fundamental limitation of object perceptibility in a radiograph because image contrast can be manipulated during the display of digitally acquired radiographic images.The SNR is given by the ratio of the light signal to the sum of the noise signals and measured in decibels (dB) units.The SNR equation is given in Eqn.(15), where M swx,swy (x,y) is a grey value in the local area and nwx , nwy (x,y) is the square root of window variance.(15)

Table 1 .
This section presents essential information regard-Development of Stand Alone Application Tool for Processing and Quality Measurement of Weld Imperfection ImageCaptured by µ-Focused Digital Radiography Using MATLAB-Based Graphical User Interface Comparison between conventional and digital X-ray

Table 1 .
Comparison between conventional and digital X-ray

Table 2 .
IQI single wire table (10 FE EN) for contrast sensitivity calculation and IQI duplex wire table (EN 462-5) for unsharpness and SR b calculation

Table 3 .
Parameters used to capture the radiographed image of flawed specimen