## 3 Crack Identification and Measurement System
### Process of Crack Measurement  
The distance and angle of the target plane are measured by the laser rangefinder, and the crack image captured by the camera is segmented by the U-net algorithm. The automated measurement process is currently limited because the unpredictable environment has a greater impact on crack extraction. In this study, we proposes a semi-automatic algorithm for crack measurement; the main steps of the pixel size calculation and crack extraction algorithm are summarized in the flowchart in Figure 10 and described in detail as follows.  
Step 1: Center point determination. A random point measured by the laser rangefinder is considered as the center point of the target plane, and the position of the center point in the image is recorded by the camera.  
Step 2: Horizontal and vertical rotation angle measurement. The horizontal angle and distance can be calculated by rotating the laser rangefinder horizontally, and the same procedure can be applied to acquire the vertical angle.  
Figure 10: Flowchart of image-based concrete crack detection and measurement.  
Figure 9: The comparison between U-net extracted crack area and Canny edge detection: (**a**) example of crack refining process, where the gray values are the transition area; (**b**) influence of refinement on crack width measurement.  
Step 3: Pixel length translation. The distance between a random point and the center point on the image can be calculated according to Formulas (25) and (29), and the pixel length can be translated to the actual distance.  
Step 4: Crack segmentation. After calculating the pixel length, the areas of the cracks in the captured images are segmented by the improved U-net algorithm, and the model is trained previously based on several concrete images taken in different conditions.  
Step 5: Edges refined. The crack images are processed by the Canny algorithm again, and if the generated edges are in the crack area segmented by U-net, the crack will be refined.  
Step 6: Crack width calculation. After obtaining the refined crack, we extract the skeleton and the pixel width of the crack perpendicular to the direction of the skeleton and finally calculate its actual width.  
To evaluate the quality of the trained model, four commonly adopted indicators for neural network evaluation are referenced, which are precision, recall, F1-score and IoU, respectively, defined as  
\[Precision=\frac{TP}{TP+FP}, \tag{37}\]  
\[Recall=\frac{TP}{TP+FN}, \tag{38}\]  
\[F1=2\frac{precision\times recall}{precision+recall}, \tag{39}\]  
\[IoU=\frac{TP}{TP+FP+FN}, \tag{40}\]  
where \(TP\) is true positive, representing the number of true positive pixels; \(FP\) is false positive, representing the number of false positive pixels; and \(FN\) is false negative, representing the number of false negative pixels.  
Data acquired from the object plane are adopted to extract the crack width. Different measuring objects are evaluated by several performance criteria, such as the mean absolute error (\(AE_{\text{mean}}\)), the root mean squared error (\(RMSE\)) and the coefficient of determination (\(R^{2}\)), which are shown as follows.  
\[AE_{\text{mean}}=\frac{1}{N}{\sum_{i=1}^{N}}{\left|{L_{\text{M}}(i)-\overline{ L}(i)}\right|}, \tag{41}\]  
\[RMSE=\sqrt{\frac{1}{N}{\sum_{i=1}^{N}}\left({L_{\text{M}}(i)-\overline{L}(i) }\right)^{2}}, \tag{42}\]  
\[R^{2}=\frac{\left[{\sum_{i=1}^{N}}\left({L_{\text{M}}(i)-\overline{L}_{M}} \right)\left({L(i)-\overline{L}}\right)\right]^{2}}{{\sum_{i=1}^{N}}\left({L_ {\text{M}}(i)-\overline{L}_{M}}\right)^{2}}{\sum_{i=1}^{N}}{\left({L(i)- \overline{L}}\right)^{2}}, \tag{43}\]  
where \(L_{M}\) and \(\overline{L}_{M}\) represent the measured and the average measured values, \(L\) and \(\overline{L}\) denote the standard and average standard values, and \(N\) is the number of objects. The optimal results should be verified with the minimum mean absolute error, root mean squared error and coefficient of determination close to 1.