## 1 Introduction
To train the model more efficiently and obtain higher accuracy, many studies have chosen to improve the U-net model. [PERSON] used a supervised learning approach to inspect defects from digital images of titanium-coated metal surfaces [17]. [PERSON] improved the U-net model based on a new loss function named generalized dice loss to detect cracks more accurately, which indicated that a different loss function can affect segmentation results [11]. [PERSON] combined the underlying idea of U-net with other networks to achieve urban scene segmentation, resulting in a new approach for the improvement of the network [18]. With a comprehensive crack detection system, real-world images demonstrate that the U-net method can quantify various cracks accurately and robustly [19]. Although the accuracy and various evaluation indicators demonstrate the practicality of deep learning in crack segmentation, there are fewer definitions of the boundaries of the crack in dataset or extraction results, and measurement errors may result. After accurately extracting the crack pixels, many scholars apply the results in many fields. In recent years, vision-based sensors have been confirmed as a practical method for non-contact and accurate measurement, in which distances are extracted by calculating the distances or moving positions of the pixel-grids [20]. For small-scale concrete structures, many experiments have proven the feasibility of machine vision in crack detection. [PERSON] [21] proposed a real-time crack inspection method with a wall-climbing unmanned aerial system, calculating the crack width at fixed distance. [PERSON] [22] adopted photogrammetry to extract global crack maps from the surface of the structure, and the universality of the digital image correlation approach was proven. For non-planar structures, 3D digital image correlation systems were used to analyze the compression behavior of concrete structures during deformation [23; 24; 25]. Machine vision technology is also applied to the detection of structural cracks or other related issues [26; 27]. [PERSON] [28] developed a vision-based measurement method for experimental tests of reinforced concrete structures, which can measure deformations and characterize cracks from images of specimens. [PERSON] [29] designed a method based on image processing to automatically monitor cracks in con crete dams, and the results validate the ability of computer vision to perform a detailed characterization of cracks in concrete dams. The purpose of this study is to realize the long distance and non-contact precise measurement of the crack width through computer vision. A combination system with a camera and laser rangefinder is proposed as measurement equipment. To solve the problem of pixel distortion caused by non-vertical photographing, the innovative geometric transformation formulas are proposed, which can calculate the unit pixel length of the target plane image captured at any angle. To solve the data imbalance problem caused by a smaller crack pixel proportion, the improved U-net algorithm is proposed to accurately segment the crack areas, and the Canny edge detection method is adopted to refine the edge and ensure that it follows mathematical standards. Errors of measuring equipment, systems and segmentation algorithms are analyzed by standard size targets and artificial cracks. The performances of the crack measurement system are tested on a real wall in the lab and applied to some cracks with different backgrounds on a concrete dam. The object is to propose a practical system to measure the crack width by simple steps, and the equipment can be moved to measure sudden cracks or fixed to monitor the change of cracks for a long time.