Laser Diffuse Lighting in a Visual Inspection System for Defect Detection in Wood Laminates

Nowadays, wood companies are ever more interested in automatic vision systems (Li & Wu, 2009), (Astrand & Astrom, 1994), for an effective surface inspection that greatly increases the quality of the end product (Smith, 2001), (Armingol et al., 2006). The inspection process, in most visual inspection systems, pursues online defects identification, to reach optimum performance (Malamas et al., 2003), (Spinola et al., 2008). The usual wood inspection systems are visual ones, based on standard cameras and lighting (Batchelor & Whelan, 1997), (Cognex, 2011), (Parsytec, 2011), (Pham & Alcock, 2003) to operate in highly structured environments (Silven et al., 2003). The quality control in visual surface inspection systems must be robust to cope with wood variable reflectance and high speed requirements. The surface inspection methods proposed in the literature for visual inspection aim at adhoc surface inspection systems to solve each specific problem (Pham & Alcock, 1999). Usual inspection systems are based on visible lighting and few of them use diffuse components to illuminate the rough and bright surfaces. A visual wood defect detection system proposed by (Estevez et al., 2003) is composed by a colour video camera, where the standard lighting components are a mixture of two frontal halogen and ceiling fluorescent lamps. The commercial light diffusers use a light source and different components to illuminate the surface in an irregular way to eliminate shadows, but present some problems such as, short useful life, extreme sensitivity and high cost. On the other hand, one of the major drawbacks in automated inspection systems for wood defect classification is the erroneous segmentation of defects on light wood regions, (Ruz et al., 2009). Moreover, the speed of wooden boards at the manufacturing industry is at about 1 m/s, which implies high computational costs (Hall & Astrom, 1995). Current work presents a surface inspection system that uses laser diffuse lighting to cope with different type of defects and wood laminated surfaces to improve defect detection without any previous defect information. The work will not only highlight the specific requirements for a laser diffuse lighting in a visual inspection system but also those of unsupervised defect detection techniques to cope with the variability of wood laminated surfaces and defect types, leading to a heterogeneous and robust visual surface inspection system. The manuscript is organized as follows: section 2 displays images of different wood laminated surfaces, captured by a visual surface inspection system with standard lighting. In Section 3, an innovative surface inspection

system using laser diffuse lighting is presented, as well as the acquired images. Section 4 describes an unsupervised wood defect detection and segmentation algorithm to process images acquired with the two types of lighting. Section 5 displays the results, and the conclusions are presented in Section 6.

Standard lighting visual systems
Most inspection systems are based on visible lighting (Guinea et al., 2000), (Montúfar-Chaveznava et al., 2001). These systems can adequately tackle defect detection, but presents some drawbacks: 1. Inspection systems composed by multiple cameras and equal standard lighting for all cameras, make difficult the inspection of the whole wood boards in the production line due to non-uniform illumination of the surface. 2. When fluorescent light is replaced by commercial light diffusers to improve lighting, the maintenance cost greatly increases. Images acquired with a standard visual surface inspection system, composed of a CCD visual camera and fluorescent light, are displayed in Figure 1. The images show knots and splits and are manually classified by a human expert to validate the performance of the automated visual inspection system. Images show different background colour as they come from different wood laminates.

Laser diode diffuse lighting in visual systems
Main innovation of current work is a CCD sensor-based industrial inspection system for defect detection on wood laminates, where lighting is based on a laser technique that comprises two different illumination modes: Diffuse Coaxial Lighting and Diffuse Bright-Field Lighting. Few visual inspection systems use laser-lighting (Palviainen & Silvennoinen, 2001), (Yang et al., 2006), and even less laser diode diffuse components, to illuminate both rough and bright surfaces. The commercial light diffusers are composed of a light source and different optical components to illuminate correctly the surface in an irregular way. However, they present drawbacks such as, short useful life, extreme sensitivity and high cost, that can be overcome with the use of laser diode diffuse lighting to highlight the relevant features.

www.intechopen.com
Main advantages of the proposed lighting system are: 1. Inspection of different wood surfaces without any reconfiguration of the system 2. Detection of different types of wood defects with the same diffuse lighting 3. Inspection of defects with different areas, ranging from 10 to 100 mm², and shapes. 4. Each CCD camera has its own laser diode diffuse lighting The inspection vision system can be configured to work in two lighting modes (Martin et al., 2010): Diffuse Bright-Field Lighting The proposed design permits to reuse the laser-optical system (laser-lighting and optical components) in both configurations to tackle high-speed and small-defect industrial surface inspections over the whole inspection region. The laser diffuse lighting provides a high intensity beam but only on a small area, removing the image shadows generated by the surface roughness, and facing the surface variable reflectance. The wood samples are illuminated using a green diode-pumped solid-state (DPSS) laser, which provides highly uniform illumination in the region of interest (ROI). Coherent laser light is unusual for surface illumination in inspection vision systems due to the emergence of interference patterns. The two images displayed in Figure 2, are captured using only a laser-optical system without any wood surface sample, to exhibit the interference patterns caused by the optical components with coherent laser lighting. Another interference effect appears when the laser beam is reflected on rough wood surfaces. The result of this effect in images acquired by a standard CCD camera is a bright and dark spot pattern, namely "speckle pattern", which is specific for each type of surface. The pattern is distributed randomly in the whole space and is caused by constructive and destructive interference effects. In spite of the interference patterns, the laser lighting source is robust for integration in an industrial environment due to its low-cost and durability in comparison with commercial light diffusers. The solution to the interference problem has been achieved by means of a dispersion technique to obtain laser diffuse lighting and remove the speckle interference pattern. The components proposed for laser beam scattering are: www.intechopen.com

A convergent lens that increases the width of the collimated beam 2. A spinning diffuser that disperses the collimated beam
The wood defect inspection and 1 m/s wood board speed, require high intensity in the inspection region and short exposure time for suitable image acquisition. Former requirements are interrelated, as if intensity increases the exposure time, for real-time inspection, can be reduced. This high intensity allows a correct inspection as the laser diode diffuse lighting illuminates only a small inspection area, about 10-100 mm². In current work, a second set of images have been acquired with diffuse bright-field lighting. The configuration is composed by the laser-optical components (laser, dispersion lens and spinning diffuser) and the imaging components (CCD sensor camera and focusing lens). The orientation of the imaging components related to the laser diffuse lighting is approximately 30º, Figure 3. A black box covers the imaging components so that the light reaching the CCD sensor only comes from the focusing lens. The main characteristics of the proposed visual inspection system endowed of laser diffuse lighting are: i. High intensity in the inspection region and consequently short exposure time ii. High-speed and small-defect surface inspection on the whole inspection region iii. Elimination of the image shadows generated by the surface roughness iv. Deals with the variability of laminated wood such as, colour or texture v. Algorithms required for defect detection are simpler and thus shorter the computing time, as all images present the same background colour.

Wood defect detection and image segmentation
Unsupervised visual processing algorithms are proposed for both wood defect detection and image segmentation. The sooner the line inspector accurately detects the appearance of defects, the shorter the problem is fixed. The defect detection process is accomplished with an algorithm that searches for the seeds of the defects, characteristic pixels belonging to the defect, which determines the location of the defects in the image. Then the image segmentation algorithm uses a region growing method to calculate the size of the defect. The region growing method is based on Active Contours (Chan & Vese, 2001). The validation of the automatic visual inspection results is performed by a human expert. An unsupervised defect detection algorithm has been developed and tested, to cope with variations in the laminated material, such as defect type, pose, size, shape and colour, as well as with environment variations: surface illumination and speed of the laminated material in the production line. All these variables make automatic wood defect detection a challenging task. The flow chart of Figure 5 summarizes the operation of the unsupervised defect detection algorithm.
www.intechopen.com The wood defect detection algorithm proceeds as follows: 1. RGB colour image is converted to greyscale to reduce computational time 2. The developed algorithm searches for local minimum at each fifth row of the image and uses expert knowledge to associate defects with lower grey-level image pixels. The grey value of each pixel in an image row is compared to its neighbours and if its value is lower than the values of each neighbours, the pixel is defined as a local minimum. Two parameters are set up to configure the algorithm restrictions:  "Minimum valley depth", determines the minimum depth as a greyscale value. The valley depth value here selected is 190. Then, only valleys that exceed this value are returned.  "Minimum valley separation", specifies the minimum distance between valleys as a positive integer (pixels). That is, the algorithm ignores small valleys that occur in the neighbourhood of a deeper valley. The selected value is 100 pixels. 3. The position of the local minimum is visualised on the greyscale image with a red dot. On the other hand, image segmentation allows for the calculation of the area of the defect. This is of great aid for quality control analyses, as the greater the size of the defects is, the lower is the quality of the wood laminates. The region growing algorithm groups pixels together into regions of similarity, beginning from an initial set of pixels (red dots). The method works iteratively for increasing the initial pixels set, comparing its grey value with that of its neighbours for increasing the area of the defect to reach the borders. These seeds, previously calculated by the unsupervised defect detection algorithm, allow applying the www.intechopen.com active contours method only in the regions where defects are detected, thus reducing computing costs.

Results
The wood defect detection and image segmentation algorithms, here proposed, have been tested with the two set of images acquired with both standard and laser diffuse lighting visual system. The results of the unsupervised wood defect detection algorithm applied to the first set of images, are displayed in Figure 6. The results show that the algorithm is capable of detecting the position of the defects in the images several times (red dots). This multi-detection implies an accurate detection process caused by applying the algorithm only to each fifth row, for fast defect detection. A gap of five rows is an appropriate value for wood defect detection, as defects usually intersect in more than five rows. Then, the larger the defects are the greater the number of the detected pixels is (red dots). Knots defects have been correctly detected except in the sixth image due to the fact that the background was extremely similar to the defect grey-level. The split appearing on the eighth image has been detected. Moreover, comparing the results of the automatic defect detection algorithm with those of the expert, in the first set of images, the groundwork of the algorithm succeeded in 87.5%. Longer term processing would be required to detect a higher percentage of defects in images. Fig. 6. Results of wood defect detection in images (first set) acquired with standard lighting visual system.
The results obtained with the unsupervised wood defect detection algorithm on the second set of images, are displayed in Figure 7. The second set of images has been captured with the laser diffuse lighting visual system, and in that case all defects were detected. The multi-detection process enhances defect detection due to the large size of the defect in the analysed images. The different types of defects are easily perceived by the expert. In the last image, split defect was not completely detected as a consequence of the similarity between the grey-level of the defect and that of the background. The success in comparing automatic defect detection and expert visual defect detection, is 98%. This percentage is better than the one obtained in the processing of the first set of images.
www.intechopen.com Therefore, the use of a surface inspection system with laser diffuse lighting greatly improves the success of the automatic wood defect detection algorithm. Fig. 7. Results of wood defect detection in images, second set, acquired with a laser diffuse lighting surface inspection system.
The result of the image segmentation algorithm on the first set of images is displayed in Figure 8. The image segmentation algorithm is based on a region growing method that uses Active Contours. The results are displayed in Figure 8, marking the complete border of the defect, in green colour. The defect detected pixels (red dots) grow until the border of the defect is reached, whenever the border of the defect is obtained before last iteration. Moreover, the border can be extra grown, as happens in the sixth and seventh images of Figure 8. However, the wood defects are well shaped, in spite of that present in the eighth image that would need some more iterations to complete the whole defect contour. Finally, the areas of the defects are calculated for further off-line quality control analysis. Fig. 8. Segmentation of images acquired with standard lighting visual system (first set).

www.intechopen.com
The result of the image segmentation of the second set of images is displayed in Figure 9, where the partial border of the defect is marked in green colour. After 200 iterations of the algorithm, departing from the initialization pixels (red dots), the complete area of the defects present in the images is not totally segmented. Defects can be more accurately segmented by increasing the seed pixels (red dots) and the number of iterations of the region growing algorithm, but this implies a greater computing time. Fig. 9. Segmentation of the images acquired from the laser diffuse lighting surface inspection system (second set).
Summarizing, results displayed in Figure 9, are better than those shown in Figure 8, but total segmentation of the defects is not achieved as a greater number of seed pixels would be required. Thus, to increase the number of seed pixels, the "Minimum valley separation" variable has been set to 10 pixels. The results obtained with the set of images acquired with laser diffuse lighting are shown in Figure 10. In first, second, fourth, tenth and twelfth images, the seeds (red dots) partially cover the wood defects, but in the third, fifth, sixth, seventh, eighth, ninth and eleventh images the defects are totally covered by the seeds. Then, the image processing would only require the wood defect detection algorithm as the calculated seeds can detect the shape of the whole defects. This point is extremely relevant as implies lower computing costs. Next, region growing method is applied to obtain the complete segmentation of the defects (green borders), and the results are displayed in Figure 11. It can be remarked that segmentation results of the region growing method are close to those of Figure 10, obtained with the wood defect detection algorithm. Fig. 10. Wood defect detection on images acquired with laser diffuse lighting and "Minimum valley separation" = 10 pixels. Fig. 11. Image segmentation using a large number of seeds: "Minimum valley separation"=10 pixels.

www.intechopen.com
Finally, the computation time for the defect detection and segmentation algorithms is calculated for each image in Figure 10 and Figure 11, and displayed in Table 1. The second column corresponds to the computation time of the wood defect detection algorithm increasing the number of seed pixels (red dots). The third column is the computation time of the region growing algorithm for the image segmentation (green borders).

Conclusions
The global goal of current work is the defect detection on wood images for quality control with short computing time. To this aim, the work compares wood images captured with both: a standard and an innovative surface inspection system that uses laser diffuse lighting. Images from wood laminates with knots and splits defects acquired from the innovative lighting visual system are the most suitable for defect detection. The main characteristics of the proposed system to be used in the wood manufacturing industry are: i. Detection of small defects ranging from one to few millimetres ii. Independence from the variable reflectance of the wood laminates. Images present both a high background smoothness and high-contrast of the defects, independently of the colour of the wood laminates iii. Defect detection time in less than 0.5 s iv. Defect detection success is 98% on a sample of two hundred images v. The laser diffuse light source is robust enough for integration in an industrial environment, due to its low cost and durability, in comparison with commercial light diffusers A smart combination of algorithms for wood inspection has been proposed, based on an unsupervised method for defect detection and a region growing algorithm for defect segmentation. Results indicate that processing time for wood defect detection algorithm is better than for region growing algorithm. Moreover, first algorithm reaches both objectives: wood defect detection and segmentation.
Finally, it has been demonstrated that the use of the proposed wood defect detection algorithm with images acquired from visual surface inspection system using laser diffuse lighting, appears as the best choice for real-time wood inspection.