A slope crack identification method based on unmanned aerial vehicle image
By using a slope crack identification method based on UAV imagery, and employing a three-dimensional cubic mesh and fractal modulation asymmetric index, the problem of misjudgment in slope crack identification caused by factors such as lighting and surface interference is solved, achieving high-accuracy crack identification in complex environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIAN INST OF INTERPRETATION & TRANSLATION
- Filing Date
- 2026-03-27
- Publication Date
- 2026-06-23
Smart Images

Figure CN122265889A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a method for identifying slope cracks based on UAV imagery. Background Technology
[0002] Image recognition technology encompasses the core areas of computer vision and pattern recognition, and is dedicated to using computer algorithms to automatically analyze, interpret, and understand digital images.
[0003] In practical slope monitoring scenarios, existing technologies face significant challenges. Illumination conditions vary drastically with time and angle, and the surface is widely covered with gravel, vegetation, and water stains. These interfering factors manifest as localized grayscale abrupt changes or irregular edges in images, making it difficult for gradient-based or grayscale statistical algorithms to distinguish cracks from environmental noise. Furthermore, they lack the ability to deeply quantify the geometric complexity of textures, and segmentation based solely on pixel intensity differences can easily misclassify rock shadows or vegetation gaps as cracks. Therefore, improvements are needed. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings of existing technologies by proposing a slope crack identification method based on UAV imagery.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: a slope crack identification method based on UAV imagery, comprising the following steps: Based on the UAV slope monitoring images, the image grayscale matrix is divided into overlapping sliding window units. Three-dimensional cubic grids of different scales are used to cover the image grayscale surface in each window. The grayscale surface roughness index is calculated and mapped to the pixel coordinates of the window center to generate a fractal dimension feature map of the slope surface. Based on the fractal dimension feature map of the slope surface, the set of pixel gray values corresponding to each window position is extracted, the fractal modulation asymmetry index is calculated and generated, and the fractal modulation asymmetry index is combined with the rotation-invariant binary comparison code of the center pixel of the window to generate a local texture skewness statistical matrix. Based on the local texture skewness statistical matrix and the fractal dimension feature map of the slope surface, a pixel-level multidimensional feature vector including fractal dimension values and fractal modulation asymmetry index is constructed. The distance between the feature vector and the standard soil texture reference vector is calculated to generate a texture feature space distance set. The texture feature space distance set is filtered using the conditional judgment logic that the fractal modulation asymmetry index is negative, and the distance values corresponding to the negative skewness region are retained to generate a crack texture deviation map. Based on the crack texture deviation map, an adaptive segmentation threshold is generated. The binary values of the crack texture deviation map and the adaptive segmentation threshold are compared to generate a binary recognition map of the slope crack area.
[0006] Preferably, the steps for obtaining the fractal dimension feature map of the slope surface are as follows: Based on the image grayscale matrix of the UAV slope monitoring image, it is divided into overlapping sliding window units according to a fixed row and column step size. A multi-scale three-dimensional cubic mesh is constructed for each overlapping sliding window unit. The number of non-empty cubes that intersect the grayscale surface with the mesh at each scale is counted, and the mesh side length corresponding to each scale is recorded to generate a pairing sequence of non-empty cube number and mesh scale. The roughness index of the grayscale surface is calculated based on the pairing sequence of the number of non-empty cubes and the grid scale. Based on the grayscale surface roughness index, the grayscale surface roughness index of each overlapping sliding window unit is mapped to the center pixel coordinate of the corresponding overlapping sliding window unit. The overlapping areas are then weighted, fused, and spatially smoothed to generate a fractal dimension feature map of the slope surface.
[0007] Preferably, the step of obtaining the fractal modulation asymmetry index is as follows: Based on the fractal dimension feature map of the slope surface, overlapping sliding window units are divided according to a fixed row and column step size. All pixel gray values of each overlapping sliding window unit are read, missing values are removed, and the average value and standard deviation of the gray value set are calculated to obtain the pixel gray value set. Calculate the fractal modulation asymmetry index based on the set of pixel gray values.
[0008] Preferably, the step of obtaining the local texture skewness statistics matrix is as follows: Based on the fractal modulation asymmetry index, the rotation-invariant binary comparison code of the center pixel of each overlapping sliding window unit is extracted. The fractal modulation asymmetry index and the rotation-invariant binary comparison code are combined item by item to form a two-dimensional statistical matrix based on the row and column position index, and a local texture skewness statistical matrix is generated.
[0009] Preferably, the step of obtaining the texture feature spatial distance set is as follows: Based on the local texture skewness statistical matrix and the fractal dimension feature map of the slope surface, pixel-level registration is completed by row and column index. The fractal modulation asymmetric index is read point by point and the fractal dimension value at the same position is extracted. The fractal dimension value and the fractal modulation asymmetric index are sequentially concatenated into two-dimensional entries according to a fixed field order to generate a pixel-level multidimensional feature vector. Based on the pixel-level multidimensional feature vector, the Euclidean distance to the standard soil texture reference vector is calculated sequentially according to the pixel coordinates. Each distance value and its corresponding row and column index are recorded to generate a texture feature space distance set.
[0010] Preferably, the step of obtaining the crack texture deviation map is as follows: Based on the texture feature space distance set, the fractal modulation asymmetric index in the pixel-level multidimensional feature vector is called and filtered for conditions less than zero. Only the distance values that meet the conditions are retained and written into the corresponding pixel coordinate grid. Zero values are written to the unretained positions in row priority order to maintain dimensional consistency, thereby generating a crack texture deviation map.
[0011] Preferably, the step of obtaining the adaptive segmentation threshold is as follows: Based on the crack texture deviation map, the pixels are traversed in row and column order to read the deviation value, missing values and abnormal occupant values are removed, the deviation value range is determined and the boxes are divided at equal intervals. After the pixel count is accumulated for each box, the box probability is obtained by normalizing the total number of pixels. The box is written into the record table in the order of the box center and the box boundary index is retained to generate the deviation histogram distribution probability. Based on the probability distribution of the deviation histogram, each box boundary is selected as a potential segmentation point in sequence. The sum of probabilities on the left and the sum of probabilities on the right of the segmentation point are calculated. The left mean and the right mean are obtained by weighting the probability on each side to the center of the box. The product of the square of the difference between the probability on both sides and the mean on both sides is used as the inter-class variance and the position of the maximum value is recorded to generate an adaptive segmentation threshold.
[0012] Preferably, the steps for obtaining the binary identification map of the slope crack area are as follows: Based on the adaptive segmentation threshold, the deviation value of the crack texture deviation map is read pixel by pixel. Pixels exceeding the adaptive segmentation threshold are marked as foreground and their row and column indices are retained. The connectivity is traversed according to the row and column indices and the four adjacent pixels are connected as the connection rules and merged into regions. Pixels that do not exceed the adaptive segmentation threshold are set to zero, and a binary recognition map of the slope crack region is generated.
[0013] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by dividing the image grayscale matrix into overlapping sliding windows and covering the grayscale surface with three-dimensional cubic meshes of different scales, the geometric texture features of the slope surface can be quantified from a three-dimensional spatial dimension. The grayscale surface roughness index is calculated using the statistical number of non-empty meshes, characterizing the complexity of the physical structure of the soil and rock surface. This distinguishes regular soil backgrounds from irregular crack edges at the feature level. The fractal modulation asymmetry index is calculated by combining pixel grayscale distribution features, and the fractal dimension is used to weight and modulate the skewness index. This not only captures the negative tailing characteristic of the grayscale histogram caused by crack shadow areas but also enhances the response intensity to real crack targets through texture complexity, suppressing pseudo-feature interference caused solely by uneven illumination or vegetation shadows. The modulation of asymmetric exponent and rotation-invariant binary comparison coding are fused to construct a local texture skewness statistical matrix, which further enriches the dimension of feature description, making it rotation-invariant and adaptable to the variability of crack orientation. A pixel-level multidimensional feature vector containing fractal dimension and asymmetric coefficient is constructed and its Euclidean distance with the standard soil texture reference vector is calculated, realizing the quantitative measurement of abnormal texture regions. Combined with the negative skewness region screening logic, high-brightness noise points are eliminated, focusing on potential crack targets. An adaptive segmentation threshold is generated based on the deviation map histogram distribution, which can dynamically adjust the segmentation strategy according to the differences in lighting and soil background under different monitoring scenarios, ensuring the continuity and integrity of crack region extraction and improving the accuracy of identifying small cracks in complex geological environments. Attached Figure Description
[0014] Figure 1 This is a schematic diagram of the steps of the present invention. Detailed Implementation
[0015] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0016] Please see Figure 1 This invention provides a technical solution: a method for identifying slope cracks based on UAV imagery, comprising the following steps: Based on the UAV slope monitoring images, the image grayscale matrix is divided into overlapping sliding window units. Three-dimensional cubic grids of different scales are used to cover the image grayscale surface in each window. The grayscale surface roughness index is calculated and mapped to the pixel coordinates of the window center to generate a fractal dimension feature map of the slope surface. Based on the fractal dimension feature map of the slope surface, the set of pixel gray values corresponding to each window position is extracted, the fractal modulation asymmetry index is calculated and generated, and the fractal modulation asymmetry index is combined with the rotation-invariant binary comparison code of the center pixel of the window to generate a local texture skewness statistical matrix. Based on the local texture skewness statistical matrix and the fractal dimension feature map of the slope surface, a pixel-level multidimensional feature vector including fractal dimension values and fractal modulation asymmetry index is constructed. The distance between the feature vector and the standard soil texture reference vector is calculated to generate a texture feature space distance set. The texture feature space distance set is filtered by the condition judgment logic that the fractal modulation asymmetry index is negative, and the distance values corresponding to the negative skewness region are retained to generate a crack texture deviation map. Based on the crack texture deviation map, an adaptive segmentation threshold is generated. The binary values of the crack texture deviation map and the adaptive segmentation threshold are compared to generate a binary recognition map of the slope crack area.
[0017] The steps for obtaining the fractal dimension feature map of the slope surface are as follows: Based on the image grayscale matrix of the UAV slope monitoring image, it is divided into overlapping sliding window units according to a fixed row and column step size. A multi-scale three-dimensional cubic mesh is constructed for each overlapping sliding window unit. The number of non-empty cubes that intersect the grayscale surface with the mesh at each scale is counted, and the mesh side length corresponding to each scale is recorded to generate a pairing sequence of non-empty cube number and mesh scale. The roughness index of the gray-scale surface is calculated based on the pairing sequence of the number of non-empty cubes and the mesh scale. The calculation formula is as follows: ; in, For the first The roughness index of grayscale surface of overlapping sliding window units For the first Logarithmic value at each grid scale For the first The side length of each grid scale, This is the corrected logarithmic count value. For the first The overlapping sliding window unit in the first Number of non-empty cubes at each grid scale For the first The overlapping sliding window unit in the first The average standard deviation of pixel grayscale within a non-empty cube at each scale The global grayscale standard deviation of the entire drone image is given. The contrast blending coefficient is... To prevent tiny constants with a denominator of zero, These are weighting coefficients. This is a weighted average of the logarithmic values at the grid scale. To adjust the logarithmic count for the weighted average, This represents the total number of grid scales. Based on the grayscale surface roughness index, the grayscale surface roughness index of each overlapping sliding window unit is mapped to the center pixel coordinate of the corresponding overlapping sliding window unit. The overlapping areas are then weighted, fused, and spatially smoothed to generate a fractal dimension feature map of the slope surface.
[0018] Specifically, based on the image grayscale matrix of the UAV slope monitoring images, the high-resolution slope image data acquired by the UAV is read, converted into a single-channel grayscale matrix, and the size parameters of the sliding window are set according to the resolution characteristics of the image, such as setting the window side length. The value is 64 pixels, and the row and column steps are set simultaneously. The step size is 16 pixels to ensure 75% overlap between windows, enabling the capture of continuous texture changes. A sliding scan is performed on the grayscale matrix at this step size, generating a series of overlapping sliding window units. For each extracted overlapping sliding window unit, a multi-scale 3D cubic mesh is constructed to determine the dynamic range of grayscale values. Typically, grayscale values from 0 to 255 are normalized and mapped to image space coordinates. Same scale axis Above, the constructed three-dimensional space is composed of Composed of three dimensions, this three-dimensional space is divided into cubic meshes of different scales, defining a set of mesh scales, such as a scale sequence. Values Pixels, for each scale in the sequence Divide the three-dimensional space into sections with sides of length . The small cube iterates through the grayscale surface within the window, which is composed of pixel coordinates. and their corresponding grayscale values The system determines whether a grayscale surface intersects each small cube. The specific logic involves comparing the vertical grayscale range covered by the cube with the maximum and minimum grayscale values of the pixels at that location. If there is overlap, it is considered an intersection. The total number of non-empty cubes intersecting the grayscale surface is then counted at each scale. Record the quantity and the corresponding grid side length. The two are paired as key-value pairs and arranged in ascending order of scale to generate a sequence of non-empty cube counts paired with grid scales. In the formula for calculating the roughness index of gray-scale surfaces, the fractal dimension of the gray-scale surface is fitted by weighted least squares regression. A local contrast correction term is introduced to adjust the traditional count value, so that the calculated fractal dimension not only reflects the geometric complexity, but also senses the degree of drastic change in the gray level of the texture, thereby improving the sensitivity to the identification of crack edges. The steps to obtain the parameter are as follows: This parameter represents the first... The natural logarithmic values at each grid scale are used to construct the independent variable axes in a double logarithmic coordinate system. During implementation, the first step is to determine the baseline grid side length sequence for multi-scale analysis. The grid scale is set based on the ground sampling distance (GSD) of the UAV imagery, for example, 5 mm / pixel, and the physical coverage of the sliding window. In the actual example, the set of sliding windows is selected to have a size of [value missing]. Pixels, setting scale sequence It includes 5 scales, namely Pixels, corresponding to For each given We can obtain it by directly calculating its natural logarithm. For example, for , This parameter is the scale benchmark in fractal dimension calculation, reflecting the rate of change of the observation scale.
[0019] The steps for obtaining the parameter are as follows: This parameter represents the corrected logarithmic count value, which serves as the dependent variable in the double logarithmic coordinate system. Its core lies in combining the traditional box-dimensional count value with local grayscale texture features. First, the first... The window in the first Number of non-empty cubes at each scale For example, at scale Statistics at the time Simultaneously, calculate the average standard deviation of the pixel grayscale values contained within all occupied non-empty cubes of the window at that scale. The calculation method involves first calculating the grayscale standard deviation of each pixel within a non-empty cube, and then averaging these standard deviations. For example, to obtain... Obtain the global grayscale standard deviation of the entire image. For example, by calculating the total number of pixels in the entire image. Set the contrast blending factor and tiny constants Ultimately, through the formula The calculation shows that this parameter introduces texture contrast information, allowing smooth and rough regions to exhibit dimensional differences at the same count value.
[0020] The steps for obtaining the parameter are as follows: This parameter is the contrast fusion coefficient, used to adjust the contribution weight of local grayscale changes to the fractal dimension calculation. Its setting is based on balancing the influence of geometric fill degree and texture contrast. The parameter value needs to be calibrated through the analysis of typical slope crack samples. A training sample set containing obvious cracks, light and shadow, and flat soil is selected. to Within the range Step size adjustment Values, calculations differ The fractal dimension feature map is used to calculate the contrast signal-to-noise ratio (CNR) between the crack region and the background region in the feature map. The calculation formula is as follows: , The mean fractal dimension of the crack region is... The mean fractal dimension of the background region. The standard deviation of the fractal dimension of the crack region. The standard deviation of the fractal dimension of the background region is used to record the maximum CNR value. As the final setting value, in actual testing, when Set as At that time, the sharpness of the crack edge reaches its optimal value, therefore, it is set to... .
[0021] The steps for obtaining the parameter are as follows: This parameter is a tiny constant to prevent the denominator from being zero, and it belongs to the protection item for numerical calculation stability. In actual programming implementation, considering that the image may have flat areas with extremely low contrast (such as overexposed areas), causing the global or local standard deviation to approach zero, in order to avoid division overflow errors, it is set according to the lower limit of the computer's floating-point precision. .
[0022] The steps for obtaining the parameters are as follows: These parameters are weighting coefficients, used to assign different importance to data points at different scales during the least squares fitting process, taking into account the importance of data points at small scales (e.g., ...). ), the number of non-empty cubes With a large number of samples and a relatively large statistical sample size, the reliability of the data is relatively high. However, at a large scale (such as...), The number of cubes is small, and the statistical fluctuations are large, so the number of non-empty cubes is used. itself as weight, that is During the calculation process, the first... The window in the first The number of non-empty cubes obtained from statistics at each scale is used as the weight value in the subsequent weighted average calculation.
[0023] Calculations based on parameters: Select the first The calculation is performed using overlapping sliding window cells, with a set total number of grid sizes. To simplify the demonstration (in practical applications, there are usually 5 grids), the corresponding grid scale is: , .
[0024] Obtain basic data: for (Scale 2): Statistically obtain the number of non-empty cubes. The standard deviation of the average gray level within the cube was calculated. .
[0025] for (Scale 4): Statistically obtain the number of non-empty cubes The standard deviation of the average gray level within the cube was calculated. .
[0026] Global grayscale standard deviation fusion coefficient , .
[0027] The final calculation result is The results show that the textured surface within the current sliding window has a fractal dimension of approximately 1.708. The larger the value, the rougher or more complex the surface. By introducing contrast correction, this value can more sensitively reflect high-frequency texture features containing cracks than the simple geometric fractal dimension.
[0028] Based on the roughness index of the grayscale surface, the roughness index value calculated for each overlapping sliding window unit is read, and a two-dimensional floating-point matrix with the same size as the original image is constructed as a feature mapping substrate to obtain the center pixel coordinates of each window in the original image. The calculated roughness index is directly assigned to the coordinate position. Due to the overlap between sliding windows, most pixels in the original image are covered by multiple windows. Weighted fusion processing is needed for these overlapping areas. Inverse distance weighted interpolation is used for any pixel position. The algorithm searches for the center points of all windows covering the pixel, calculates the Euclidean distance from the pixel to each center point, and uses the reciprocal of the distance as a weight to calculate the weighted average of the roughness indices corresponding to each window, thus obtaining the fused fractal dimension value of the pixel. Subsequently, spatial smoothing is performed on the entire image to eliminate computational noise, constructing a... Gaussian smoothed convolution kernel, with a set standard deviation The fractal dimension matrix after pixel-by-pixel traversal is convolutionally performed to update the value of the center pixel to the weighted sum of the neighboring pixels, smoothing out abrupt noise caused by window boundary effects, preserving the continuous texture change trend, and finally mapping the processed matrix values to a grayscale image or pseudo-color image to generate a fractal dimension feature map of the slope surface.
[0029] The steps for obtaining the fractal modulation asymmetric index are as follows: Based on the fractal dimension feature map of the slope surface, overlapping sliding window units are divided according to a fixed row and column step size. All pixel gray values of each overlapping sliding window unit are read, missing values are removed, and the average and standard deviation of the gray value set are calculated to obtain the pixel gray value set. Based on the set of pixel grayscale values, the fractal modulation asymmetry index is calculated using the following formula: ; in, For the first Fractal modulation asymmetric index of overlapping sliding window units For the first Standard skewness value of each overlapping sliding window cell For the first grayscale value of each pixel. For the first The average grayscale value of each overlapping sliding window cell. For the first The standard deviation of grayscale values of overlapping sliding window units. For the first The number of pixel grayscale values in each overlapping sliding window unit. The sign function of standard skewness. For the first The blended contrast grayscale surface roughness index of overlapping sliding window units For reference fractal dimension, For fractal modulation coefficients, This indicates that the modulation effect is enabled only when the local fractal dimension exceeds the reference value.
[0030] Specifically, based on the fractal dimension feature map of the slope surface, the original high-resolution UAV imagery is precisely aligned with the fractal dimension feature map using the spatial coordinate mapping relationship established in the previous steps. This ensures that each feature value accurately corresponds to a specific texture region in the image. The sliding window parameter settings are exactly the same as those used when generating the feature map, i.e., the window size is set to [value missing]. For each pixel, with a row and column sliding step size of 16 pixels, the original grayscale image is re-divided into windows from left to right and top to bottom. For each defined overlapping sliding window unit, the grayscale values of all pixels within the window's coverage area are read using memory mapping to construct the original grayscale data sequence. The read grayscale data undergoes an integrity check, removing invalid placeholders (such as NaN values or negative values) caused by sensor noise or data transmission packet loss. The total number of valid pixels is then counted. Based on statistical principles, the distribution characteristics of the cleaned grayscale data are calculated. First, the grayscale values of all valid pixels within the window are summed and divided by the total number of pixels to obtain the average grayscale value of the window. Then, the square of the difference between the grayscale value of each pixel and the average value is calculated. The squares of all the differences are summed and divided by the total number of pixels to obtain the variance. Finally, the square root of the variance is taken to obtain the standard deviation of the grayscale values of the window. The calculated average value, standard deviation, and the original cleaned grayscale value sequence are packaged and stored as the basic dataset describing the brightness distribution characteristics of the local window, resulting in a set of pixel grayscale values. In the formula for calculating the asymmetric index of fractal modulation, the fractal dimension is introduced to nonlinearly modulate the traditional statistical skewness. By utilizing the physical characteristics of the coexistence of the complexity (high fractal dimension) of the crack region in the high-dimensional feature space and the asymmetry (negative skewness) of the gray-level distribution, the signal intensity of the crack target is enhanced through a logarithmic amplification mechanism, while suppressing background noise, thereby enhancing the texture of fine cracks. The steps to obtain the parameter are as follows: This parameter represents the first... The standard skewness value of each overlapping sliding window unit is used to quantify the degree of asymmetry in the local grayscale distribution. Its physical meaning is to reflect whether there are extreme textures of dark colors (cracks) or bright colors (stones) within the window. Obtaining this parameter requires the set of pixel grayscale values extracted in the previous step. The specific calculation formula is as follows: ,in For the first grayscale value of each pixel. The mean, Standard deviation The number of pixels is calculated by iterating through all pixels in the window, summing the cubes of their differences from the mean, and then dividing by the cube of the standard deviation multiplied by the number of pixels. If the result is negative, it indicates that the grayscale distribution is skewed to the left and there are dark anomalies (such as cracks). If the result is positive, it indicates that there are bright anomalies.
[0031] The steps to obtain the parameter are as follows: This parameter is the first... The fused contrast grayscale surface roughness index of each overlapping sliding window unit directly calls the value at the corresponding coordinate position in the fractal dimension feature map of the slope surface generated in the previous step. This value reflects the geometric complexity and roughness of the textured surface within the window, and the value range is usually between 2.0 and 3.0. It is obtained through the window's row and column index. Retrieve by searching within the feature map matrix, for example, by reading a specific window. .
[0032] The steps for obtaining the parameter are as follows: This parameter is the reference fractal dimension, serving as a benchmark threshold for judging whether the texture is sufficiently complex. Its setting is based on distinguishing the natural roughness of ordinary soil background from the abnormal roughness generated by cracks. Parameter acquisition requires statistical analysis of healthy slope samples without cracks within the monitoring area. Twenty typical healthy soil areas with uniform illumination and no vegetation cover are selected, and their fractal dimensions are calculated for each. The average of these 20 values is taken as the reference value. In real-world scenarios, the average fractal dimension of healthy soil is calculated to be 2.1, therefore, we set... .
[0033] The steps for obtaining the parameter are as follows: This parameter is a fractal modulation coefficient, used to control the amplification factor of the fractal dimension difference on the skewness value. Its purpose is to increase the distance between the crack region and the shadow region in terms of feature values while preserving the skewness sign attribute. Parameter acquisition requires constructing a validation set containing crack samples and shadow samples, and adjusting the parameter in steps of 0.5 within the range of 1.0 to 10.0. Values, calculations differ The feature discrimination (such as inter-class distance) of the two classes of samples is selected to maximize the discrimination. Experiments have verified that when... When the value is 5.0, the enhancement effect on the crack target is the best without introducing too much noise, so it is set to... .
[0034] Calculations based on parameters: Select a window that includes crack features Example of calculation: Obtain skewness parameters : For example, the set of grayscale values within the window is 5 pixels. .
[0035] Calculate the mean .
[0036] Calculate the standard deviation : variance: .
[0037] .
[0038] Calculate the third central moments : ; ; ; ; ; Sum .
[0039] .
[0040] calculate : .
[0041] The result is negative, which is consistent with the characteristics of a dark crack.
[0042] 2. Obtain the fractal dimension parameter: Read the feature map to obtain .
[0043] Reference value .
[0044] Modulation coefficient .
[0045] 3. Calculate the modulation term: Difference .
[0046] .
[0047] .
[0048] 4. Calculate the logarithmic term: .
[0049] .
[0050] 5. Calculate the final index : .
[0051] .
[0052] .
[0053] This result indicates that the original skewness After being modulated with a high fractal dimension (representing complex textures), its absolute value is amplified to This enhances the saliency of the window as a candidate region for cracks. If the region is flat (low FD), the logarithm approaches 1, and the skewness is not amplified, thus suppressing noise interference in the flat region.
[0054] The steps to obtain the local texture skewness statistics matrix are as follows: Based on the fractal modulation asymmetry index, the rotation-invariant binary comparison code of the center pixel of each overlapping sliding window unit is extracted. The fractal modulation asymmetry index and the rotation-invariant binary comparison code are combined item by item to form a two-dimensional statistical matrix based on the row and column position index, and a local texture skewness statistical matrix is generated.
[0055] Specifically, based on the fractal modulation asymmetry index, the local texture microstructure is encoded and extracted for each overlapping sliding window unit. The geometric center pixel position of each window is located, and the gray value of this center pixel is obtained as a comparison threshold. With this pixel as the center and a radius of 1 pixel, the gray values of the surrounding 8 neighboring pixels are sampled clockwise. The gray value of each neighboring pixel is compared with the center pixel. If the gray value of the neighboring pixel is greater than or equal to that of the center pixel, the position is marked as a binary value of 1; otherwise, it is marked as 0. This generates an 8-bit original binary sequence. To eliminate the influence of the drone's shooting angle rotation on texture recognition, the 8-bit binary sequence is cyclically shifted bit by bit to generate 8 different binary values. After converting it to decimal, the minimum value is selected as the rotation-invariant binary comparison code of the center pixel of the window. This code can stably describe the local micro-texture pattern. Then, the fractal modulation asymmetric exponential floating-point value corresponding to the window is read, and the floating-point number is paired with the calculated integer rotation-invariant code to construct a two-element feature vector containing "macro-statistical features and micro-structural features". According to the row and column position index of the window in the original image, the feature vector is filled into a pre-initialized two-dimensional matrix container to ensure that the number of rows and columns of the matrix strictly corresponds to the grid of the sliding window. Finally, a structured data body that integrates multi-scale fractal features and local texture patterns is formed, generating a local texture skewness statistical matrix.
[0056] The steps for obtaining the spatial distance set of texture features are as follows: Based on the local texture skewness statistical matrix and the fractal dimension feature map of the slope surface, pixel-level registration is completed by row and column index. The fractal modulation asymmetric index is read point by point and the fractal dimension value at the same position is extracted. The fractal dimension value and the fractal modulation asymmetric index are sequentially concatenated into two-dimensional entries according to a fixed field order to generate a pixel-level multidimensional feature vector. Based on the pixel-level multidimensional feature vector, the Euclidean distance to the standard soil texture reference vector is calculated sequentially according to the pixel coordinates. Each distance value and its corresponding row and column index are recorded to generate a texture feature space distance set.
[0057] Specifically, based on the local texture skewness statistical matrix and the fractal dimension feature map of the slope surface, matrix operations in image processing are used to precisely align the statistical matrix containing texture structure information with the fractal feature map containing geometric complexity in space. A unified row and column index traversal rule is set to ensure that data points at the same coordinate positions in the two matrices correspond to the same physical region in the original image. A three-dimensional array or two-channel matrix with a depth of 2 is initialized in memory as a feature storage container. The matrix units are scanned one by one in row-major order. For each scanned coordinate position... First, the grayscale fractal dimension value of the slope surface is read from the fractal dimension feature map of that location. This value reflects the roughness of the local surface. Then, the corresponding fractal modulation asymmetric index is extracted from the local texture skewness statistical matrix. This index characterizes the skewness of the local gray-level distribution and its significance after fractal weighting. Following a predefined field order, these two feature values are arranged sequentially to construct a feature vector containing two elements. To eliminate the impact of differences in dimensions between different feature dimensions on subsequent distance calculations, the elements in the feature vector are standardized using the Z-Score standardization method, calculated as follows: ,in These are the original eigenvalues. This represents the mean of this feature across the entire graph. Using the standard deviation, the standardized feature values are recombined, and finally the feature vectors at all locations in the entire image are organized according to the original spatial topology to generate pixel-level multidimensional feature vectors.
[0058] Based on pixel-level multidimensional feature vectors, a feature space is constructed to measure the degree of texture anomalies. First, a standard soil texture reference vector representing the background environment needs to be obtained. This reference vector is obtained by selecting representative healthy soil areas as a sample set from the slope image to be detected; for example, manually selecting or automatically identifying 10 areas with an area of... For each pixel in a crack-free, vegetation-free exposed soil region, a multi-dimensional feature vector is extracted. The average of all sample feature vectors is calculated to obtain a standard soil texture reference vector. For example, the calculated reference vector value is Where 2.15 represents the average fractal dimension of healthy soil, and 0.02 represents the average asymmetry index of healthy soil (close to zero indicates symmetrical gray-level distribution). Subsequently, the multi-dimensional feature vectors at the pixel level of the entire image are traversed. Calculate its relationship with the reference vector The Euclidean distance between them is calculated using the following formula: ,in Indicates the first Texture feature distance at each location, and The standardized feature value for this location is the distance value that quantifies the degree to which the texture features at the current location deviate from the normal soil background. The larger the value, the greater the difference between the texture of the area and the healthy soil. Each calculated distance value is bound to its row and column coordinate index in the image and a distance matrix with the same resolution as the original image is constructed to generate a texture feature spatial distance set.
[0059] The steps to obtain the crack texture deviation map are as follows: Based on the spatial distance set of texture features, the fractal modulation asymmetric index in the pixel-level multidimensional feature vector is called and filtered for values less than zero. Only the distance values that meet the conditions are retained and written into the corresponding pixel coordinate grid. Zero values are written to the unretained positions in row priority order to maintain dimensional consistency, thereby generating a crack texture deviation map.
[0060] Specifically, based on the spatial distance set of texture features, the calculated degree of difference is directionally filtered to distinguish crack targets from other types of texture anomalies (such as anomalies caused by bright rocks), and the corresponding fractal modulation asymmetric index in the pixel-level multidimensional feature vector is called. As a criterion, the filtering logic is set to retain only regions with an asymmetry index less than zero. This is because cracks in images typically appear as a set of pixels darker than the background, leading to a negative skewness in the local grayscale distribution, thus... The value is negative, while prominent rocks or areas reflecting light will produce a positive bias. The specific execution process involves checking pixel by pixel; if a certain location has a negative bias... If the texture difference at that location is attributed to a dark feature (potential crack), then the distance value of that location in the texture feature spatial distance set is retained. This distance is then written into the corresponding grid cell of the resulting matrix. The magnitude of this distance value represents the salience of the crack texture. If a certain location... If the texture difference at that location is determined to be not caused by a crack (it may be caused by rock or uneven lighting), the value at that location in the resulting matrix is forcibly set to zero. Through this conditional filtering based on physical characteristics, the interference of false cracks is effectively eliminated. The full map traversal and assignment operations are completed in row-major order, and finally a single-channel floating-point matrix with non-zero response values only in potential crack areas is obtained, generating a crack texture deviation map.
[0061] The steps for obtaining the adaptive segmentation threshold are as follows: Based on the crack texture deviation map, the pixels are traversed in row and column order to read the deviation value, missing values and abnormal occupant values are removed, the deviation value range is determined and the boxes are divided at equal intervals. After the pixel count is accumulated for each box, the box probability is obtained by normalizing the total number of pixels. The box is written into the record table in the order of the box center and the box boundary index is retained to generate the deviation histogram distribution probability. Based on the probability distribution of the deviation histogram, each box boundary is selected as a potential segmentation point in turn. The sum of the probabilities on the left and the sum of the probabilities on the right of the segmentation point are calculated. The weighted average of the probabilities on each side is used to obtain the mean on the left and the mean on the right. The product of the squares of the differences between the probabilities on both sides and the means on both sides is used as the inter-class variance and the position of the maximum value is recorded to generate an adaptive segmentation threshold.
[0062] Specifically, based on the crack texture deviation map, the image data interface in computer memory is used to perform a full scan of the single-channel floating-point deviation map in row-major order, reading the deviation value at each pixel position one by one. During the reading process, a data cleaning filter is established to check the validity of each value, removing invalid data with NaN (non-numeric) values and abnormal placeholders of zero or negative values used as background markers in previous steps. Only valid deviation data with values greater than zero are retained to construct a sample set. The minimum value in this sample set is then found and recorded. and maximum value Determine the dynamic distribution range of the valid data and set the sampling resolution of the histogram, such as setting the number of bins. According to the formula Calculate the coverage width of each box. Initialize a string of length. Given a count array, iterate through the set of valid samples again, and for each deviation value... By calculating the index Map the data to the corresponding box, increment the counter of that box, and after completing the statistics of all data, obtain the total number of valid pixels. The counting array is normalized, and the probability of each box appearing is calculated. ,in For the first Pixel counts for each box, and simultaneously calculates the center representative value for each box. The central representative value is paired with the corresponding probability value and stored sequentially in the histogram data structure according to the bin index order to generate the deviation histogram distribution probability.
[0063] Based on the probability distribution of the deviation histogram, the optimal threshold is automatically searched using the Otsu's algorithm (maximum inter-class variance method), and iterative variables are set. Represents a potential split boundary index, with values ranging from to Each box boundary is used as a dividing point between the background and the crack, for example. Calculate the sum of probabilities for the left side of the segmentation point (background class). And the sum of probabilities on the right side (crack type). Calculate the probability-weighted average of the left and right sides, which is the average deviation of the background class. Average deviation from crack type Based on the above statistics, the formula for calculating the inter-class variance is as follows: ,in, The current split point Inter-class variance The percentage of pixels in the background area. The percentage of pixels in the crack area. The average texture deviation of the background area. The average texture deviation in the crack region. For the first The deviation center value of each box, For the first The probability distribution of each box is calculated using a formula to measure the degree of distinction between foreground and background under the current threshold. A larger variance value indicates higher distinction. During the traversal, the calculated variance values are recorded in real time, and the maximum variance value is compared and retained. and its corresponding split point index Finally, the deviation value corresponding to the best index is used as the globally optimal segmentation standard to generate an adaptive segmentation threshold.
[0064] The steps for obtaining the binary identification map of the slope crack area are as follows: Based on the adaptive segmentation threshold, the deviation value of the crack texture deviation map is read pixel by pixel. Pixels exceeding the adaptive segmentation threshold are marked as foreground and their row and column indices are retained. The connectivity is traversed according to the row and column indices and the four adjacent pixels are connected as the connection rules and merged into regions. Pixels that do not exceed the adaptive segmentation threshold are set to zero, and a binary recognition map of the slope crack region is generated.
[0065] Specifically, based on the adaptive segmentation threshold, the final pixel-level classification and region merging operations are performed. A binarization matrix with the same size as the original image is created, and all elements are initialized to zero. The deviation value of each pixel in the crack texture deviation map is read row by row and column by column according to the image coordinate system. The read value is compared with the calculated adaptive segmentation threshold. If the deviation value of the pixel is greater than the threshold, it is determined to be a crack foreground, and the corresponding position in the binarization matrix is marked as 1, and the row and column index of the pixel is recorded. If it is less than or equal to the threshold, it is kept as 0. After completing the binarization and marking of the entire image, based on the recorded values... The foreground pixel index is used to perform a connected component analysis algorithm, which adopts the four-neighbor connection rule. That is, for any foreground pixel, the state of the pixels in its four adjacent positions (upper, lower, left, and right) is checked. If the adjacent pixels are also foreground, they are merged into the same connected region. All foreground pixels are traversed through breadth-first search (BFS) or depth-first search (DFS) strategies. A unique region label ID is assigned to each independent connected pixel set. All pixels belonging to the same ID are merged into an independent crack object, thereby eliminating isolated noise points and reconstructing the continuous shape of the crack, generating a binary recognition map of the slope crack area.
[0066] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A method for identifying slope cracks based on UAV imagery, characterized in that, Includes the following steps: Based on the UAV slope monitoring images, the image grayscale matrix is divided into overlapping sliding window units. Three-dimensional cubic grids of different scales are used to cover the image grayscale surface in each window. The grayscale surface roughness index is calculated and mapped to the pixel coordinates of the window center to generate a fractal dimension feature map of the slope surface. Based on the fractal dimension feature map of the slope surface, the set of pixel gray values corresponding to each window position is extracted, the fractal modulation asymmetry index is calculated and generated, and the fractal modulation asymmetry index is combined with the rotation-invariant binary comparison code of the center pixel of the window to generate a local texture skewness statistical matrix. Based on the local texture skewness statistical matrix and the fractal dimension feature map of the slope surface, a pixel-level multidimensional feature vector including fractal dimension values and fractal modulation asymmetry index is constructed. The distance between the feature vector and the standard soil texture reference vector is calculated to generate a texture feature space distance set. The texture feature space distance set is filtered using the conditional judgment logic that the fractal modulation asymmetry index is negative, and the distance values corresponding to the negative skewness region are retained to generate a crack texture deviation map. Based on the crack texture deviation map, an adaptive segmentation threshold is generated. The binary values of the crack texture deviation map and the adaptive segmentation threshold are compared to generate a binary recognition map of the slope crack area.
2. The slope crack identification method based on UAV imagery according to claim 1, characterized in that, The steps for obtaining the fractal dimension feature map of the slope surface are as follows: Based on the image grayscale matrix of the UAV slope monitoring image, it is divided into overlapping sliding window units according to a fixed row and column step size. A multi-scale three-dimensional cubic mesh is constructed for each overlapping sliding window unit. The number of non-empty cubes that intersect the grayscale surface with the mesh at each scale is counted, and the mesh side length corresponding to each scale is recorded to generate a pairing sequence of non-empty cube number and mesh scale. The roughness index of the grayscale surface is calculated based on the pairing sequence of the number of non-empty cubes and the grid scale. Based on the grayscale surface roughness index, the grayscale surface roughness index of each overlapping sliding window unit is mapped to the center pixel coordinate of the corresponding overlapping sliding window unit. The overlapping areas are then weighted, fused, and spatially smoothed to generate a fractal dimension feature map of the slope surface.
3. The slope crack identification method based on UAV imagery according to claim 1, characterized in that, The steps for obtaining the fractal modulation asymmetric index are as follows: Based on the fractal dimension feature map of the slope surface, overlapping sliding window units are divided according to a fixed row and column step size. All pixel gray values of each overlapping sliding window unit are read, missing values are removed, and the average value and standard deviation of the gray value set are calculated to obtain the pixel gray value set. Calculate the fractal modulation asymmetry index based on the set of pixel gray values.
4. The slope crack identification method based on UAV imagery according to claim 1, characterized in that, The steps for obtaining the local texture skewness statistics matrix are as follows: Based on the fractal modulation asymmetry index, the rotation-invariant binary comparison code of the center pixel of each overlapping sliding window unit is extracted. The fractal modulation asymmetry index and the rotation-invariant binary comparison code are combined item by item to form a two-dimensional statistical matrix based on the row and column position index, and a local texture skewness statistical matrix is generated.
5. The slope crack identification method based on UAV imagery according to claim 1, characterized in that, The steps for obtaining the texture feature spatial distance set are as follows: Based on the local texture skewness statistical matrix and the fractal dimension feature map of the slope surface, pixel-level registration is completed by row and column index. The fractal modulation asymmetric index is read point by point and the fractal dimension value at the same position is extracted. The fractal dimension value and the fractal modulation asymmetric index are sequentially concatenated into two-dimensional entries according to a fixed field order to generate a pixel-level multidimensional feature vector. Based on the pixel-level multidimensional feature vector, the Euclidean distance to the standard soil texture reference vector is calculated sequentially according to the pixel coordinates. Each distance value and its corresponding row and column index are recorded to generate a texture feature space distance set.
6. The slope crack identification method based on UAV imagery according to claim 1, characterized in that, The steps for obtaining the crack texture deviation map are as follows: Based on the texture feature space distance set, the fractal modulation asymmetric index in the pixel-level multidimensional feature vector is called and filtered for conditions less than zero. Only the distance values that meet the conditions are retained and written into the corresponding pixel coordinate grid. Zero values are written to the unretained positions in row priority order to maintain dimensional consistency, thereby generating a crack texture deviation map.
7. The slope crack identification method based on UAV imagery according to claim 1, characterized in that, The steps for obtaining the adaptive segmentation threshold are as follows: Based on the crack texture deviation map, the pixels are traversed in row and column order to read the deviation value, missing values and abnormal occupant values are removed, the deviation value range is determined and the boxes are divided at equal intervals. After the pixel count is accumulated for each box, the box probability is obtained by normalizing the total number of pixels. The box is written into the record table in the order of the box center and the box boundary index is retained to generate the deviation histogram distribution probability. Based on the probability distribution of the deviation histogram, each box boundary is selected as a potential segmentation point in sequence. The sum of probabilities on the left and the sum of probabilities on the right of the segmentation point are calculated. The left mean and the right mean are obtained by weighting the probability on each side to the center of the box. The product of the square of the difference between the probability on both sides and the mean on both sides is used as the inter-class variance and the position of the maximum value is recorded to generate an adaptive segmentation threshold.
8. The slope crack identification method based on UAV imagery according to claim 1, characterized in that, The steps for obtaining the binary identification map of the slope crack area are as follows: Based on the adaptive segmentation threshold, the deviation value of the crack texture deviation map is read pixel by pixel. Pixels exceeding the adaptive segmentation threshold are marked as foreground and their row and column indices are retained. The connectivity is traversed according to the row and column indices and the four adjacent pixels are connected as the connection rules and merged into regions. Pixels that do not exceed the adaptive segmentation threshold are set to zero, and a binary recognition map of the slope crack region is generated.