# The Quality Control System of Planks Using Machine Vision
## 2 Materials and Methods
The article presents different configurations of the camera and laser alignment and the impact of the configuration on imaging resolution. It also offers various methods of implementing relative motion between the examined object and the camera-laser system. The structure presented in Figure 2 allows the determination of the height profile based on the laser line projected on the object. The 1536 \(\times\) 512 sensor from SICK was used in this research. For the sensor, it was possible to record images with a maximum resolution of \(\Delta\mathrm{X}=\Delta\mathrm{Y}=0.1\) mm. It was assumed that the width of the tested surface was 140 mm. Effectively, out of the 1536 pixels available on the sensor, 1400 pixels were used for surface imaging. A 658 nm laser with a 20 mW power was used in the study. \[\Delta\mathrm{X}=\frac{140\ [\mathrm{mm}]}{1400\ [\mathrm{pix}]}=0.1\ [ \mathrm{mm}/\mathrm{pixel}] \tag{2}\]  
\[\Delta\mathrm{Z}=\frac{0.1\ [\mathrm{mm}/\mathrm{pix}]}{\sin(45^{\circ})}=0.14 \ [\mathrm{mm}/\mathrm{pixel}] \tag{3}\]  
The camera-laser alignment was chosen based on the analysis of the available installation space for the measuring system on the production line. It was established that it is possible to set the angle of \(\alpha\) from 30\({}^{\circ}\) to 70\({}^{\circ}\). For such a range, the characteristic of \(Z\)-axis imaging resolution in the function of the \(\alpha\) angle was determined (Figure 3). Figure 2: Model of the laser triangulation imaging stand. Considering the geometric structure of the wood surface, it was assumed that the resolution in the range of 30-45\({}^{\circ}\) is reliable for correct imaging of the bark. The number of measurement points was reduced to reduce the acquisition time for the in-motion imaging. The XY plane measurement resolutions equal to \(\Delta\)X = \(\Delta\)Y = 0.2 mm were considered. In the research and analysis of wood surface flaws, two kinds of defects were categorised: natural and mechanical. Mechanical defects are a result of machining. Both types of defects disqualify the material from the technological process. An image of a surface on which several types of defects are visible is presented in Figure 4. On the given surface, natural defects are visible as bark on the board edges. There are also visible defects resulting from mechanical processing on the board surface in the form of regular patterns on the right side of the plank. The three-dimensional image is described by measurement points, the number of which results from the adopted imaging resolution. It was decided that in the XY plane, the resolution in both axes would be the same. In the case discussed in this work, the surface with an area of 1 mm\({}^{2}\) was described by 25 measurement points. The resulting imaging resolution is equal to \(\Delta\)X = \(\Delta\)Y= 0.2 mm. Each measuring point represents the average height of a surface area of 0.04 mm\({}^{2}\). The colour visible in the three-dimensional image represents the scaled height of the measuring points forming the surface of the wood (Figure 4b). Analysis of the height of each point of a three-dimensional image allows the validation of the geometry and control of quality parameters of the processed wood surface. The thickness of the wood was checked based on a comparison of the height of each image point with the tolerances from the technical documentation. Figure 4: Wood surface with damage visible at the edges and surfaces: (**a**)—2D image, (**b**)—3D image recorded using laser triangulation. Figure 3: Z–axis imaging resolution in the function of \(\alpha\) angle. The red circles shows the considered alignment of 30\({}^{\circ}\) and 45\({}^{\circ}\).