A crack image extraction method, device and equipment
Through methods such as Laplace frequency domain controlled non-local mean filtering, homomorphic filtering and dilation operation, the problem of low accuracy in crack extraction of rock and concrete materials is solved, and efficient and accurate crack image extraction is achieved, which adapts to complex environments and reduces noise interference.
Patent Information
- Application Number
- CN202510570536.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-05-06
AI Technical Summary
Existing crack extraction methods in rock and concrete materials have problems such as low extraction accuracy, great influence of interference factors, and poor universality. Especially in complex environments, it is difficult to effectively extract complete crack images.
The method of Laplace frequency domain controlled non-local mean filtering for denoising, homomorphic filtering for contrast enhancement, dilation operation for connecting cracks, area and angle threshold filtering for denoising, and Zhang-Suen thinning algorithm for skeleton extraction is adopted to achieve efficient and accurate extraction of cracks in rock and concrete materials.
It improves the accuracy and completeness of crack extraction in rock and concrete materials, reduces noise interference, enhances the clarity and recognizability of crack images, realizes parameter adaptation and full process automation, and adapts to complex environments.
Smart Images

Figure CN120088257B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of crack detection of engineering structural materials, and in particular to a crack image extraction method, device and equipment. Background Art
[0002] Cracks directly affect the strength and permeability of structural materials, and their interconnection and expansion can potentially cause damage. Currently, methods for identifying cracks in rock and concrete materials fall into three main categories: traditional manual identification, physical detection, and digital image processing. Traditional manual identification methods, such as on-site mapping and coring, rely heavily on the experience and knowledge of professionals. This leads to low efficiency and subjectivity, as well as difficulties in observing exposed rock and concrete surfaces and hazardous measurement environments. Physical detection methods, such as seismic wave detection, electromagnetic methods, and 3D laser scanning, identify cracks by measuring and analyzing the physical properties or field changes of rock and concrete materials. However, these methods suffer from over-reliance on prior information, potential blind spots, and susceptibility to interference from geological conditions and the external environment. Digital image processing methods, including borehole photography, drone aerial photography, and close-range photogrammetry, use high-definition cameras to convert exposed rock and concrete surfaces into high-quality digital images. Computer vision technology and image processing algorithms are then used to extract crack characteristics. These methods offer the advantages of convenient data acquisition, intuitive processes, and low cost.
[0003] While existing fracture extraction methods have improved results to a certain extent, they still haven't completely resolved the challenges. For example, fracture line segment connectivity is suboptimal, pseudo-fractures and noise removal are incomplete, and traditional Canny algorithms and Frangi filters struggle to effectively extract fractures in rock and concrete materials. Summary of the Invention
[0004] The purpose of this application is to provide a crack image extraction method, device and equipment to solve the problem of low accuracy in crack extraction of engineering structure materials.
[0005] To achieve the above objectives, this application provides the following solutions.
[0006] In a first aspect, the present application provides a crack image extraction method, comprising:
[0007] Grayscale processing is performed on the first digital image including crack feature information to determine a digital image after grayscale processing.
[0008] The digital image after the grayscale processing is processed according to non-local mean filtering to obtain a filtered digital image.
[0009] Performing homomorphic filtering processing on the filtered digital image using a homomorphic filtering algorithm to obtain a second digital image.
[0010] A dilation operation is performed on the second digital image to connect discontinuous cracks in the second digital image to determine a continuous second digital image.
[0011] A segmentation operation is performed on the continuous second digital images to remove noise points from the continuous second digital images, and a denoised second digital image is determined.
[0012] A skeleton of the denoised second digital image is extracted, and lines or foreground pixel contours in the skeleton are thinned into a skeleton with a single pixel width.
[0013] The cracks of the single-pixel width skeleton are quantitatively analyzed to extract crack images of engineering structural materials; the engineering structural materials include rock and concrete materials.
[0014] In a second aspect, the present application provides a crack image extraction device, comprising:
[0015] The module for determining the digital image after grayscale processing is used to perform grayscale processing on the first digital image including the crack feature information and determine the digital image after grayscale processing.
[0016] The filtered digital image determination module is used to process the grayscale-processed digital image according to non-local mean filtering to obtain a filtered digital image.
[0017] The second digital image determination module is configured to perform homomorphic filtering on the filtered digital image using a homomorphic filtering algorithm to obtain a second digital image.
[0018] The continuous second digital image determining module is used to perform a dilation operation on the second digital image to connect discontinuous cracks in the second digital image to determine a continuous second digital image.
[0019] The denoised second digital image determination module is configured to perform a segmentation operation on the continuous second digital images, remove noise points from the continuous second digital images, and determine a denoised second digital image.
[0020] The single-pixel width skeleton determination module is used to extract the skeleton of the denoised second digital image and refine the lines or foreground pixel contours in the skeleton into a single-pixel width skeleton.
[0021] The crack image extraction module is used to perform quantitative analysis on the cracks of the single-pixel width skeleton and extract crack images of engineering structural materials; the engineering structural materials include rock and concrete materials.
[0022] In a third aspect, the present application provides a computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any one of the above-described crack image extraction methods.
[0023] According to the specific embodiments provided in this application, this application has the following technical effects:
[0024] The present application provides a crack image extraction method, which comprises preprocessing a first digital image including crack feature information to determine a second digital image; performing a dilation operation on the second digital image to connect discontinuous cracks in the second digital image to determine a continuous second digital image; performing a segmentation operation on the continuous second digital image to remove noise from the continuous second digital image to determine a denoised second digital image, wherein the Laplace frequency domain variance is used to precisely control non-local mean filter parameters to effectively reduce image noise; extracting a skeleton of the denoised second digital image, and refining lines or foreground pixel contours in the skeleton into a single-pixel width skeleton; performing quantitative analysis on the cracks in the single-pixel width skeleton to extract crack images of rock and concrete materials, and connecting the discontinuous cracks in the processed second digital image. This method solves the problems of incomplete crack extraction and noise interference, ensures the integrity and accuracy of crack extraction, and improves the crack extraction accuracy of rock and concrete materials and the efficiency of crack extraction parameters. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 A schematic flow chart of a crack image extraction method provided in one embodiment of the present application.
[0027] Figure 2 A schematic diagram of the working process of the crack image extraction method provided in one embodiment of the present application.
[0028] Figure 3 Different embodiments of the present application provide h Schematic diagram of Canny edge detection results comparison under different values.
[0029] Figure 4 The Laplace frequency domain variance ra provided in an embodiment of the present application is h Schematic diagram of the Gaussian regression fitting curve.
[0030] Figure 5 The Laplace frequency domain variance ra provided in an embodiment of the present application is h Schematic diagram of the Gaussian regression fitting derivative curve.
[0031] Figure 6 This is an intentional homomorphic filtering processing result provided in one embodiment of the present application.
[0032] Figure 7(a) is a schematic diagram of the dilation operation effect.
[0033] Figure 7(b) is a schematic diagram of the filtering operation effect.
[0034] Figure 8 Schematic diagram of the crack skeleton extracted by the Zhang-Suen thinning algorithm provided in one embodiment of the present application.
[0035] Figure 9 A schematic diagram comparing the extraction results of the present application with those of the Canny and Frangi filtering algorithms provided in one embodiment of the present application.
[0036] Figure 10 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0038] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0039] like Figure 2 As shown, the present application discloses a crack image extraction method. The method includes graying the rock and concrete material images, using Laplace frequency domain controlled non-local mean filtering to denoise, and determining the optimal filtering parameters through Gaussian regression. hUtilize homomorphic filtering to enhance crack contrast, and set relevant parameters to optimize processing results; connect discontinuous cracks through dilation operations, using specific structural elements and dilation rates; apply area and angle threshold filtering operations to remove noise; and extract the crack skeleton using the Zhang-Suen refinement algorithm. This application can effectively reduce image noise, improve the distinction between cracks and textures in rock and concrete materials, and accurately extract complete crack outlines in complex environments. Compared with traditional algorithms, it has significant advantages in removing pseudo-cracks, ensuring crack integrity, and adapting to complex environments. It also achieves parameter adaptation and full process automation.
[0040] The purpose of this application is to provide a method and system for automatic extraction of cracks in rock and concrete materials based on Laplace frequency domain image enhancement, so as to solve the problems of poor crack extraction accuracy, great influence of interference factors, and poor universality in existing methods for extracting cracks in rock and concrete materials, and to achieve efficient and accurate extraction of cracks in rock and concrete materials.
[0041] like Figure 1 As shown, an embodiment of the present application provides a crack image extraction method, which specifically includes the following steps.
[0042] S1: grayscale processing is performed on a first digital image including crack feature information to determine a digital image after grayscale processing.
[0043] S2: Processing the grayscaled digital image according to non-local mean filtering to obtain a filtered digital image.
[0044] S3: Performing homomorphic filtering processing on the filtered digital image using a homomorphic filtering algorithm to obtain a second digital image.
[0045] S4: performing a dilation operation on the second digital image to connect discontinuous cracks in the second digital image to determine a continuous second digital image.
[0046] S5: performing a segmentation operation on the continuous second digital images to remove noise points from the continuous second digital images and determine a denoised second digital image.
[0047] S6: extracting a skeleton of the denoised second digital image, and thinning the lines or foreground pixel contours in the skeleton into a skeleton with a single pixel width.
[0048] S7: Quantitatively analyzing the cracks of the single-pixel width skeleton to extract crack images of engineering structural materials; the engineering structural materials include rock and concrete materials.
[0049] Furthermore, in an exemplary embodiment, S1 specifically includes:
[0050] The first digital image is converted into a first digital image containing only grayscale information to obtain a grayscale-processed digital image.
[0051] A high-definition camera is used to convert the exposed surfaces of rock and concrete materials or the pore walls of rock and concrete materials into high-quality digital images. Computer vision technology and image processing algorithms are then used to extract fracture characteristics. The captured rock and concrete images are then grayscaled to eliminate color interference with subsequent algorithm processing. In real-world rock and concrete images, color information can mask the grayscale differences between fractures and the surrounding rock and concrete, hindering fracture identification and extraction. Grayscaling converts the images into images containing only grayscale information, simplifying subsequent processing.
[0052] Select image acquisition equipment suitable for detecting cracks in rock and concrete materials. This includes, but is not limited to, high-resolution borehole cameras, drones equipped with HD cameras, and high-precision close-range photogrammetry devices. Capture images of exposed rock and concrete surfaces or borehole walls. Before acquisition, thoroughly assess the actual condition of the rock and concrete materials. Flexible and precise adjustments to equipment parameters are required based on factors such as location, size, and lighting conditions.
[0053] If the acquisition environment is an underground rock or concrete area with low light, the built-in sensitivity adjustment function of the device can be used to reasonably increase the camera sensitivity, while optimizing parameters such as exposure time and aperture size to balance image brightness and noise control, ensuring that the captured image is clear and discernible. For large-scale exposed surfaces of rock and concrete materials, drones equipped with high-definition cameras are preferred for image acquisition. Based on the scope and topography of the exposed surfaces of rock and concrete materials, combined with the flight performance and shooting capabilities of the drone, the appropriate flight altitude and shooting angle are planned to ensure that the acquired images can not only fully cover the target detection area, but also clearly present the subtle features of the cracks in the rock and concrete materials, including the width, direction, texture, etc. of the cracks.
[0054] For high-precision close-range photogrammetry devices, when dealing with complex rock and concrete materials, the system uses multi-angle shooting and image stitching technology to acquire complete and high-precision image data of rock and concrete materials by adjusting the device's focal length, shooting distance, and angle. During the image acquisition process, the system automatically records metadata such as acquisition time, location, and equipment parameters, providing auxiliary information for subsequent image analysis and processing.
[0055] The collected image data will be stored in common and versatile formats such as JPEG and PNG. These formats have good compatibility, facilitating efficient processing using various image processing software and algorithms, reducing data conversion costs and improving work efficiency.
[0056] The collected colored rock and concrete material images are input into the grayscale processing module. The weighted average method is used for grayscale processing, and the formula is: ,in 、 、 are the red, green, and blue component values of each pixel in the color image, is the converted grayscale value. By traversing each pixel in the image, the original color value is calculated and replaced according to the above formula, thereby converting the color image into a grayscale image. Grayscale conversion reduces the amount of information in the image and the complexity of subsequent processing. It also eliminates the interference of color on crack extraction and highlights the grayscale difference characteristics.
[0057] Further, in an exemplary embodiment, S2 may be replaced by the following steps.
[0058] S201: Controlling non-local mean filter parameters according to the Laplace frequency domain variance.
[0059] S202: Calculate the relationship between the Laplace frequency domain variance and the non-local means filter parameters according to the Gaussian regression algorithm to determine the optimal non-local means filter parameters.
[0060] S203: Determine a filtered digital image according to the optimal non-local means filtering parameters.
[0061] Laplace frequency domain controlled non-local mean filtering denoising: Non-local mean filtering (NLM) is used to process the grayscale image to enhance the crack image and preserve the crack edge to the greatest extent. The non-local mean filtering includes similarity block size, search window size, similarity threshold and filter coefficient. h Among them, the filter coefficient h It is a key parameter, and different values of it will cause large differences in the processed image. In order to determine the best filtering parameters h , the filter parameters of the non-local mean are controlled by the Laplace operator h .
[0062] Further, in an exemplary embodiment, S3 may be replaced by the following steps.
[0063] S301: As the non-local means filter parameter increases, the Laplace frequency domain variance decreases.
[0064] S302: When dra / d h When the minimum value is reached and approaches 0, the optimal non-local filtering parameter is determined; where ra is the Laplace frequency domain variance; h is the non-local filtering parameter; dra / d h For ra h The derivative of .
[0065] Initialize the non-local mean filter parameters, set the similarity block size to 7, and the search window size to 21. These two parameters determine the range of neighborhood blocks involved in the filtering process. Similar blocks are searched within this range to calculate the filter value of the current pixel to achieve the purpose of denoising.
[0066] The Laplace frequency domain variance ra of the image is calculated according to the Laplace operator formula. In discrete form, the Laplace operator formula is:
[0067] .
[0068] in, For the image After calculating the Laplace transform of the entire image, the variance formula Calculate the Laplace frequency domain variance , is the variance calculation function, is the Laplace transform function, The image currently being processed.
[0069] like Figure 3 As shown, using different filter coefficients h Perform non-local mean filtering and then perform Canny edge extraction on the filtered result for verification h Optimal value. Calculated using Gaussian regression algorithm and filter coefficients The relationship between By drawing and The relationship curve is as follows Figure 4 As shown, and its derivative curve ,like Figure 5 As shown, observe the changes in the derivative curve. After reaching the minimum value and approaching 0, the corresponding The value is the optimal filtering parameter. Figure 2 When the rock and concrete material images are taken, after multiple calculations and analyses, it is determined When the noise is effectively removed, the crack edge information can be well preserved. The sum of the variances after Laplace transformation of the entire image is recorded as Laplace frequency domain variance ra, and the Gaussian regression algorithm is used to calculate ra andh The relationship between the two, to obtain the best denoising effect h In this process, as h The value increases, the ra value gradually decreases, when dra / d h After reaching the minimum value and approaching 0, the corresponding h The crack enhancement effect is best when the value is set. The advantage of this is that the filtering parameters can be automatically and accurately determined, which improves the stability and adaptability of the algorithm and reduces the workload of manual parameter adjustment.
[0070] Based on the determined optimal value, the grayscale image is filtered using non-local means filtering. During the filtering process, the filter value for each pixel is calculated based on the similarity between similar blocks. This similarity is calculated based on the similarity between pixel values and neighborhood structure. This method maximizes the preservation of crack edges and details while removing noise, improving image quality and providing a clearer image foundation for subsequent crack extraction.
[0071] Further, in an exemplary embodiment, S4 may be replaced by the following steps.
[0072] S401: Utilize formula Get the original image; where x is the horizontal coordinate of the pixel in the image, and y is the vertical coordinate of the pixel in the image. is the original image; is the illumination component; is the reflectivity component.
[0073] After filtering and denoising, the image enters the homomorphic filtering module. In this module, according to the principle of the homomorphic filtering algorithm, the relevant parameters are set. Low frequency gain rl=0.9, high frequency gain rh=2.5, cutoff frequency , sharpness control parameter c=4, high frequency adjustment factor hf=2, low frequency adjustment factor l =0.5. According to the calculation steps of homomorphic filtering, first transform the image Expressed as illumination component and reflectivity components The product of .
[0074] S402: Using formula Get the logarithmic domain image function; where, is the logarithmic domain image function.
[0075] Taking the logarithm of it gives , and then perform Fourier transform to convert to frequency domain .
[0076] S403: Perform Fourier transform on the logarithmic domain image function to convert it into the frequency domain to obtain ; is the frequency domain image function.
[0077] S404: Based on , using the formula Determine the frequency domain filter; where, is the frequency domain filter; rh is the high frequency gain; rl is the low frequency gain; The center point of the frequency domain The distance to the origin, , M is the horizontal size of the second digital image; N is the vertical size of the second digital image; u is the horizontal coordinate of the center point of the frequency domain; v is the vertical coordinate of the center point of the frequency domain; D0 is the origin.
[0078] S405: Utilize formula Get the filtered frequency domain result; among them, is the frequency domain result after filtering.
[0079] S406: Using formula Get the adjusted frequency domain result; among them, is the frequency domain result after adjustment; hf is the high frequency adjustment factor; l is the low frequency adjustment factor.
[0080] S407: Yes Perform inverse Fourier transform to obtain the spatial domain image .
[0081] S408: Using formula , the frequency domain results after adjustment Perform inverse Fourier transform and exponential transform to obtain a second digital image; wherein, is the second digital image.
[0082] After homomorphic filtering, the contrast of the cracks is significantly enhanced and the background noise is effectively suppressed. The filter processes the low-frequency and high-frequency parts to different degrees according to the set parameters to enhance the image contrast and suppress the background noise. It further optimizes the filtered frequency domain image, enhances the detail information of the high-frequency part, reduces the background influence of the low-frequency part, and makes the crack features of the image more obvious. Figure 6 As shown in the figure, the contrast of the cracks is significantly enhanced, the background noise is effectively suppressed, and the clarity and recognizability of the image are greatly improved, providing better image conditions for the subsequent accurate extraction of cracks.
[0083] Further, in an exemplary embodiment, S5 may be replaced by the following steps.
[0084] S501: When the second digital image is the binary image, foreground pixels are expanded toward outer pixels with the foreground pixels as the center according to the dilation algorithm to determine a continuous second digital image.
[0085] S502: When the second digital image is the grayscale image, each pixel value is replaced with the maximum grayscale value in the neighborhood of the grayscale image according to the dilation algorithm to determine a continuous second digital image.
[0086] After homomorphic filtering, although the main crack image is segmented, many discontinuous locations remain. To address this issue, a dilation operation is performed on the image to connect the discontinuous cracks and further enhance their continuity. Dilation is performed on binary or grayscale images. For binary images, dilation is the process of expanding foreground pixels toward the surrounding background pixels; for grayscale images, dilation is the process of replacing the value of each pixel with the maximum grayscale value within its neighborhood. The homomorphic filtered image is then binarized. An optimal threshold for the image is calculated using a suitable binarization method, such as the Otsu thresholding method. The binarization algorithm employed in this application is a global fixed threshold binarization algorithm. Based on this threshold, pixels in the image with grayscale values greater than the threshold are set as foreground pixels (value 1), and pixels with grayscale values less than the threshold are set as background pixels (value 0), thereby converting the grayscale image into a binary image. In this method, the homomorphic filtered image is binarized and then dilated using a 7×7 elliptical structuring element and a dilation ratio of 5 to form a complete crack. During dilation, for binary images, foreground pixels expand toward the surrounding background pixels. Specifically, the center of the structuring element is used to traverse each pixel in the image. If the center pixel is a foreground pixel (value 1), all background pixels (value 0) within the structuring element's coverage area are converted to foreground pixels. Through dilation, previously discontinuous cracks are connected, enhancing their continuity and facilitating subsequent analysis and processing of the crack's overall morphology. The final processing result is shown in Figure 7(a).
[0087] The dilation operation can effectively fill the discontinuities in the cracks, making the crack outline more complete and facilitating subsequent analysis and processing.
[0088] Further, in an exemplary embodiment, S6 may be replaced by the following steps.
[0089] S601: The noise points include a first noise point and a second noise point.
[0090] S602: Filter the continuous second digital images to determine a filtered digital image; an area threshold of the filtered digital image is less than 1 times the average area threshold.
[0091] S603: removing first noise points in the filtered digital image according to an area threshold method, and removing second noise points in the filtered digital image according to an angle threshold method, to obtain a denoised second digital image.
[0092] After the dilation operation, a certain amount of noise appears in the crack images of rock and concrete materials. These noise points are non-crack elements. To remove these noise points, a threshold segmentation operation is performed using both area and angle thresholds. Cracks in rock and concrete materials have a certain area range, while noise points and some minor non-crack interference areas are relatively small. Calculations show that foreground areas with area thresholds less than 1 times the average area threshold are generally noise points. For a small number of noise points that cannot be removed using the area threshold, the angle threshold method is considered. The angle threshold method assumes that cracks are generally narrow and long, and the aspect ratio of the rectangle formed by the diagonal lines of the crack endpoints is generally large. Points with an aspect ratio less than the average threshold (close to a square) are generally noise points or pseudo-cracks. These points are then identified as noise points or pseudo-cracks, and their pixel values are similarly changed from 1 to 0. This dual filtering operation of area and angle thresholds effectively removes the noise points and pseudo-cracks in the image after the dilation operation, resulting in a clear and accurate crack image, as shown in Figure 7(b), improving the accuracy of crack extraction.
[0093] Through this double-threshold filtering operation, a clear and accurate crack image can be finally obtained, which effectively improves the accuracy of crack extraction.
[0094] Further, in an exemplary embodiment, S7 may be replaced by the following steps.
[0095] S701: If the value of a pixel in the denoised second digital image is 1, and the number of pixel values 1 in the neighborhood of the pixel is between 2 and 6, then the pixel is a pixel that may be deleted; the neighborhood is 8 pixels above, below, left, right, and diagonally of the pixel.
[0096] S702: If the pixels that may be deleted are continuous, mark the pixels that may be deleted as deletable pixels; starting from a pixel with a value of 1, in a clockwise or counterclockwise direction, if the values of the pixels adjacent to the pixel are also 1, then the pixels that may be deleted are continuous.
[0097] S703: Setting the pixel value of the deletable pixel from 1 to 0, deleting the deletable pixel until no new pixel in the second digital image is marked as a deletable pixel, and the lines in the denoised second digital image are refined into a single-pixel width skeleton, and extracting the crack image of the engineering structure material.
[0098] Step 1: Mark the pixels to be deleted.
[0099] For each pixel in the denoised second digital image, if its value is 1 and the number of pixels with a value of 1 in its eight neighborhoods (i.e., the eight surrounding pixels above, below, left, right, and diagonally) is between 2 and 6, then this pixel is preliminarily marked as a pixel that may be deleted. The arrangement of the pixels with a value of 1 in the eight neighborhoods of this pixel is checked. If these pixels with a value of 1 are continuous (i.e., starting from a pixel with a value of 1, the adjacent pixels in a clockwise or counterclockwise direction also have a value of 1 without interruption), then the pixel is not marked as a deletable pixel. This is to avoid deleting the edge of the line and ensure the continuity of the line.
[0100] Step 2: Delete the marked pixels.
[0101] After the first round of marking, all pixels marked as deletable are set from 1 to 0, that is, these pixels are deleted. This makes the lines thinner without destroying the overall structure of the image.
[0102] Repeat the above process.
[0103] Repeat the first and second steps until no new pixels in the denoised second digital image are marked as deletable. At this point, the lines in the denoised second digital image have been thinned to a single pixel width, achieving the desired effect of the algorithm.
[0104] Skeleton extraction is to make the crack image of rock and concrete materials form a single-pixel curve image, which is convenient for crack quantification. When the research focus is on the number, length and direction of cracks, the single-pixel curve image is more conducive to identification. This method uses the Zhang-Suen thinning algorithm to extract the skeleton of the crack image, and thins the lines or foreground pixel contours in the binary image into a skeleton with a single pixel width. During the thinning process, the topological structure and key features of the image are kept unchanged as much as possible, and finally a single-pixel crack skeleton image is obtained, such as Figure 8As shown. This skeleton image facilitates quantitative analysis of the number, length, and orientation of cracks, providing an important data foundation for the study and engineering application of cracks in rock and concrete materials. The algorithm cyclically scans pixels in the image and determines whether to delete the pixel based on the status of its neighboring pixels. The algorithm counts the number of pixels whose neighbors are foreground (value 1) and records pixels whose number is not between 2 and 6 (this condition ensures that the current pixel is not an endpoint, isolated point, or internal point, but a boundary point). The pixel's neighbors are connected sequentially to form a path. If the number of pixel value transitions from 1 to 0 in the path is 1 (indicating that one side of the pixel is foreground and the other side is background), deleting the pixel will not destroy the connectivity of the image. Pixels that meet these two conditions are deleted, and the lines in the image are gradually refined to a single pixel width, preserving the image's topological structure and key features as much as possible. After processing with the Zhang-Suen thinning algorithm, the Y-shaped trunk of the extracted crack images of rock and concrete materials is well maintained, with fewer noise points and pseudo-cracks. The crack extraction effect is relatively ideal, which facilitates the subsequent crack quantitative analysis.
[0105] In order to verify the effectiveness and superiority of the crack image extraction method of this application, the crack images of rock and concrete materials were extracted by using the method of this application and the classic Canny edge detection and Frangi filtering methods, respectively. Figure 9 To ensure consistency, all images were pre-processed and enhanced, and the calculation parameters of the Canny and Frangi filtering algorithms were manually selected as optimal values.
[0106] Both Canny edge detection and Frangi filtering can extract cracks in rock and concrete materials. However, cracks processed by Canny edge detection contain more image noise that is difficult to segment, and are inferior to the crack integrity method of the present application. The cracks processed by Frangi filtering lack a clear boundary between the cracks and the background color, resulting in a non-binary image. Furthermore, the cracks contain some texture, which is not conducive to subsequent quantitative analysis of the cracks.
[0107] like Figure 9 As shown, in picture sample 3, due to the presence of plant occlusion and sun shadows, the Canny and Frangi filtering algorithms are difficult to achieve effective crack extraction, and the algorithm fails. In picture sample 6, the Canny and Frangi filtering algorithms extract a large number of pseudo cracks, and the accuracy of crack extraction is poor. In picture samples 2 and 4, there is an obvious lack of connectivity in the cracks extracted by the Canny and Frangi filtering algorithms, and the processing effect of crack continuity is poor. The present application can not only remove pseudo cracks and background noise, effectively purify image information, but also solve the complex situation of uneven image contrast, realize efficient capture and extraction of crack information, and obtain complete cracks.
[0108] This application uses the Laplace frequency domain to precisely control the filter parameter h of the non-local mean, effectively reducing image noise and improving the distinction between cracks and textures. At the same time, homomorphic filtering further enhances the crack contrast and suppresses background noise. The combination of dilation and filtering operations solves the problems of incomplete crack extraction and noise interference, ensuring the integrity and accuracy of crack extraction. Compared with traditional Canny edge detection and Frangi filtering algorithms, the crack images extracted by this application perform better in removing pseudo-cracks and ensuring crack integrity. For complex environments such as plant occlusion, shadows generated by the uneven surface of rock and concrete materials, and sun shadows, the method of this application can accurately extract the complete crack outline, has strong environmental adaptability, and overcomes the problem of reduced extraction accuracy of existing algorithms in complex environments. This application fully integrates the two stages of image enhancement and crack extraction, realizes the self-adaptation of crack extraction parameters and full process automation, reduces manual intervention, improves work efficiency, and reduces labor costs.
[0109] An embodiment of the present application provides a crack image extraction device, and the specific modules are described as follows.
[0110] The module for determining the digital image after grayscale processing is used to perform grayscale processing on the first digital image including the crack feature information and determine the digital image after grayscale processing.
[0111] The filtered digital image determination module is used to process the grayscale-processed digital image according to non-local mean filtering to obtain a filtered digital image.
[0112] The second digital image determination module is configured to perform homomorphic filtering on the filtered digital image using a homomorphic filtering algorithm to obtain a second digital image.
[0113] The continuous second digital image determining module is used to perform a dilation operation on the second digital image to connect discontinuous cracks in the second digital image to determine a continuous second digital image.
[0114] The denoised second digital image determination module is configured to perform a segmentation operation on the continuous second digital images, remove noise points from the continuous second digital images, and determine a denoised second digital image.
[0115] The single-pixel width skeleton determination module is used to extract the skeleton of the denoised second digital image and refine the lines or foreground pixel contours in the skeleton into a single-pixel width skeleton.
[0116] The crack image extraction module is used to perform quantitative analysis on the cracks of the single-pixel width skeleton and extract the crack image of the engineering structure material.
[0117] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used for crack image extraction. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a video tag processing method is implemented.
[0118] Those skilled in the art will understand that Figure 10 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application and does not constitute a limitation on the computer device to which the solution of the present application is applied. A specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the above-mentioned method embodiments when executing the computer program.
[0119] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, 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.
[0120] This application uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core concept of this application. At the same time, for those skilled in the art, based on the concept of this application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A crack image extraction method, characterized in that: The crack image extraction method comprises: Performing grayscale processing on the first digital image including the crack feature information to determine a digital image after the grayscale processing; Processing the grayscaled digital image according to non-local mean filtering to obtain a filtered digital image; performing homomorphic filtering on the filtered digital image using a homomorphic filtering algorithm to obtain a second digital image; performing a dilation operation on the second digital image to connect discontinuous cracks in the second digital image to determine a continuous second digital image; performing a segmentation operation on the continuous second digital images to remove noise points from the continuous second digital images and determine a denoised second digital image; Extracting a skeleton of the denoised second digital image, and thinning the lines or foreground pixel contours in the skeleton into a single-pixel width skeleton; Quantitatively analyzing the cracks of the single-pixel width skeleton to extract crack images of engineering structural materials; the engineering structural materials include rock and concrete materials; Processing the grayscaled digital image according to non-local mean filtering to obtain a filtered digital image specifically includes: Control the non-local mean filter parameters according to the Laplace frequency domain variance; Calculating the relationship between the Laplace frequency domain variance and the non-local mean filter parameters according to the Gaussian regression algorithm to determine the optimal non-local mean filter parameters; determining a filtered digital image according to optimal non-local means filtering parameters; Performing a segmentation operation on the continuous second digital images to remove noise points from the continuous second digital images and determining a denoised second digital image specifically includes: The noise points include a first noise point and a second noise point; screening the continuous second digital images to determine a screened digital image; wherein an area threshold of the screened digital image is less than 1 times an average area threshold; The first noise points in the filtered digital image are removed according to an area threshold method, and the second noise points in the filtered digital image are removed according to an angle threshold method, so as to obtain a denoised second digital image.
2. The crack image extraction method according to claim 1, characterized in that: Gray-scaling the first digital image including the crack feature information to determine the digital image after the gray-scaling process specifically includes: The first digital image is converted into a first digital image containing only grayscale information to obtain a grayscale-processed digital image.
3. The crack image extraction method according to claim 1, characterized in that: Calculating the relationship between the Laplace frequency domain variance and the non-local means filter parameters according to the Gaussian regression algorithm to determine the optimal non-local means filter parameters specifically includes: As the non-local mean filter parameter increases, the Laplace frequency domain variance decreases; when dra / dh When it reaches the minimum value and approaches 0, the optimal non-local filtering parameters are determined; ra is the Laplace frequency domain variance; h is the non-local filtering parameter; dra / dh For ra h The derivative of .
4. The crack image extraction method according to claim 1, characterized in that: Performing homomorphic filtering on the filtered digital image using a homomorphic filtering algorithm to obtain a second digital image specifically includes: Using the formula Get the original image; where, x is the horizontal coordinate of the pixel in the image, y is the vertical coordinate of the pixel in the image, is the original image; is the illumination component; is the reflectivity component; Using the formula Get the logarithmic domain image function; where, is the logarithmic domain image function; The logarithmic domain image function is Fourier transformed and converted to the frequency domain to obtain ; is the frequency domain image function; based on , using the formula Determine the frequency domain filter; where, is a frequency domain filter; rh is the high frequency gain; rl is the low frequency gain; The center point of the frequency domain The distance to the origin, , M is the horizontal size of the second digital image; N is the size of the second digital image in the vertical direction; u is the horizontal coordinate of the center point of the frequency domain; v is the vertical coordinate of the center point of the frequency domain; D 0 is the origin; Using the formula Get the filtered frequency domain result; among them, is the frequency domain result after filtering; Using the formula Get the adjusted frequency domain result; among them, is the frequency domain result after adjustment; hf is the high frequency adjustment factor; l is the low frequency adjustment factor; right Perform inverse Fourier transform to obtain the spatial domain image ; Using the formula , the frequency domain results after adjustment Perform inverse Fourier transform and exponential transform to obtain a second digital image; wherein, is the second digital image.
5. The crack image extraction method according to claim 1, characterized in that: Performing a dilation operation on the second digital image to connect discontinuous cracks in the second digital image to determine a continuous second digital image, specifically comprising: the second digital image is a binary image or a grayscale image; When the second digital image is the binary image, foreground pixels are expanded toward outer pixels with the foreground pixels as the center according to a dilation algorithm to determine a continuous second digital image; When the second digital image is the grayscale image, each pixel value is replaced with the maximum grayscale value in the neighborhood of the grayscale image according to the dilation algorithm to determine a continuous second digital image.
6. The crack image extraction method according to claim 1, characterized in that: Extracting a skeleton of the denoised second digital image and thinning the lines or foreground pixel outlines in the skeleton into a single-pixel width skeleton specifically includes: If the value of a pixel in the denoised second digital image is 1, and the number of pixel values 1 in the neighborhood of the pixel is between 2 and 6, then the pixel is a pixel that may be deleted; the neighborhood is the 8 pixels above, below, left, right, and diagonally of the pixel; If the pixels that may be deleted are continuous, then mark the pixels that may be deleted as deletable pixels; starting from a pixel with a value of 1, in a clockwise or counterclockwise direction, if the values of the pixels adjacent to the pixel are also 1, then the pixels that may be deleted are continuous; The pixel value of the deletable pixel is set from 1 to 0, and the deletable pixel is deleted until no new pixel is marked as a deletable pixel in the second digital image. The lines in the denoised second digital image are then refined into a single-pixel width skeleton, and the crack image of the engineering structure material is extracted.
7. A crack image extraction device, the crack image extraction device being used to implement the crack image extraction method according to claim 1, characterized in that: The crack image extraction device comprises: A module for determining a digital image after grayscale processing, configured to perform grayscale processing on the first digital image including crack feature information and determine a digital image after grayscale processing; a filtered digital image determination module, configured to process the grayscaled digital image according to non-local means filtering to obtain a filtered digital image; a second digital image determination module, configured to perform homomorphic filtering on the filtered digital image using a homomorphic filtering algorithm to obtain a second digital image; a continuous second digital image determining module, configured to perform a dilation operation on the second digital image to connect discontinuous cracks in the second digital image to determine a continuous second digital image; a denoised second digital image determination module, configured to perform a segmentation operation on the continuous second digital images, remove noise points from the continuous second digital images, and determine a denoised second digital image; a single-pixel-width skeleton determination module, configured to extract a skeleton of the denoised second digital image and refine lines or foreground pixel outlines in the skeleton into a single-pixel-width skeleton; The crack image extraction module is used to perform quantitative analysis on the cracks of the single-pixel width skeleton and extract the crack image of the engineering structure material.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the crack image extraction method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Color brightness recognition method, device, equipment and medium
CN112712568A
Surface crack detection method based on image processing
CN117974627A