## 3 Methodology
### Structure Deterioration Identification
Among them, connectivity analysis, as an important part of the algorithm, is primarily used in this study to determine the connected regions composed of pixel points in an image. In bridge crack detection, the aim is to identify crack areas formed by sparse points in the point cloud data. This analysis is typically based on the theory of connectivity in image processing and can be divided into three types: \"region-based connectivity analysis\",  
Figure 6: Framework for mixed modeling crack detection process based on spatiotemporal data. \"graph-based connectivity analysis\", and \"hierarchical connectivity analysis\". Among the three types, since bridge cracks usually appear as connected regions in the point cloud data, and \"region-based connectivity analysis\" can effectively extract features such as the shape and size of cracks, it can well adapt to different types of cracks and has strong robustness to the shape and size of cracks. Therefore, this study selects this analysis method. By generating a labeled image, each connected region is assigned a unique label (each connected region consists of a set of interconnected pixel points sharing the same label), and then the \"regionprops function\" is used to calculate the attributes of each connected region, such as the major axis length and minor axis length. Finally, the identification and calculation of the attributes of crack regions in the point cloud data are completed, achieving the purpose of quantifying cracks in the bridge crack detection process. In the statistical quantity calculation phase, this study uses the mean function and std function to calculate the average and standard deviation of the density array, respectively. Specifically, the average density (avg_density) and standard deviation (std_density) of the density array are obtained by calculating the distance between each point in the point cloud and its adjacent points on different planes (xy, xz, and yz). These statistical quantities determine the threshold for sparse locations, thereby identifying cracks. The formula for calculating the mean density (mean density) in this process is as follows:  
\[\text{avg\_density}=\frac{1}{\text{N}}\sum_{i=1}^{\text{N}}\text{density}_{i} \tag{1}\]  
where std_density is the standard deviation of the density; N is the total number of points in the point cloud; is the density value of point i.  
\[\text{s}=\sqrt{\text{s}^{2}}=\sqrt{\frac{\sum_{i=1}^{\text{n}}(\text{x}_{i}- \overline{\text{x}})^{2}}{\text{n}-1}} \tag{2}\]  
In the above process, the standard deviation of the density is used to measure the dispersion of the density values of each point in the point cloud. The standard formula is as follows:  
\[\text{std\_density}=\sqrt{\frac{1}{\text{N}-1}\sum_{i=1}^{\text{N}}(\text{ density}_{i}-\text{avg\_density})^{2}} \tag{3}\]  
where std_density is the standard deviation of the density; N is the total number of points in the point cloud; is the density of point i; avg_density represents the average value of all the density values. In particular, to obtain an unbiased estimate, namely the standard error of the standard deviation, the standard deviation of the density calculation uses (N \(-\) 1) instead of N, ensuring that the calculated standard deviation reflects the dispersion of the sample without being affected by the size of the sample, thus increasing the universality of the algorithm. Automatic Point Cloud Segmentation Algorithm for Crack Detection  
Given the variability in the scale of bridge construction projects, the size of bridge point cloud data can differ significantly. Therefore, before initiating crack detection, it may be necessary to determine whether to automatically segment the bridge point cloud data as needed.