A multi-scale adaptive soil shrinkage crack identification method
By combining the full-scale Frangi filtering discrimination algorithm, bilateral filtering and tensor voting method, the problems of low crack identification accuracy and weak anti-noise interference ability in soil shrinkage crack identification are solved, and high-precision crack identification and segmentation in multi-scale environment is realized.
Patent Information
- Application Number
- CN202310550048.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-16
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2043-05-16
AI Technical Summary
Existing methods for identifying soil shrinkage cracks suffer from low crack identification accuracy, weak resistance to noise interference, and unreasonable parameter determination in complex scenarios. In particular, they are difficult to accurately identify the location of shrinkage cracks in multi-scale crack and multi-scale noise environments.
A multi-scale adaptive identification method based on full-scale Frangi filtering discrimination algorithm, bilateral filtering, Frangi filtering and tensor voting method is adopted. The contrast between shrinkage cracks and soil background is enhanced by adaptive threshold segmentation algorithm, and the crack location is accurately located by skeleton algorithm to eliminate noise interference.
It improves the accuracy and robustness of soil shrinkage crack identification, is applicable to soil shrinkage crack segmentation at different scales and signal-to-noise ratios, enhances the applicability of the segmentation algorithm and the adaptability of parameters, and ensures the accuracy and detail preservation of crack identification.
Smart Images

Figure CN116778462B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of soil shrinkage crack identification methods, and particularly relates to a multi-scale adaptive soil shrinkage crack identification method. BACKGROUND
[0002] With global warming and the frequent occurrence of drought and flood, soil shrinkage cracks, as a common natural phenomenon, have become more and more frequent. However, soil shrinkage cracks will expand soil pores, destroy the internal structure of soil, and further cause a series of problems in agricultural production, environment, engineering and other aspects. Therefore, a large number of researches have been carried out at home and abroad on the formation mechanism and development process of soil shrinkage cracks, and the identification of soil shrinkage cracks is an important basis for many researches. At present, the common tools or methods for obtaining and identifying soil shrinkage cracks mainly include grid sample frame, camera, laser device, X-ray tomography, geological radar, resistivity imaging and the like. Although the segmentation and identification of cracks photographed by the camera can only obtain the surface cracks of the soil, however, this method has higher accuracy, economy, efficiency and stronger robustness, and therefore, this method is the most common method for soil shrinkage crack identification.
[0003] Currently, the methods of soil shrinkage crack image recognition mainly include two categories. The first category can be summarized as deep learning, including U-Net convolutional neural network and Attention Res-Unet network architecture. Although deep learning provides a good solution, this method is highly dependent on training samples, and its accuracy is difficult to guarantee when the training samples are insufficient, especially in the case of large differences in the background color and crack width of various types of soil, which further increases the difficulty of model training. At the same time, the annotation work of shrinkage crack pixels in the training sample is tedious, which increases the difficulty of identifying shrinkage cracks through deep learning. The second category can be summarized as image threshold segmentation. Its basic steps are: converting the soil shrinkage crack image in RGB format to grayscale image, and then selecting a reasonable grayscale threshold to segment the soil background and shrinkage crack. This method is simple to operate, has small computational complexity and stable performance, and can better handle simple scenarios such as soil with large swelling-shrinking characteristics and low moisture content (i.e. wide cracks and high contrast) whose gray value histogram presents a "double peak" distribution. However, when dealing with complex scenarios such as soil shrinkage cracks with different swelling-shrinking characteristics and different moisture contents, the soil gray value histogram under complex scenarios often presents a "single peak" distribution (mainly concentrated in the soil background gray value), and this method often appears inaccurate crack segmentation and poor noise elimination effect. The complexity of soil shrinkage crack recognition is specifically manifested in low crack recognition accuracy, weak anti-noise interference ability, and unreasonable parameter determination. In terms of low crack recognition accuracy, the main reasons include: 1) the crack is a small crack. When the soil swelling-shrinking characteristics are small or the soil moisture content is high (in the early stage of cracking), the width and area of the soil shrinkage crack are small. Although the width of some shrinkage cracks increases with the evaporation of soil moisture, the end of the crack is still a small crack, and the small crack area density and width will lead to the gray value distribution of the image presenting a "single peak" distribution; 2) the contrast between the soil shrinkage crack and the soil background of some soil is not high, in addition, the unevenness of water evaporation during soil drying leads to the existence of "color spots" around the crack, further reducing the contrast between the shrinkage crack and the soil background. The above factors will lead to the gray value distribution of the shrinkage crack being more averaged, further increasing the difficulty of threshold segmentation and presenting a "single peak" distribution in the gray value histogram. In terms of weak anti-noise interference ability, since the gray value of the edge of the uneven soil particles or aggregate structure is small, the edge is often identified as a shrinkage crack. In terms of unreasonable parameter determination, when appropriate filtering is used to enhance the contrast of the shrinkage crack and eliminate noise interference, the differences in soil swelling-shrinking characteristics, shrinkage crack development degree, and shrinkage crack position all pose challenges to the appropriate selection of filtering parameters. The above complexity can be summarized as the characteristics of multiple crack scales (multi-scale cracks) and multiple signal-to-noise ratios (multi-scale noise) in the whole process of soil shrinkage cracking.
[0004] However, no matter how the crack size and signal-to-noise ratio change, the gray value of the dry shrinkage crack and the soil background in a certain range thereof presents a good bimodal distribution, and if the position of the soil dry shrinkage crack can be accurately identified (i.e., the skeleton of the dry shrinkage crack is accurately obtained), adaptive threshold segmentation can be carried out in the crack region to better cope with the complex scene of multi-scale cracks and multi-scale noises. However, the accurate acquisition of the crack skeleton position is often restricted by the above-mentioned multi-scale cracks and multi-scale noises. The main reason for the low accuracy of crack identification is that the image gray value distribution is uniform, and therefore it is necessary to enhance the contrast between the soil dry shrinkage crack and the soil background and "color spots", i.e., dry shrinkage crack image enhancement; for noise interference, a reasonable denoising method should be selected to maintain the edges and details of the dry shrinkage crack and reduce the interference of the edges of soil particles or aggregate structures and other noises.
[0005] In summary, the soil dry shrinkage crack identification is the basis and key of the quantitative research on the soil dry shrinkage crack, but both of the two common methods have certain deficiencies, and if a reasonable method and parameters can be selected to accurately enhance the soil dry shrinkage crack and eliminate image noise, and then the position of the crack is determined and the adaptive threshold method is used along the crack for image segmentation, the above-mentioned deficiencies can be solved. In view of this, the present application develops a multi-scale adaptive dry shrinkage crack identification method based on the full-scale Frangi filter discrimination algorithm, bilateral filtering, Frangi filtering and tensor voting method. SUMMARY
[0006] At present, in the complex scene of multi-scale cracks and multi-scale noises, when the soil dry shrinkage crack is identified by image threshold segmentation, the gray value histogram of the low signal-to-noise ratio image is often "unimodal" distribution, and the edges of non-uniform soil particles or aggregate structures and other noises are difficult to eliminate, and the above factors will lead to low accuracy of crack identification, which will ultimately affect the quantitative analysis of the soil dry shrinkage crack. In view of the above deficiencies, the present application aims to solve the following technical problems:
[0007] (1) An adaptive threshold segmentation algorithm based on the crack region is constructed to solve the low precision of the global threshold method or the adaptive threshold method of traversing the image for segmenting the dry shrinkage crack in the complex scene; in addition, the crack region of the original soil image is accurately identified, and on this basis, a suitable threshold window is selected to carry out the adaptive threshold segmentation algorithm, which can also solve the problem of detail loss caused by threshold segmentation based on the preprocessed image by filtering;
[0008] (2) An algorithm for determining the adaptive crack image type and parameters based on the full-scale spatial scale factor Frangi filter (referred to as "full-scale Frangi filter discrimination algorithm") is constructed to solve the problem of unreasonable parameter determination caused by the difference in soil expansion and shrinkage characteristics, the difference in dry shrinkage crack development degree, and the difference in dry shrinkage crack position, and to enhance the robustness of the algorithm combination in the present application.
[0009] (3) Construct a drying crack enhancement filter based on bilateral filtering and Frangi filtering. This filter can smooth the soil background image and retain the linear structure of the drying crack, thereby enhancing the contrast between the soil drying crack and the soil background and initially removing image noise, solving the shortcomings of the drying crack not being accurately identified due to factors such as small cracks, low contrast, and "color spots" in complex scenes.
[0010] (4) After the above-mentioned filter combination enhancement and preliminary denoising, a denoising algorithm based on tensor voting method is constructed to further solve the noise interference such as the edges of uneven soil particles or aggregate structures in complex scenes. At the same time, this method can solve the deficiency of the loss of dry shrinkage crack connection details caused by the above-mentioned crack enhancement filter processing of images, thereby improving the accuracy of crack identification.
[0011] To achieve the above objectives, the present invention specifically provides the following technical solution:
[0012] A multi-scale adaptive soil drying shrinkage crack identification method includes the following steps:
[0013] S1. Obtain the original RGB color image of the soil shrinkage cracks, preprocess the image, and obtain the preprocessed image;
[0014] S2. Determine the calculation parameters of the spatial domain standard deviation and the range standard deviation of the bilateral filter based on the full-scale Frangi filter discrimination algorithm;
[0015] S3. Determine the image type of shrinkage crack based on the full-scale Frangi filter discrimination algorithm, and determine the calculation parameters of Frangi filter, tensor voting method, and adaptive OTSU threshold segmentation algorithm based on crack skeleton;
[0016] S4. Perform bilateral filtering on the preprocessed image. This process preserves and enhances the details of the drying shrinkage cracks while smoothing the soil background area.
[0017] S5. Use Frangi filtering to enhance and denoise the bilaterally filtered image.
[0018] S6. Use the voting tensor method to perform detail restoration and further noise reduction on the Frangi filter-processed image, and output an image of the location range of shrinkage cracks.
[0019] S7. Use the skeleton algorithm to output a skeleton diagram of the location range of shrinkage cracks;
[0020] S8. Perform adaptive OTSU threshold segmentation along the skeleton on the preprocessed image to obtain a binarized image of shrinkage cracks, which is then output as S8.
[0021] As a further technical solution of the present invention, in S1, the image preprocessing method is to select the red channel of the RGB image of the shrinkage crack.
[0022] As a further technical solution of the present invention, in S2, the calculation parameters for determining the spatial domain standard deviation and the range standard deviation of the bilateral filter based on the full-scale Frangi filter discrimination algorithm include the following steps:
[0023] S201. Set the spatial scale factor range and step size of the full-scale Frangi filter discrimination algorithm, and calculate the Gaussian second derivative of the image.
[0024] S202. Calculate the convolution of the image with the second-order partial derivative of Gaussian to generate the Hessian matrix;
[0025] S203. Calculate the two eigenvalues of the Hessian matrix and find the filter response of each pixel for different spatial scale factors.
[0026] S204. Calculate the variance of the filter response values of all pixels corresponding to each spatial scale factor, the variance of the non-zero filter response values, and the average value of the non-zero filter response values, and plot the distribution curves of the above three calculated outputs based on the spatial scale factor.
[0027] S205. Calculate the scale space factor corresponding to the peaks in the three distribution curves. Select the maximum value σmax and the minimum value σmin from the scale factors corresponding to the three peaks, and use them as the calculation parameters for the standard deviation of the bilateral filter in the spatial domain and the standard deviation of the range in S4.
[0028] As a further technical solution of the present invention, in S3, the determination of the drying crack image type based on the full-scale Frangi filter discrimination algorithm, and the determination of the calculation parameters of Frangi filter, tensor voting method, and adaptive OTSU threshold segmentation algorithm based on crack skeleton, includes the following steps:
[0029] S301. Based on S2, count the number of 8 connected components and the number of pixels corresponding to the filter response values of all pixels for each inter-scale factor within the range of σmin-σmax.
[0030] S302. Count the maximum number of connected pixels and the average number of connected pixels in the 8 connected regions of the filter response in S301.
[0031] S303. Determine the crack image type based on the number of pixels in the largest connected component and the average number of pixels in the connected component.
[0032] S304. Based on the type of crack image, calculate the parameters in steps S5, S6, S7, and S8 according to σmax, σmin, and the average value of the full-scale Frangi filter response.
[0033] As a further technical solution of the present invention, in S4, the bilateral filtering process on the preprocessed image includes the following features: the spatial domain standard deviation, gray-level domain standard deviation, and filter kernel side length are calculated using σmax and σmin as parameters.
[0034] As a further technical solution of the present invention, in S5, the Frangi filter performs filtering enhancement and noise reduction on the bilateral filter output image, including the following steps:
[0035] S501. Based on the crack image type identified in S3, calculate the spatial scale factor range and the filter response threshold, and select an appropriate step size.
[0036] S502. Calculate the convolution of the image with the second-order partial derivative of Gaussian according to the parameters set in S501, and generate the Hessian matrix.
[0037] S503. Calculate the two eigenvalues of the Hessian matrix and find the filter response values corresponding to different spatial scale factors.
[0038] S504. Based on the filtered response value of each pixel within the spatial scale factor range, the maximum value of the filtered response value among all pixels is used as the denominator. The maximum value of the filtered response value among each pixel is calculated and normalized, and used as the input of S505.
[0039] S505. Compare the normalized filter response of each pixel in the image with the threshold. Assign the filter response of pixels whose filter response is less than the threshold to 0, and keep the filter response of pixels whose filter response is less than the threshold at its original value, and use it as the filter output.
[0040] As a further technical solution of the present invention, in S6, the voting tensor method performs detail restoration and further noise reduction on the Frangi-filtered image, including the following features: the scale parameter in the voting tensor method is obtained from σmax and σmin in S2:
[0041] As a further technical solution of the present invention, in S7, the skeleton algorithm is used to output a skeleton diagram of the location range of shrinkage cracks, including the following steps:
[0042] S701. Based on the shrinkage crack location range map output by S6, convert the red channel output image of S1 into a binary image, that is, assign the value 1 to the red channel output image within the crack range, and assign the value 0 to the other pixels.
[0043] S702. Extract the skeleton, eliminate bone spurs and remove isolated points based on the parameters output in S2 and S3, and output the skeleton diagram.
[0044] As a further technical solution of the present invention, in S8, the step of performing adaptive OTSU threshold segmentation along the skeleton of the preprocessed image to obtain a binarized image of shrinkage cracks, which is then output as S8, includes the following steps:
[0045] S801. Determine the window side length of the adaptive threshold segmentation method based on σmax output in S2.
[0046] S802. Count the number of soil background pixels in the output image of the tensor voting method in S6. Based on the position of the soil background pixels, assign the value of 255 to the pixel corresponding to the red channel image output in S1. Use the output image as the input image of S803.
[0047] S803. Based on the position of each non-zero pixel point in the skeleton image (i.e., crack skeleton pixel point), find the corresponding pixel point in the output image of S802, construct a cell with the output of S801 as the side length, perform OTSU threshold segmentation on the cell in the output image of S802, and iterate to complete the segmentation of the cell corresponding to all non-zero pixels.
[0048] S804. Merging the segmented images of all cells yields the output of the adaptive soil shrinkage crack segmentation algorithm based on the crack region.
[0049] S805 takes the red channel output image and the binarized image output by S804 as inputs and repairs the broken parts of the binarized image output by S804.
[0050] Compared with existing technologies, the beneficial effects of this invention are as follows: This invention addresses the shortcomings of traditional threshold segmentation algorithms for soil shrinkage cracks, such as low crack identification accuracy, weak resistance to noise interference, and unreasonable parameter determination. It constructs a multi-scale, multi-signal-to-noise ratio adaptive multi-scale shrinkage crack segmentation method based on a full-scale Frangi filtering discrimination algorithm, bilateral filtering, Frangi filtering, and tensor voting method. The specific segmentation effect is shown in the example... Figure 1 As shown, its beneficial effects include:
[0051] (1) The present invention designs an adaptive soil shrinkage crack segmentation algorithm based on crack region and its skeleton. The algorithm can be applied to soil shrinkage crack segmentation of different scales and different signal-to-noise ratios, thus enhancing the applicability of the segmentation algorithm.
[0052] (2) The present invention designs a full-scale Frangi filtering discrimination algorithm to determine the type of soil shrinkage crack image and select reasonable filtering parameters. The adaptive filtering parameters enhance the robustness of the present invention.
[0053] (3) The present invention designs a combination of algorithms for enhancing and denoising soil shrinkage cracks based on bilateral filtering, Frangi filtering and tensor voting method, which improves the accuracy of extracting the skeleton of shrinkage cracks. Attached Figure Description
[0054] Figure 1 Comparison of binarized images output by different methods.
[0055] Figure 2 Example image A is a grayscale value histogram provided by this invention.
[0056] Figure 3 This is a flowchart illustrating a multi-scale adaptive soil shrinkage crack identification method provided by the present invention.
[0057] Figure 4 This is a schematic diagram of the discrimination algorithm based on full-scale Frangi filtering provided by the present invention.
[0058] Figure 5 The example image A shows the filtered output based on different scale factors provided by this invention.
[0059] Figure 6 The distribution curve of the response value related parameters provided by the present invention.
[0060] Figure 7 This is a schematic diagram of the S3 step process provided by the present invention.
[0061] Figure 8 This is a schematic diagram of the Frangi enhancement filtering process provided by the present invention.
[0062] Figure 9 The crack extent diagram is shown in Example A of the present invention.
[0063] Figure 10 This is a schematic diagram of the adaptive OTSU segmentation algorithm based on crack location provided by the present invention. Detailed Implementation
[0064] 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.
[0065] To facilitate a better understanding of the technical solution of the present invention by those skilled in the art, specific embodiments of the present invention are provided below:
[0066] like Figure 1As shown, the segmentation of shrinkage cracks in the embodiment is difficult, mainly due to the following reasons: shrinkage cracks are small and micro-cracks with small crack widths and areas, resulting in low contrast between the shrinkage cracks and the soil background; the gray values of the edges of uneven soil particles are lower than the gray values of the soil background, similar to the gray values of the shrinkage cracks, and appear as "linear noise" during segmentation; the uneven evaporation of moisture during soil drying causes "color spots" in the soil around the cracks. All of these factors combined result in a "single-peak" distribution in the gray value histogram of the soil image. Figure 2 When using a global thresholding method for segmentation, the threshold value is often too large, resulting in excessive noise and poor performance. Manually adjusting the threshold makes it difficult to eliminate noise such as linear noise and color spots, and also easily leads to loss of detail. Figure 1 If global threshold segmentation is used after filtering preprocessing, a suitable filter must first be determined. If common median filtering or Gaussian filtering is used, it may further reduce the contrast between the drying shrinkage cracks and the soil background, thereby exacerbating the "single-peak" distribution of the grayscale image.
[0067] To address the aforementioned issues such as "low crack contrast," "color spots," and "linear noise," the algorithm design can enhance the contrast between shrinkage cracks and the soil background using a crack enhancement algorithm. However, it's crucial to consider that crack enhancement filtering will also amplify "linear noise." Filtering can smooth out "color spots" in the soil background area, and appropriate filtering can eliminate "linear noise." After filtering, some connection details of small cracks may be lost; therefore, crack connection must be performed after enhancement and noise reduction. Furthermore, different scales make the selection of the above method parameters particularly important. For example, when the crack width is small, choosing a large filter scale factor will significantly reduce the contrast between the small cracks and the soil background, leading to the loss of crack details. Simultaneously, without reasonable judgment rules, the edges of uneven soil particles are easily enhanced, resulting in increased noise and lower segmentation accuracy. When the crack width increases, if the scale factor is too small, the noise reduction effect will be insignificant.
[0068] Therefore, embodiments of the present invention provide a multi-scale adaptive soil drying shrinkage crack identification method, such as... Figure 3 As shown, it includes the following steps:
[0069] S1. Obtain the original RGB color image of the soil shrinkage cracks, preprocess the image, and obtain the preprocessed image;
[0070] S2. Determine the calculation parameters of the spatial domain standard deviation and the range standard deviation of the bilateral filter based on the full-scale Frangi filter discrimination algorithm;
[0071] S3. Determine the image type of shrinkage crack based on the full-scale Frangi filter discrimination algorithm, and determine the calculation parameters of Frangi filter, tensor voting method, and adaptive OTSU threshold segmentation algorithm based on crack skeleton;
[0072] S4. Perform bilateral filtering on the preprocessed image. This process preserves and enhances the details of the shrinkage cracks while smoothing the soil background area, thereby improving the contrast between the shrinkage cracks and the soil background and improving the accuracy of the next step of Frangi filtering.
[0073] S5. Use Fragi filtering to enhance and denoise the bilaterally filtered image, enhance the linear structure of shrinkage cracks in the image, and initially reduce the influence of noise such as the edges and color spots of soil particles or aggregates.
[0074] S6. Use the voting tensor method to perform detail restoration and further noise reduction on the Frangi filter-processed image, and output an image of the location range of shrinkage cracks.
[0075] S7. Use the skeleton algorithm to output a skeleton diagram of the location range of shrinkage cracks;
[0076] S8. Along the skeleton of the location range of the shrinkage crack, the preprocessed image is subjected to adaptive OTSU threshold segmentation according to a window of a certain size to segment out the shrinkage crack binarized image, which is used as the output of S8.
[0077] In S1 of this embodiment, an RGB image is acquired by the camera, with a resolution of 2400×1650. The first step of a common segmentation method is to convert the image into a grayscale image. In this embodiment, in order to increase the contrast between the soil shrinkage cracks and the soil background, the red channel is selected as the image for subsequent analysis based on prior knowledge.
[0078] After S1 processing, the morphology of shrinkage cracks varies depending on their developmental stage and the soil type. Therefore, the filtering parameters are crucial in determining the processing effectiveness in subsequent filtering. Thus, it is necessary to first determine the type of crack. To this end, this example designs a full-scale Frangi filtering discrimination algorithm, such as... Figure 4 As shown, it includes the following steps:
[0079] S201. Set the spatial scale factor range and step size of the full-scale Frangi filter discrimination algorithm, and calculate the Gaussian second derivative of the image.
[0080] S202. Calculate the convolution of the image with the second-order partial derivative of Gaussian to generate the Hessian matrix;
[0081] S203. Calculate the two eigenvalues of the Hessian matrix and find the filter response corresponding to different spatial scale factors;
[0082] S204. Calculate the variance of the filter response values of all pixels corresponding to each spatial scale factor (including pixels with a filter response value of 0), the variance of the non-zero filter response values (excluding pixels with a filter response value of 0), and the average value of the non-zero filter response values, and plot the distribution curves of the above three calculated outputs based on the spatial scale factor.
[0083] S205. Calculate the scale space factor corresponding to the peaks in the three distribution curves. Select the maximum value σmax and the minimum value σmin from the scale factors corresponding to the three peaks, and use them as the calculation parameters for the standard deviation of the bilateral filter in the spatial domain and the standard deviation of the range in S4.
[0084] The Frangi filtering calculation steps are as follows: Calculate the second partial derivatives of different scale parameters (Equations 1-4) by iterating the scale parameter (σ) in the filter multiple times with a certain step size; obtain the convolution of the image with the second partial derivative of the Gaussian function to generate the Hessian matrix; calculate the eigenvalues λ1 and λ2 of the Hessian matrix, and |λ1|<|λ2|; calculate its filtering response according to Equations (5), (6), and (7).
[0085]
[0086]
[0087]
[0088]
[0089]
[0090]
[0091]
[0092] However, the Frangi filter only achieves the best enhancement effect on cracks when the convolution scale (i.e., spatial scale factor) and crack width are relatively close. Figure 1 Example A shows the different scale factor filtering responses as follows: Figure 5As shown (the original output was black with white lines, but has been converted to white with black lines for easier display), when σ iterates to 2, the filtered output is cracks and "linear noise". However, the output colors are all light (i.e., the filter response value is small) and the output crack width is small (large cracks are not fully expressed). When σ iterates to 4, the crack output includes cracks and relatively small "linear noise" filtered out. The colors of the cracks and "linear noise" are darker, and the width of the larger cracks is widened. When σ iterates to 6, the filter further darkens the color of the dried cracks, filters out some "linear noise", and widens the larger cracks. When σ iterates to 11, "linear noise" is basically completely removed, but details are severely lost. Except for the complete output of the larger cracks, the colors of the other details are lighter or even filtered out.
[0093] Through extensive image experiments, the following patterns were observed: When σ is small, the output has many pixels, the pixel response values are concentrated, and the average value is small. As σ increases, some "linear noise" is removed, and both the crack width and response value increase. Within a certain range, although "linear noise" is not completely eliminated, the crack is basically fully output and the color is relatively dark. At this point, the crack response value is large, and the response value distribution is relatively dispersed, i.e., the response value variance is large. Therefore, based on the output of σ within this range, it can be considered that it maximizes the output of shrinkage cracks and their details while eliminating "linear" noise to a certain extent. As σ further increases, although "linear noise" is further eliminated, some crack details are lost, and the output crack response value decreases, leading to a decrease in the average value and variance of the response value. The evolution trend of the variance and average value of the full-scale filtered output response value with σ iteration is as follows: Figure 6 As shown.
[0094] Based on the above analysis, the scale spatial factors corresponding to the peaks in the three distribution curves are calculated. The maximum value (σmax) and minimum value (σmin) of the scale spatial factors corresponding to the three peaks are selected and used as the calculation parameters for the spatial domain standard deviation and range standard deviation of the bilateral filter in S4.
[0095] Based on step S2, the number of 8 connected components and the number of pixels corresponding to the filter response value for each inter-scale factor within the range of σmin-σmax are statistically analyzed. Extensive experiments have shown that images with similar resolution to this example can be classified as crack images according to the following rules. The values of σmax, σmin, and the average value of the full-scale Frangi filter response (MeanValue) are then output to calculate the parameters for subsequent steps. The calculation process is described in [link to calculation]. Figure 7 This includes the following steps:
[0096] S301. Based on S2, count the number of 8 connected components and the number of pixels corresponding to the filter response values of all pixels for each inter-scale factor within the range of σmin-σmax.
[0097] S302. Count the maximum number of connected pixels and the average number of connected pixels in the 8 connected regions of the filter response in S301.
[0098] S303. Determine the crack image type based on the number of pixels in the largest connected component and the average number of pixels in the connected component.
[0099] S304. Based on the crack image type, calculate the parameters in steps S5, S6, S7, and S8 according to σmax, σmin, and the average value of the full-scale Frangi filter response.
[0100]
[0101] Based on the determination of the crack image type, directly applying Frangi filtering for crack enhancement and denoising will result in insignificant denoising due to Frangi's sensitivity to noise. Therefore, it is necessary to first enhance the shrinkage cracks and eliminate the influence of "color spot" noise. In this embodiment, bilateral filtering is selected. This filter performs convolution on the image based on a weighted combination of spatial and value domains, which can effectively smooth the background area while preserving details such as crack edges. The spatial domain standard deviation (σ) is derived based on the signal-to-noise ratio maximization criterion and experimental results. d ) and range standard deviation (σ) r The calculation formulas for ) are Equations (8) and (9), and the filter kernel function for bilateral filtering is shown in Equation (10):
[0102]
[0103]
[0104]
[0105] In S5, based on the crack image type determined in S3, the spatial scale factor range (σ) is calculated. max_Frangi and σ min_Frangi The formulas for calculating the spatial scale factor step size are shown in Table 1, along with the filtering response threshold.
[0106]
[0107] Based on the determination of the Frangi filter parameters, according to Figure 8 The illustrated process performs crack enhancement and noise reduction on a bilaterally filtered image. Unlike S2, which retains the filter response values for all spatial scale factors, S5, after calculating the filter response values based on different spatial scale factors, uses the maximum value of the filter response among all pixels as the denominator, retaining the σ value for each pixel. min_Frangi —σ max_FrangiThe maximum value of the filtered response within the range and its normalization.
[0108] S6 can handle the loss of connection details of some drying cracks caused by S5 when enhancing cracks and eliminating noise, and further eliminate noise. According to the experiment, the calculation formulas of the scale parameters of the spherical tensor domain and the rod tensor domain in the tensor voting method are Equation (11) and Equation (12).
[0109] σ ball =2×(σ max +σ min (Equation 11)
[0110] σ stick =σ max +σ min (Equation 12)
[0111] To ensure a relatively complete restoration of the crack details lost in S5, the parameters for S6 processing are set relatively high, and the output image is a crack extent map. Figure 9 The original output was black with white lines, but for easier display, it has been converted to white with black lines. Extracting the skeleton of this crack range map allows for the location of the crack. In step S7, based on the shrinkage crack location range map output from S6, the red channel output image from S1 is converted into a binary image. Specifically, pixels within the crack range are assigned a value of 1, while other pixels are assigned a value of 0. This process then extracts the skeleton, eliminates bone spurs and removes isolated points, and outputs the skeleton map.
[0112] The specific process of S8 is as follows: Figure 10 As shown, the specific steps include:
[0113] S801. Determine the window side length of the adaptive threshold method based on σmax output in S2;
[0114] S802. Count the number of soil background pixels in the tensor voting method output image in S6. Based on the background pixels, assign the value of the corresponding pixel in the red channel image output in S1 to 255. Use the output image as the input image of S803.
[0115] S803. Based on each non-zero pixel position (i.e. crack skeleton pixel) in the skeleton image output by S7, find the corresponding pixel in the output image of S802 and construct a cell with it as the center. Using the output of S801 as the cell side length, perform OTSU threshold segmentation on the cell in the output image of S802, and iterate to complete the segmentation of the cell corresponding to all non-zero pixels.
[0116] S804. Merging all cells yields the output of the adaptive soil shrinkage crack segmentation algorithm based on crack regions.
[0117] S805. When shrinkage cracks are very small, the binarized image of the shrinkage crack may be discontinuous due to the limited shooting resolution. However, based on mechanistic and sensory analysis, it may appear continuous. Therefore, a micro-fracture repair algorithm is designed for this situation. The algorithm takes the red channel output image and the binarized image output by S804 as inputs to repair the fracture in the binarized image output by S804.
[0118] Considering the skeleton diagram represents the crack area but not the crack centerline, the side length of the adaptive window can be appropriately increased. In S8, the side length of the adaptive thresholding window is 6σ. max .
[0119] To ensure that the cracks are segmented based on the original image, after obtaining the crack skeleton map and crack range map, the number of pixels in the soil background (i.e., with a value of 0) in the tensor voting method output image in S6 is counted, and the corresponding pixel in the red channel image output in S1 is assigned a value of 255 based on the background pixel.
[0120] To ensure that the surrounding area of each pixel is thresholded and to avoid "blocking" in the image, this embodiment uses all corresponding pixels in the S802 output image as the center point of the threshold window.
[0121] Considering the large adaptive threshold window, and the fact that a large number of pixels in the adaptive window after S802 processing may have a value of 255, the segmentation effect may be affected if OTSU segmentation is performed directly on the pixels in the window. Therefore, when performing window threshold segmentation, the points with a value of 255 should be filtered out, and the threshold of other points should be solved using OTSU to segment the image.
[0122] After segmenting each threshold window according to the skeleton, all the segmented cells are superimposed, and the pixels with a value greater than 1 are assigned a value of 1, while the other pixels remain unchanged.
[0123] It should be understood that although the steps in the flowcharts of the various embodiments of the present invention are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the various embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0124] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0125] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0126] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
[0127] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A multi-scale adaptive soil drying shrinkage crack identification method, characterized in that, Includes the following steps: S1. Obtain the original RGB color image of the soil shrinkage cracks, preprocess the image, and obtain the preprocessed image; S2. Determine the calculation parameters of the spatial domain standard deviation and the range standard deviation of the bilateral filter based on the full-scale Frangi filter discrimination algorithm; S3. Determine the image type of shrinkage crack based on the full-scale Frangi filter discrimination algorithm, and determine the calculation parameters of Frangi filter, tensor voting method, and adaptive OTSU threshold segmentation algorithm based on crack skeleton; S4. Perform bilateral filtering on the preprocessed image. This process preserves and enhances the details of the drying shrinkage cracks while smoothing the soil background area. S5. Use Frangi filtering to enhance and denoise the bilaterally filtered image. S6. Use the voting tensor method to perform detail restoration and further noise reduction on the Frangi filter-processed image, and output an image of the location range of shrinkage cracks. S7. Use the skeleton algorithm to output a skeleton diagram of the location range of shrinkage cracks; S8. Perform adaptive OTSU threshold segmentation along the skeleton on the preprocessed image to obtain a binarized image of shrinkage cracks, which is the output of S8. In S1, the image preprocessing method is to select the red channel of the RGB image of the shrinkage crack; In S2, the calculation parameters for determining the spatial domain standard deviation and the range standard deviation of the bilateral filter based on the full-scale Frangi filter discrimination algorithm include the following steps: S201. Set the spatial scale factor range and step size of the full-scale Frangi filter discrimination algorithm, and calculate the Gaussian second derivative of the image. S202. Calculate the convolution of the image with the second-order partial derivative of Gaussian to generate the Hessian matrix; S203. Calculate the two eigenvalues of the Hessian matrix and find the filter response of each pixel for different spatial scale factors. S204. Calculate the variance of the filter response values of all pixels corresponding to each spatial scale factor, the variance of the non-zero filter response values, and the average value of the non-zero filter response values, and plot the distribution curve of the calculated output based on the variance of the filter response values of the pixels, the variance of the non-zero filter response values, and the average value of the non-zero filter response values based on the spatial scale factor. S205. Calculate the scale space factor corresponding to the peaks in the three distribution curves. Select the maximum value σmax and the minimum value σmin from the scale factors corresponding to the three peaks, and use them as the calculation parameters for the spatial domain standard deviation and the range standard deviation of the bilateral filter in S4. In S3, the determination of the drying crack image type based on the full-scale Frangi filter discrimination algorithm, and the determination of the calculation parameters for Frangi filter, tensor voting method, and adaptive OTSU threshold segmentation algorithm based on crack skeleton, include the following steps: S301. Based on S2, count the number of 8 connected components and the number of pixels corresponding to the filter response values of all pixels for each inter-scale factor within the range of σmin-σmax. S302. Count the maximum number of connected pixels and the average number of connected pixels in the 8 connected regions of the filter response in S301. S303. Determine the crack image type based on the number of pixels in the largest connected component and the average number of pixels in the connected component. S304. Based on the type of crack image, calculate the parameters in steps S5, S6, S7, and S8 according to σmax, σmin, and the average value of the full-scale Frangi filter response.
2. The multi-scale adaptive soil shrinkage crack identification method according to claim 1, characterized in that, In S4, the bilateral filtering process on the preprocessed image includes the following features: the spatial domain standard deviation, gray-level domain standard deviation, and filter kernel side length are calculated using σmax and σmin as parameters.
3. The multi-scale adaptive soil shrinkage crack identification method according to claim 1, characterized in that, In S5, the Frangi filter enhances and denoises the bilateral filter output image, including the following steps: S501. Based on the crack image type identified in S3, calculate the spatial scale factor range and the filter response threshold, and select an appropriate step size. S502. Calculate the convolution of the image with the second-order partial derivative of Gaussian according to the parameters set in S501, and generate the Hessian matrix. S503. Calculate the two eigenvalues of the Hessian matrix and find the filter response values corresponding to different spatial scale factors. S504. Based on the filtered response value of each pixel within the spatial scale factor range, the maximum value of the filtered response value among all pixels is used as the denominator. The maximum value of the filtered response value among each pixel is calculated and normalized, and used as the input of S505. S505. Compare the normalized filter response of each pixel in the image with the threshold. Assign the filter response of pixels whose filter response is less than the threshold to 0, and keep the filter response of pixels whose filter response is greater than the threshold at its original value, and use it as the filter output.
4. The multi-scale adaptive soil shrinkage crack identification method according to claim 1, characterized in that, In S6, the voting tensor method performs detail restoration and further noise reduction on the Frangi-filtered image, including the following features: the scale parameter in the voting tensor method is obtained from σmax and σmin in S2.
5. The multi-scale adaptive soil shrinkage crack identification method according to claim 1, characterized in that, In S7, the skeleton algorithm is used to output a skeleton map of the location range of shrinkage cracks, including the following steps: S701. Based on the shrinkage crack location range map output by S6, convert the red channel output image of S1 into a binary image, that is, assign the value 1 to the red channel output image within the crack range, and assign the value 0 to the other pixels. S702. Extract the skeleton, eliminate bone spurs and remove isolated points based on the parameters output in S2 and S3, and output the skeleton diagram.
6. The multi-scale adaptive soil shrinkage crack identification method according to claim 1, characterized in that, In S8, the step of performing adaptive OTSU threshold segmentation along the skeleton on the preprocessed image to obtain a binarized image of shrinkage cracks, which is then output as S8, includes the following steps: S801. Determine the window side length of the adaptive threshold method based on σmax output in S2; S802. Count the number of soil background pixels in the output image of the tensor voting method in S6. Based on the position of the soil background pixels, assign the value of 255 to the pixel corresponding to the red channel image output in S1. Use the output image as the input image of S803. S803. Based on the position of each non-zero pixel in the skeleton image, find the corresponding pixel in the output image of S802, construct a cell with the output of S801 as the side length, perform OTSU threshold segmentation on the cell in the output image of S802, and iterate to complete the segmentation of the cell corresponding to all non-zero pixels. S804. Merging the segmented images of all cells yields the output of the adaptive soil shrinkage crack segmentation algorithm based on the crack region. S805 takes the red channel output image and the binarized image output by S804 as inputs and repairs the broken parts of the binarized image output by S804.
Citation Information
Patent Citations
Soil crack feature information extraction method
CN110264459A