## 3 Proposed Methods
### Highway Crack Classification Methods
#### 3.2.2 CrackClassification Algorithm  
According to the road technical condition standard, road cracks can be divided into four categories: transverse cracks, longitudinal cracks, block cracks, and reticulated cracks. The morphology of each crack is shown in Figure 7. The direction of transverse cracks is generally perpendicular to the center line of the road, the direction of longitudinal cracks is basically parallel to the direction of the route, the shape of block cracks is nearly rectangular in appearance, and the reticulated cracks are interlaced horizontally and vertically, resembling the lines of a tortoise shell.  
Figure 6: The sample images of the UAV remote sensing highway images. Roads make up a smaller portion of UAV remote sensing images. Highway cracks represent a much smaller proportion in the map.  
Different types of highway cracks have different causes, and the measures for their targeted repair also differ. Only through effective classification of highway cracks can we develop maintenance plans for different types of road defects, reasonably allocate maintenance resources, reduce maintenance costs, improve maintenance effectiveness and permanence, and enhance maintenance benefits.  
The previous road crack classification algorithms cannot be used in UAV remote sensing road images, and the classification efficiency is low, making them unsuitable for batch processing of large-scale data. In contrast, the CrackClassification algorithm proposed in this paper can effectively solve these two problems. It was tested in the project and proved to be scientifically rational.  
The overall idea of the algorithm is shown in the flow chart of the algorithm in Figure 8. First, the area within the pixel coordinates of the roadbed is divided into equal-sized grids, as shown in Figure 9a, and the number of white pixel points in each grid is calculated. The threshold \(\alpha\) for the number of white pixels judged as block cracks and the threshold \(\beta\) for the number of white pixels judged as mesh cracks are set based on the comparison of statistical principles and manual labeling classification results according to the road technical condition assessment criteria. Second, each grid is classified as a reticulated crack when the number of white pixels in the grid is greater than or equal to \(\beta\). The area of the reticulated crack is recorded and all pixels in the grid are set to 0. Similarly, when the number of white pixels in the grid is greater than or equal to \(\alpha\) and less than \(\beta\), the grid is determined as a block crack, the area of the block crack is recorded and all pixels in the grid are set to 0. The area of the block crack is recorded, and all pixels in the grid are set to 0. Third, the minimum enclosing frame algorithm based on depth-first traversal is applied to the image with block cracks and reticulated cracks removed, and the horizontal cracks and vertical cracks are enclosed in a rectangular frame, and the width-to-height ratio of the rectangular frame is calculated. Cracks are recorded as transverse when the aspect ratio is greater than or equal to 1 and longitudinal when the aspect ratio is less than 1, and their lengths are recorded. The visualization of the anchor frame is shown in Figure 9b. Finally, the information of crack category, length, area, and location is written into the database.  
Figure 7: Diagram showing four kinds of cracks: (**a**) transverse cracks, (**b**) longitudinal cracks, (**c**) block cracks, and (**d**) reticulated cracks.