Sie sind auf Seite 1von 8

Crack Detection in Wooden Pallets Using the Wavelet Transform of the Histogram of Connected Elements

M.A. Patricio1 , D. Maravall2 , L. Usero1 , and J. Rej on1


2

Dpto. Ciencias de la Computaci on, Universidad de Alcal a, Spain Dpto. de Inteligencia Articial, Universidad Polit ecnica de Madrid, Spain {miguel.patricio, luis.usero, julio.rejon}@uah.es dmaravall@fi.upm.es

Abstract. The paper presents the application of the wavelet transform of the frequency histogram of connected elements to the detection of very thin cracks in used pallets. First, the paper presents this novel concept and introduces the parameters that dene a connected element, showing that the conventional grayscale intensity histogram of a digital image is a particular case of the histogram of connected elements. Then, the discriminant capability of the wavelet transform of this generalized histogram is analyzed. In particular, the information conveyed by the histogram of connected elements is exploited to detect very thin cracks in used pallets. An articial neural network classier to discriminate sound wood from defective wood with very thin cracks has been designed. The exhaustive experimental test carried out with numerous boards of used pallets has validated the proposed method, in particular its remarkably low ratio of false alarms.

Introduction

The authors have been working for several years on the development of automated wooden pallet inspection systems using computer vision techniques, and as a result of this work there are several industrial inspection plants in full operation in a number of European countries. The objective of the automatic inspection of pallets is to gradually substitute manual inspection, which, apart from being a hard and painstaking job, is prone to errors, both false alarms -i.e., ready-for-use pallets classied as defective- and false negatives. After several years of R+D eorts, the ratios currently achieved by the inspection systems in which the authors have been working are comparable to those of qualied human operators. Concerning operating times, automation inspection has surpassed manual operation by almost one order of magnitude: 3 seconds versus 20 seconds on average, respectively. The pallets arrive at the visual inspection plants after a period of several months of use. This means that inspection can be really complex as many potential defects may be present: splinters, cracks, ssures, broken elements, lack of
J. Cabestany, A. Prieto, and D.F. Sandoval (Eds.): IWANN 2005, LNCS 3512, pp. 12061213, 2005. c Springer-Verlag Berlin Heidelberg 2005

Crack Detection in Wooden Pallets Using the Wavelet Transform

1207

volume in several elements of the object, etc. To make things worse, the surface of wooden pallets is often stained with dierent kinds of remains, such as grease, mud, paint and so on. This paper focuses on the detection of very thin cracks -in the 1 mm range-. The main diculty in recognizing thin cracks does not lie in actual detection -which can be successfully performed when applying appropriate segmentation techniques and provided that there is enough resolution in the digital images- but in the numerous false alarms generated by wood veins, paint remains, shadows induced by the lighting system, etc. Roughly speaking, the better the detection ratio of thin cracks is, the higher the false alarm ratio is, which means that a very delicate balance between both ratios has to be struck. As a consequence of our work on this hard recognition problem, we have introduced a novel concept for digital image segmentation: the so-called frequency histogram of connected elements (FHCE), [1]. Being a conventional unidimensional histogram, the FHCE incorporates all the computational advantages, in terms of both simplicity and speed, inherent to histogram-based segmentation methods. At the same time, it includes information about the spatial distribution of the specic discriminant feature in the digital image, as bidimensional histograms also do. Taking into account how much information that the FHCE conveys as compared with the conventional gray-level histogram, we explore the application of the FHCE wavelet transform to texture discrimination in this paper. Our main objective in this paper is to compare the discriminant capability of dierent mother functions, also known as analyzing wavelets. More specically, we are looking for the best mother functions for dividing regions of a digital image into two classes: sound wood and defective wood. The paper has been divided in to two parts. The rst one is focused on the FHCE wavelet transform. We then address the selection of discriminant features based on wavelet functions. The paper ends with the discussion of the experimental results concerning the detection of very thin cracks.

FHCE Wavelet Transform

In textured images, as is well known, the basic idea is to apply a window whose size is big enough to capture the essential structure of any texture present in the image. In our particular application of detecting thin cracks, we have found that a window of 40 30 pixels seems to be optimum in most cases. In our process design, we have to decide about the two FHCE parameters: spatial predicate and connectivity level (see [1]). After exhaustive experimentation with a plethora of digital images of sound and defective wooden boards, we have selected a 5x3 window as the spatial predicate or morphological structure. Note that the number of horizontal pixels is higher than the vertical pixels, owing to the a priori knowledge available about the problem at hand. In fact, there is empirical evidence that cracks in a piece of wood tend to appear in the same direction as the wood grain. As the computer vision inspection is

1208

M.A. Patricio et al.

performed horizontally from the wooden boards standpoint, the shape of the selected neighborhood function is easily deduced. To conclude the selection of the FHCE parameters, the connectivity level that a particular morphological structure should possess to be considered as such must be selected. The FHCE is computed for each image portion by moving a window of the same 5x3 shape as the neighborhood across all the pixels. This scanning process is performed by means of a top-bottom and left-right movement and by computing, at each pixel, the maximum and the minimum gray level within its neighborhood. Each pixels neighborhood is classied as a connected element if and only if the dierence between the maximum and the minimum values is small as compared with the dynamic range of the histogram in the whole window. After experimental work, we have chosen a 10% ratio, which is a good compromise between wooden portions in good and bad conditions. Therefore, if a particular neighborhood possesses a gray-level variability of less than ten percent of the dynamic range of the global window, the respective pixel is a connected element and the FHCE will compute a new event. Figure 1 illustrates an example of FHCE computation for sound wood and defective wood.

Fig. 1. Instances of FHCE for digital images of (a)sound and (b)defective wood. The FHCE shown in the right-hand column match the windows appearing in the digital images in the left-hand column. Note that the main dierences between the two instances are on the left-hand side of the FHCE

It is clear from Figure 1, that there is a distinction between the FHCE for portions of sound wood and for defective wood with cracks, respectively. Note, in particular, the left side of the FHCE: whereas side lobes appear in the image for defective wood, this characteristic is not present in the FHCE of sound wood. Because each FHCE is shaped quite dierently, we are in an excellent starting position to embark upon the task of selecting optimal features for the automatic wood classication. We can view the FHCE of a window for a portion of wood with a defect a crack in our case- as a signal with two distributions. The rst distribution corresponds to the connected elements that belong to the defect i.e. the crack- and the second distribution to the connected elements belonging to the sound wood portion. Moreover, it is quite evident that the sound

Crack Detection in Wooden Pallets Using the Wavelet Transform

1209

wood portion has a FHCE with a single distribution. In conclusion, there is clear evidence that sound wood can be discriminated from defective wood using the low frequency components of the FHCE spectrum [2] i.e. by computing the Fourier transform of the FHCE-. However, as the FHCE of a textured region is a non-stationary function, it is advisable to work with spatio-temporal representations. The wavelet transform is able to represent both the spatial and temporal domains of a particular function. Broadly speaking, the wavelet transform is a mathematical tool that divides a function into a set of functions, which are in turn scaled and shifted versions of a primitive function, called the mother wavelet function. In principle, there is an innite number of functions that hold the condition of being mother wavelet functions, but only a few of them have been used in practice. Figure 2 shows the mother functions used in our work.

Fig. 2. Mother functions used in our experimentation: BATTLE-LEMARIE [3]; BURT-ADELSON [4]; COIFLET 2, COIFLET 4, COIFLET 6 [5]; DAUBECHIES 4, DAUBECHIES 8, DAUBECHIES 10, DAUBECHIES 12, DAUBECHIES 6, DAUBECHIES 20 [4]; HAAR [4]; PSEUDOCOIFLET [6]; SPLINE 2 2, SPLINE 2 4, SPLINE 3 3, SPLINE 3 7 [4]

Although the wavelet transform has been intensively applied as a powerful and ecient tool in the pattern recognition discipline, it really has a clear limitation as regards time shift. Let g (k ) and f (k ) be two generic FHCEs and WTg(u) and WTf(u) their respective wavelets transforms, then

1210

M.A. Patricio et al.

g (k ) = f (k + ) does not mean that W T g (u) = W T f (u + )

(1)

This is a signicant drawback [3] aecting the usual pyramidal multiscale representation. Although several attempts to solve this problem have appeared in the technical literature, we have chosen an alternative way based on applying a pre-processing technique to recognize the normalization of the FHCE. To determine whether a particular FHCE belongs to a sound wood or to a defective window, we conne our analysis to the left half of the respective FHCE and then apply the following algorithm. Step 1. Let h(k ) be a generic FHCE, then compute the following parameters: o gmin : the lowest gray level in h(k ) with frequency higher than zero. o gmax : gray level in h(k ) with the highest frequency. o max: maximum frequency in h(k ) for h(kmax ). Step 2. Compute the normalized FHCE as follows: h (k ) =
h(gmin +k) max

100 for 0 k gmax gmin for gmax gmin < k N 1

(2)

Finally, the feature vector is put together from the application of the wavelet transform to the normalized FHCE. We also use an alternative normalization based on the denition of the energy distribution of the wavelet transform [7]. Therefore, the feature vector contains 4744 discriminant variables (18 transforms 17 wavelet transforms plus 1 fourier transform by 256 coecients for each transform, plus 17 wavelet transforms by 8 energy levels).

Feature Selection

Obviously, the number of discriminant features is too high (as we mentioned above 4744), and many of them are irrelevant for discrimination purposes. We have selected 60 boards of defective wood i.e. with cracks- and 150 boards of sound wood, and we have run a program to automatically generate a set of training and testing samples from these 210 boards. After exhaustive experimentation, the optimum window size chosen for the generation of digital image samples was 40 30. Finally, for benchmark purposes, 1365 digital image samples (973 of sound wood and 392 of defective wood) have been employed. Note that sound wood samples account for approximately 70% of the complete set. This proportion is quite similar to the rate of occurrence in real-life inspections. To reduce the number of discriminant variables, we have applied the so-called incorporation method [8] and we have output the following discriminant features as the optimum subset: o Coiet4(31). Coecient 31 of the wavelet transform whose mother function is Coiet4.

Crack Detection in Wooden Pallets Using the Wavelet Transform

1211

o Energy(1).Daubechies4. Energy percentage of level 1 of the Daubechies4 wavelet transform. o Spline3,7(14). Coecient 14 of the wavelet transform whose mother function is Spline 3,7. Figure 3(a) shows the scatter diagram of 100 samples taken at random from the 1365 discriminant vectors used in our experimental tests. Obviously, each coordinate matches one of the three selected discriminant variables.

Fig. 3. (a) Scatter diagram of 100 samples taken at random from the experimental data. (b) Results of the ANN in crack detection and recognition

Classier Design and Experimental Results

Having selected a particular feature vector, the next step is classier design. In this respect, we have chosen a classier based on articial neural networks (ANN), as our own experience with many pattern recognition techniques indicates that ANNs are particularly well suited for dealing with the problem of discriminating textures of sound wood from textures of defective wood -in our case, with a crack-. More specically, of the numerous existing ANN models, we have focused on the feedforward multilayer perceptron (MLP), trained with the backpropagation (BP) algorithm, as the detection ratio and the false alarms ratio can be balanced across a judicious selection of the MLP parameters: namely, the learning coecient, the number of iterations and the maximum permitted deviation, [9]. The most demanding and reliable method for evaluating any automatic classier is the leave-one-out policy. Using this policy, the classier in our case, the feedforward multilayer perceptron- is trained with all the available training samples except one, which is used to evaluate the classier itself. By repeating the process with all the training samples, the average success ratio of the classier is an excellent estimation of its future performance for new samples or cases, i.e. working in real-life situations. The average success ratio is computed as follows: P = f (def ect /def ect ) f (def ect) + f (good /good ) f (good) (3)

1212

M.A. Patricio et al.

Fig. 4. Several wood boards with very thin cracks (left hand) and the binarization of the wood boards using the method described in the paper (right hand). Note that all the existing thin cracks have been detected and that there are no false alarms which is a real plague for any method aimed at detecting very thin cracks in wood

where f(defect) and f(good) are the relative frequency of a defective and a good sample, respectively; f(defect/defect) and f(good/good) are the a posteriori relative frequency of success for defective and good samples, respectively. The evaluation was carried out using dierent values for the maximum number of iterations and maximum deviation design parameters. Just to give an idea of the evaluation results, Figure 3(b) shows the results obtained for maximum deviation = (0.1; 0.2; 0.3) and for several values of the maximum number of iterations. The best result is obtained with a maximum deviation of 0.1 and for 5 iterations (96.52%). Another remarkable result that it is worth mentioning in our experimentation is the Fourier transform of the FHCE performed poorly, as compared with the wavelet transforms. The nal detection of cracks is based on scanning the whole image with a small window with a horizontal and vertical overlapping. For each 40 30 individual window, the ANN-based recognizer makes the decision to classify the window either as sound wood or as defective wood. For every window labelled as defective wood, the next step is to segment the pixels of the crack, which can done straightforwardly by an adaptive thresholding algorithm [1], because of the clear bimodal nature of the FHCE, in which one distribution is formed by the connected elements of the crack and the other by pixels of the sound wood. Figure 4 shows several wood boards with very thin cracks and the excellent crack detection results achieved by the proposed method. These results have been achieved thanks to the information conveyed by the histogram of connected elements.

Crack Detection in Wooden Pallets Using the Wavelet Transform

1213

Conclusion

In this paper, we have exploited the information conveyed by the histogram of connected elements to address the detection of very thin cracks. We have also investigated the discriminant capability of the wavelet transform of the histogram of connected elements and designed an ANN-based classier to discriminate sound wood from defective wood. The signal inputs of the ANN classier are three components of a wavelet transform of the histogram of connected elements. An exhaustive experimental test has validated the proposed method for detecting very thin cracks. As it is depicted in Figure 4, an additional advantage is the very low ratio of false alarms achieved by the proposed method.

References
1. D. Maravall and M. A. Patricio, Image Segmentation and Pattern Recognition: A Novel Concept, the Histogram of Connected Elements in Pattern Recognition and String Matching, Kluwer Academic Publishers, 2002, pp. 399452. 2. R. Bajcsy, Computer description of textured surfaces. Proceedings of the 3rd International Conference in Articial Intelligence, 1973, pp. 572579. 3. S. G. Mallat, Multifrequency channel decomposition of images and wavelet models, IEEE Trans. on Acoustics, Speech and Singal Processing Vol 37, 1989, pp. 20912110. 4. I. Daubechies, Ten lectures on wavelets. CBMS-NSF regional conference series in applied mathematics, 61. 2nd ed. Phipadelphia: SIAM, 1992. 5. T. Beylkin, R. Coifman, and V. Rokhlin, Fast Wavelet Transforms and Numerical Algorithms I. Comm. Pure Appl. Math., Vol. 44, 1991, pp. 141183. 6. L. M. Reissell, Multiresolution Geometric Algorithms Using Wavelets I: Representation for Parametric Curves and Surfaces. Technical Report 93-17, Departament of Computer Science, University of British Columbia, Vancouver, May 1993. 7. A. Laine and J. Fan, Texture classication by wavelet packet signatures. IEEE Trans. Pattern Analysis and Machine Intelligence, Vol. 15, No. 11, 1993, pp. 1186 1191. 8. M. A. Patricio and D. Maravall, Segmentation of text and graphics/image using graylevel histogram Fourier transform, in Proc. of the SSPR&SPR, LNCS 1876, Springer-Verlag, 2000, pp. 757766. 9. A. K. Jain, J. Mao and K. Moidin, Articial neural networks: a tutorial. Computer, Vol. 29, No. 3, 1996, pp. 3144.

Das könnte Ihnen auch gefallen