## 2 Materials and Methods
### Measurement of Crack Characteristics Based on Image Processing  
This study used the image processing methods to measure the crack characteristics of the cracks in the images partitioned through the neural networks. This process comprises three steps: thinning, tracking, measurement. Thinning and tracking algorithms are used as preprocessing prior to measurement of crack length and width.  
First, a thresholding step for the segmented crack image is conducted by using [PERSON]'s method [28]. This task helps to control the noise and enhance the crack area in the image. Then the processed image is thinned by using a Voronoi thinning algorithm. This algorithm plays a role in gradually peeling off the lateral surface of the crack area by dividing the plane into minimum distances to a specific point. As shown in Figure 4, the segmented crack image is resultingly converted into 1-pixel wide lines image that is a binary image composing of 1 or 0 value. Note that there is no information in the thinned image about sorted pixels that connect the start and endpoints yet.  
Secondly, a tracking algorithm called also a region-growing is implemented to sort the thinned lines. For that, a pixel of which value is 1 is arbitrarily selected in the thinned image as a starting point for tracking. Then tracking algorithm identifies adjacent pixels that are homogeneous pixels or not and expanding the area by collecting pixels with the same data value. Note that the identification is performed in 8 directions in this study; up, down, left, right, upper left upper right, lower left, and lower right (Figure 5). The final output of the tracking algorithm is a sequenced crack pixel coordinate dataset.  
Lastly, the crack characteristics, length and width, are calculated. The result of the tracking algorithm is the form of a 1 pixel-wide free-form spline. For measuring the length of the crack,  
Figure 4: Example of application of thinning algorithm on a crack image: (**a**) segmented crack image, (**b**) 1-pixel wide lines image.  
Figure 5: Concept of extending area for tracking crack data.  
the lengths of the pixels in the spline are summed. Note that the length changes depending on the distribution pattern of pixels. For example, if two pixels are located side by side in the horizontal or vertical direction, the length is easily calculated by gathering the horizontal or vertical size of the pixel. On the other hand, if two pixels are distributed in the diagonal direction, the length is calculated by the Pythagorean theorem. Thus, the length of the crack length is measured by sequentially considering the distribution direction every two pair-pixels. Eventually, the crack length of the input image obtained through the summation of lengths calculated in every crack patch.  
Crack width is obtained by profiling algorithm (Figure 6). This algorithm is based on the that the length (or longitudinal) direction and width (or transverse) direction are perpendiculars. For using the fact, the algorithm firstly converts the spline line of the previous tracking to a number of points then determines the length direction of each point by using its back and forth points. Note that the spline data has longitudinal directionality because it has the sorted pixel sequence. Subsequently, the profiling algorithm determines the width directions of the points by verticalizing the length directions. At each point, the width is calculated toward its width direction until there is no crack pixel in the thresholded image thereafter. Finally, the profiling algorithm determines crack width by averaging the calculated width at every point in input patches.