An image processing algorithm for detection and analysis of slicing checks

In this paper, a new method of measuring slicing checks for flat-sliced veneers was evaluated. The method is based on image analysis of veneer cross-sections, having highlighted the slicing checks using surface staining. The segmentation of the checks consists of global thresholding followed by some morphological operations. The outputs of the algorithm are check depth ratio and check frequency. The method was tested on flat-sliced oak (Quercus robur L. and Quercus petraea (Matt). Liebl.) veneers of different thicknesses (1.5, 2.5, 3.5 and 4.5 mm). Two distinct wood qualities and two different cutting directions (lengthwise-sliced and plain-sliced veneers) were evaluated. The algorithm performance resulted in an overall accuracy of 85% enabling an accessible method for relatively fast and accurate measurements of slicing check characteristics in lamella cross-sections. Regression analysis indicated a lack of fixed bias but the presence of proportional bias with the presented method. Check measurements indicate that by varying cutting parameters, it is possible to achieve desired check characteristics independent of slicing thickness. The semi-automated slicing check detection method could benefit further research and optimisation of the slicing process parameters and pave the way towards industrial quality control of slicing checks. The intended area of application is veneer-laminated products for interior use with the focus on veneered wood flooring.


Introduction
Wood flooring manufacturing represents an important sector of the wood products industry, accounting for about 87 million square metres of production volume in Europe alone (FEP 2018). Unfortunately, the use of wood as a material for flooring is limited to about 5% of the market share (FEP 2018). One of the main reasons represents a high initial household investment (Jonsson 2005), which is directly related to raw material costs. At the moment, parquet is the most common wood flooring construction type due to its real wood feel and optimised use of valuable raw-material (FEP 2015). Parquet represents a multi-layered wood flooring construction with a required top-layer thickness equal to or greater than 2.5 mm (SS-EN:14389 2017). It is estimated that the top layer represents only about 20% of the flooring element volume but at least half of the total material costs. This is partly due to the limited number of species and qualities suitable or desired for flooring top-layer production, mainly represented by oak (Quercus ssp.) (FEP 2015(FEP , 2018, which is also highly demanded by other wood products industries. As a result, flooring top-layer material is several times more expensive than the core material. Other reasons for the high material costs are raw material defects, high quality demands, processing challenges and over-processing. It is estimated that less than a quarter of log volume is used for the production of top-layer lamellae with a high added value; most of it is used as energy waste, with low added value.
One of the most significant losses of high-value solidwood material in flooring top-layer production occurs during the sawing of wooden slabs into lamellae. This process requires a cutting kerf that can represent a significant share of the material volume: about 20-30%, depending on the cutting equipment and lamella thickness. Therefore, challenging the kerf-based cutting is of great interest and significant to the performance of low to medium value-added wood products industries where the costs of the raw material are high.
Wood slicing or flat-slicing is a kerfless cutting technique with the potential to achieve one of the highest raw material 1 3 conversion rates among the currently available wood-cutting techniques, due to its lack of sawdust production. This technique is particularly suitable for the processing of valuable raw material where the production involves many internal cuts. The most common slicing thickness is between 0.3 and 2 mm. The resulting products are called veneers. Veneers produced by flat-slicing can be either plain or lengthwise, depending on the vertical or horizontal slicing equipment used (Pfriem and Buchelt 2011). Slicing can be performed at thicknesses up to 12 mm (Peters and Patzer 1976). The nomenclature for elements thicker than 2 mm is though, unclear. Sliced veneers 3 mm-to 5 mm-thick are commercially called flooring lamellae due to their intended application (Danzer Holding 2017).
Currently, the slicing technique has limited application to flooring manufacturing due to the quality aspects of produced veneers, mainly characterised by slicing checks, also called micro-checks (Grubîi and Johansson 2019). Slicing checks represent ruptures that occur due to high radial tensile stresses induced by both the cutting tool and the pressure bar (Marchal et al. 2009). Checks affect the strength, appearance, and safety of wood products. Under constant relative humidity, slicing checks remain hidden under the coating layer. Checks migrate to the surface and become visible by cracking and deforming the coating layer when the material is subjected to drying conditions (Burnard et al. 2019;Grubîi and Johansson 2019). This effect is present in cold climates where there is a considerable variation in indoor relative humidity between seasons.
The occurrence of slicing checks has been mostly studied for rotary-cut veneers (lathe checks), as it is believed that they have a direct effect on the mechanical properties of structural products such as LVL and plywood (Denaud et al. 2007;Tomppo et al. 2009;Palubicki et al. 2010;Dupleix et al. 2013;Rohumaa et al. 2013;Pot et al. 2015;Purba et al. 2019). In these studies, checks depth ratio (CDR) in relation to the veneer thickness, and checks frequency (CF) were considered to be the main parameters influencing veneer quality, also referred to as veneer tightness (Lutz 1977;Cassens et al. 2003). A general rule is that veneers with CDR lower than 50% are called tight veneers, denoting a good quality while those with a CDR higher than 50%, are called loose veneers meaning a less good quality (Lutz 1977).
To quantify the occurrence of checks in sliced veneers, scholars have mainly used microscopical (Buchelt et al. 2018) and macroscopical (Tomppo et al. 2009;Antikainen et al. 2015) inspection. The advantage of these methods is the ability to detect the precise depth of checks and to observe potential co-relation between the macroscopic structure and defect occurrence. However, manual measurement of the slicing checks is a tedious process and cannot be used for quality inspection; therefore, methods to detect and measure them automatically are needed.
A method of automatic lathe check detection with focus on CF and CDR was presented by Palubicki et al. (2010). Their method, also known as SMOF device, was further utilized and developed by Dupleix et al. (2013), Pot et al. (2015), and Rohumaa et al. (2018). Antikainen et al. (2015) presented a method for check detection based on trans-illuminance. The advantages of this method consisted in a large bending radius; thus, reducing the risk of veneer rupture. Unfortunately, these methods cannot be used to measure thicker, pre-dried and flat-sliced veneers, as the material is inherently more brittle and cannot be bent under the proposed radiuses without rupture. Another method for automatic check detection, based on observing strains during rapid drying was proposed by Burnard et al. (2018). The method was used to quantify slicing checks in the longitudinal-tangential surface plane based on their length and width (Burnard et al. 2018(Burnard et al. , 2019. Unfortunately, the method was not extended to characterise the slicing checks by depth. To the best of the authors` knowledge, no commercial solution for measuring slicing checks has been developed. As a result, the optimisation of slicing parameters is somewhat subjective and limited. Measurement of slicing checks would allow veneer producers to optimise the slicing parameters. In addition, the measurement of slicing checks can be an essential way for wood product manufacturers to control the quality of their final product and adapt the processing technology and product construction to cope with slicing check defect. The measurement method should be applied to pre-dried veneers before the pressing process. Ideally, the method should be applied in-line and be non-destructive. Measurement output should be information about check properties, such as depth, length, width and thickness. The lack of check measurement methods might be the reason for a limited understanding of the influence of check properties on final surface checking (Burnard et al. 2019).
The advancement of a measuring method for slicing checks properties would enable future research into the influence of veneer processing parameters, (e.g., raw material characteristics, slicing equipment, cutting conditions, drying technology) on veneer quality and the influence of slicing checks on surface checking in veneered products. The aim of this study was to provide an inexpensive, relatively fast and accurate method of measuring slicing checks on flat-sliced veneers with a possible application to flooring products.

Materials and methods
The proposed method for slicing check quantification is based on highlighting the slicing checks using a black textile staining dye (Tomppo et al. 2009;Antikainen et al. 2015) and check segmentation using an image processing algorithm. The dye was prepared according to the manufacturer's recommendation, and veneers were surface stained. Prior to staining, veneers had a moisture content of about 8%.
Veneers were stained to the degree that a slight liquid film was present on the surface after application. Veneer samples were left aside for 4 h to allow the stain to penetrate and dry. After staining, specimens were produced by crosscutting small veneer ribbons with nominal dimensions of 200 × 20 mm using a manual power-saw. The goal was to achieve a mediocre surface quality so that the method could be reproduced in an industrial quality control environment and reduce surface quality bias.
Materials for this study included mainly plain-sliced wood veneers and a few lengthwise-sliced veneers produced by an industrial partner. The veneer species evaluated in this study was oak (Quercus robur L. and Quercus petraea (Matt). Liebl.) harvested in Northern Europe. Veneers produced with a vertical slicer (plain-sliced) were produced from sawn slabs with nominal dimensions 2500 × 220 × 85 mm. Slabs were pre-treated by water-soaking at 90 °C for 58 h. Lengthwise-sliced veneers were produced from similar slabs and were steamed for 48 h at 80 °C prior to slicing.
The method was tested on different veneer thicknesses, (i.e., 1.5, 2.5, 3.5 and 4.5 mm). Six veneer ribbons per thickness group from different and randomly chosen lamellae were used to test the method. Additionally, six veneer ribbons were extracted and prepared from low-quality 4.5 mm-thick plain-sliced lamellae and six from 4.5 mmthick lengthwise-sliced lamellae. An overview of specimen numbers and characteristics is presented in Table 1. The 1.5 mm and 2.5 mm-thick veneers were conventionally dried using conveyor-belt dryers at 80 °C while the 3.5-and 4.5 mm-thick veneers were air-dried and kiln-dried at 40 °C. These represent the standard drying conditions and parameters used by industrial producers to obtain optimal quality veneers for the given thicknesses.
The two thickness groups were processed on two different slicing machines: the 1.5/2.5 mm group was produced on a typical veneer vertical slicer manufactured by Cremona while the 3.5/4.5 mm group was sliced on a vertical slicer for thick veneer slicing made by Babcock-BSH. The knife angle and cutting speed were constant for processing all veneer thicknesses. The slab inclination angle was set based on annual ring orientation. Pressure, gap and lead were adjusted based on the veneer thickness according to the veneer manufacturer's knowledge. Additionally, ribbons of lengthwise-sliced 4.5 mm-thick veneers were analysed. These veneers were produced on an industrial horizontal slicer made by Marunaka.
Raw material quality is believed to have a strong influence on slicing quality (Lutz 1977); consequently, wood quality was also evaluated. Veneers were produced from log slabs of different defined grades: A and C. Grade A were slabs with no visual defects and straight grain, while grade C had multiple defects, such as knots, check, and pith. Cross-cutting of thin veneers that contained defects with conventional sawing techniques proved to be difficult as many samples had major breakings during sample preparation. As a result, for this initial study, it was decided to evaluate the occurrence of slicing checks for grade C for the 4.5 mm thickness group only with the six specimens prepared (Table 1). Grade C represents an unusual wood quality for veneer production (Lutz 1977); however, it is relevant for flooring top-layer production.

Experimental set-up
A Canon 600D/Rebel T3i CMOS sensor camera with a 4.29 μm pixel pitch was used for image acquisition. The camera was equipped with a Canon Ef 100/2.8 USM macro lens and Canon extension tube EF25 II. The distance from the specimen surface to the camera sensor was 28.2 mm. The subject was recorded with a magnification ratio of 1:2. The camera was placed perpendicular to the veneer sample and moved by a motorised slider Konova Kms-3 at a feed rate of 12 s/frame. Veneer ribbons were inserted in the 4.5 mm wide routed slot of a self-made mould (Fig. 1). Frames were captured using an exposure time of 0.8 s and an aperture of f/16. As a result, a lamella section was captured in 120 s allowing for some slack time between frames. With an upto-date image sensor or a different image acquisition technique such as line scanning, the time for acquisition could be significantly reduced. Plain 6 (A) 6 (A) 6 (A) 6 (A)/6 (C) Lengthwise 0 0 0 6 (A) Fig. 1 Image acquisition set-up

Detection algorithm
Raw images were analysed separately because whole lamella sections tend to have a warped or multiple curvature shape and are, therefore, difficult to align. Frames were measured to have approximately 5% overlap along the ribbon. The image processing algorithm was performed with MATLAB R2019b software on an Intel ® Core™ i7-700 CPU 2.8 GHz processor with 16 GB RAM hardware. A simplified schematic representation of the detection algorithm is presented in Fig. 2 and in more detail following the pseudocode in the Online Resource 1. First, frames were roughly cropped at the region of interest (ROI). Afterwards, they were linearly straightened using a Hough transformation (Motl 2020). Then, images were manually cropped by fitting a rectangle to the mean nominal veneer thickness (Buchelt et al. 2018). This was done because, on some occasions, the straightening function did not successfully align the veneer section; the operator would insert a cropping command or manually remove the straightening step if the sample was relatively straight. Afterwards, images were enhanced using an intensity stretching technique. In this way, checks were further separated from wood texture, and the histogram was equalised. The intensity stretching allowed for the use of a simple thresholding method based on a global value. After multiple pre-tests, a good threshold value for the data images was considered to be 0.25 × I, where I is the pixel intensity.
After segmentation, pixel values were inverted, and images were rescaled to remove 10% of the top and 10% of the bottom rows. This was done to limit the interference of the background or wood area that had been excessively stained. As can be observed in Fig. 2, there is a staining particularity: vessels tend to be stained similar to checks. Therefore, one of the first de-noising steps was to apply a shape filter to remove round-shaped vessels.
The characteristics of checks, together with staining and surface quality, ensure that some of the checks will not be stained through and will be segmented as multiple components, similar to the "bridging" effect discussed by Palubicki et al. (2010). To connect them, a morphological dilation structuring disc-type element with a 50-pixel radius was applied. At this point, the remaining noise was filtered with a morphological threshold in which components of reduced size, circular shape, low angle and height position were removed. Some checks will still be separated into two or more components because they were further apart. Consequently, a second morphological dilation line shape element was applied with an orientation equal to the mean orientation of the longest three checks and a length equal to a third of the image height. This was due to the fact that lengthy checks, including fragmented ones, tend to have a similar orientation. The final step of the algorithm was to remove the remaining noise and label the connected components as checks. Then, CDR was determined by dividing the height of the check's bounding box to the rescaled veneer thickness and values adjusted using the scale factor. Finally, CF was determined by dividing the number of detected checks to the image converting unit.

System performance evaluation
For validation, 12 specimen sections were selected for manual CDR measurement. The measurement of visible slicing checks was performed using the MATLAB Image Label tool with one operator. The performance of the system was evaluated by standard metrics used in object detection tasks (i.e., precision, recall and accuracy). These metrics were calculated using Eqs. (1)-(3).
where TP is the true positive rate or the number of correctly classified labels as checks. FP is the false positive rate or the number of incorrectly classified labels as checks, FN is the false negative rate or the number of undetected checks.
To express the relationship between detection algorithm results and manually measured values, a Mode II regression analysis with R software was performed on 632 true positive checks. For current data, both major axis (MA) and standardised major axis (SMA) or the ordinary least products (OLP) methods are suitable for regression parameter estimation and method validation or calibration against one another (Ludbrook 2010).

Results and discussion
Overall results of the proposed algorithm can be viewed in Table 2. The measurements of check properties in the crosssection gave a reasonable estimation of their characteristics with an overall calculated accuracy of 85%. The value seems to be fair compared to other detection algorithms applied to wood-texture images (Hashim et al. 2015). The obtained results are somewhat unbalanced towards a lower FP rate compared to the FN rate or higher precision vs recall. A lower FP rate was preferred due to the fact that increasing the number of FPs involved a significant increase in the measured CDR values that would erroneously alter the perceived veneer quality. A higher FN rate when compared to FP rate, is due to missed shallow checks of irregular shapes, instances where staining occurred around checks and checks that were closely spaced (Fig. 3).
The results of the regression analysis are presented in  Fig. 4. It can be observed that the proposed algorithm detected a slightly lower CDR compared to the measured values. This was mostly due to the discontinuous checks that are not able to join without affecting the FP rate. As a result, the algorithm currently neglects the tips of discontinuous checks of relatively short lengths. Detection of larger CDR compared to the measured values was due to the presence of background noise, such as darkened wood, shadows, and tight groups of vessels that were not filtered out.
Overall results of CDR and CF for the material and method of this study are presented in Table 4. It can be observed that veneer thickness had a limited effect on CDR, similarly to thin flat-sliced veneers (Buchelt et al. 2018). Rough estimates of CDR for plain-sliced veneers used in this study ranged from 40 to 50%, with the highest values represented by the lowest cutting thickness used: 1.5 mm. It can be inferred though, that the results were influenced by a number of uncontrolled factors such as varying cutting  The results of the CF measurements (Table 4) indicate a negative effect of the veneer thickness on the CF, similar to the results on lathe checks (Denaud et al. 2007;Palubicki et al. 2010;Rohumaa et al. 2018). However, this effect has limited industrial application since, for many finished wood products, an essential requirement is a "null check tolerance". In the context where more load-bearing products would involve the utilisation of flat-sliced veneers, these findings would be necessary for material and product model simulation. This is particularly interesting, as CDR values reported for rotary-cut oak veneers of similar thickness (Purba et al. 2019) were significantly higher than the ones obtained in this study for flat-sliced veneers.
Results of CDR and CF measurements in relation to the wood quality for 4.5 mm-thick plain-sliced veneers may indicate an insignificant dependency (Table 4). However, this observation is based on a small sample size, and therefore, more representative experimental studies are needed to test this relationship. A particular characteristic is that when low-quality wood is sliced, checks accumulate at the location of the defect (eventually through checks). This means that the regions surrounding large defects experience fewer and shallower checks than defect-free wood. This is a strainrelease effect of the defect zones (Cassens et al. 2003) that could explain the insignificantly lower quality of C-grade vs A-grade sliced veneers. A drawback of slicing low-quality wood is a relatively fast knife-edge recession if the wood contains fresh knots and veneer lamellae rupture if defects, such as dead knots or shakes are present.
The effects of the slicing direction on the slicing checks characteristics are presented in Fig. 5. It can be observed that lengthwise-sliced veneers, have on average, shallower checks compared to plain-sliced veneers, indicating a slightly better quality for lengthwise-sliced veneers compared to plainsliced veneers, which is in accordance with the results of Pfriem and Buchelt (2011). This is probably due to different cutting conditions, (e.g., much higher oblique cutting angle, meaning the angle between the knife-edge and the normal to the wood-fibres direction, when slicing lengthwise compared to plain-slicing).
Slicing checks orientation usually follows the direction of the knife cutting (Lutz 1977). Depending on the position of wood within the log, slicing checks are either parallel or normal to the direction of multiseriate rays. This particularity is important, as manual observations indicate that checks  oriented parallel to the rays tend to be deeper than those normal to the rays, similar to previous findings on lathe checks (Cassens et al. 2003;Rohumaa et al. 2018). The method discussed in this paper can be extended or adapted in the future to measure the distinct anatomical features of wood, such as multiseriate rays, vessels, annual rings, and earlywood/latewood proportion making the quantitative analysis more substantial.
The main goal of the method described in this paper was to facilitate the measurement of slicing checks on veneer ribbon cross-sections. A drawback of the algorithm is the lack of automatic ROI fitting, which should be the next step for method improvement. In addition, the method is dependent on the imaging characteristics and staining quality, and therefore, needs refinement for robustness and use in different conditions (e.g. species, contrast, and lightning). Integration of edge-detecting, pattern-recognition and machine learning algorithms could improve this issue considerably.
An advantage of the current method is the possibility to measure the whole section of a lamella and analyse check characteristics variation due to wood annual ring orientation and the presence of defects. Theoretically, the method can be applied to a production flow to measure the slicing checks on the two ends of sliced lamellae. Veneer ribbons can be obtained from veneer lamellae sides by cross-cutting with regular cutting equipment. These parts are usually used as fire waste, and if the method is applied, the material yield will not be negatively influenced. The application of this method would increase the complexity of logistics and require additional investment. Hence, it would be more economically beneficial for any improvement in early defect detection compared to late detection or a customer recall. In practice, however, wood product manufacturers usually tend to limit material and product quality controls due to a generally low customer recall rate. Nevertheless, this could negatively impact customer appreciation for wood material products. Hence, it is believed that the method would be more applicable to the R&D phase due to handling complexity when staining.
Quantification of slicing check properties opens up the possibility for research into the critical variables that influence slicing quality and the effects of slicing checks characteristics on the surface checking of finished products. Future studies should evaluate the effect of CDR and CF on surface checking. In addition, means to complete the method with characterisations of slicing checks in the longitudinal direction are highly needed.

Conclusion
In this initial study, a new method for slicing checks detection and analysis was presented and discussed. The method fulfilled some of the criteria for veneer quality inspection, such as accessibility, descent speed and accuracy. However, the method currently lacks full automatisation and good robustness, as the detection algorithm was tailored for the segmentation of checks in flat-sliced oak veneers.
Nevertheless, the method enabled the observation of slicing check characteristics, CDR and CF specifically, tested on a new potential material type for flooring top-layer manufacturing. The method output can subsequently be used for (1) adjusting the pre-processing, slicing and further-processing parameters to improve veneer quality and (2) studying material quality influence on the performance of finished products.
Availability of data and material Data available on request from the authors.
Code availability Code available on request from the authors.

Compliance with ethical standards
Conflicts of interest On behalf of all authors, the corresponding author states that there is no conflict of interest.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creat iveco mmons .org/licen ses/by/4.0/.