Crack length detection method based on matched filtering
Collecting high-definition images through drones and using image filtering and Gaussian function matching filters for crack detection, combined with morphological methods to extract crack skeletons, solves the problems of low efficiency and large noise impact of traditional detection methods, and achieves efficient and safe crack detection. Length detection.
Patent Information
- Application Number
- CN202410716513.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-06-04
Smart Images

Figure CN118587269A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of computer vision, and in particular relates to a crack length detection method based on matched filtering. Background Art
[0002] With the continuous development of science and technology, a large number of transportation infrastructures have been built, such as bridges, roads, tunnels, etc. The role of transportation in people's lives has become increasingly significant, and among all forms of transportation, road transportation is closely related to people's lives and travel. At the same time, it is an urgent problem to do a good job of maintenance during highway operation to ensure that the service life of the road is as long as possible. Cracks are common diseases in roads. Their appearance is often accompanied by the breakdown of the mechanical stability of the original structure. In severe cases, they can even cause collapse in a short period of time, seriously hindering the normal operation of traffic and causing significant economic losses. Therefore, how to conduct timely and effective inspection and maintenance in the early stages of its development to avoid damage to the road structure and the occurrence of traffic accidents is an important topic.
[0003] Traditional crack detection methods are mainly manual, meaning that inspectors use climbing facilities to reach the height of the structure to be inspected, and use detection tools based on different principles to detect, record and analyze cracks. This is inefficient, time-consuming, and extremely dangerous in certain environments. According to whether there is damage to the structure, traditional crack detection technology can be divided into destructive testing and non-destructive testing. The former is to coring at the designated position of the bridge to be inspected, which is somewhat destructive to the structure. The latter uses non-contact detection methods to detect the position to be inspected. Among them, ultrasonic detection, fiber optic sensor detection, and infrared imaging detection are currently commonly used non-destructive detection methods.
[0004] In recent years, with the rapid development of computer technology and the implementation of a large number of artificial intelligence technologies, a large number of crack detection methods based on computer vision have emerged. These methods usually have the advantages of automated operation and fast detection. At the same time, they can greatly reduce the danger during detection and have a high safety factor. However, the complexity of the acquired road surface data and the interference of environmental factors cause the acquired images to be usually full of noise, and the general visual detection method is greatly affected by noise. Although the detection method based on deep learning can avoid the influence of noise, it has factors such as difficulty in training, difficulty in data acquisition, and great influence of the original data set. It has gradually divided into two branches with traditional vision. Therefore, in the field of traditional vision, how to solve the noise problem in detection has not yet been determined. Summary of the invention
[0005] The purpose of the present invention is to provide a crack length detection method based on matched filtering to solve the problems raised in the above background technology.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A crack length detection method based on matched filtering includes an image acquisition module, an image processing module, a crack detection module based on matched filtering, a crack skeleton extraction module, and a crack size measurement module.
[0008] The image acquisition module uses a drone equipped with a high-precision camera to perform high-resolution scanning on the surface of the bridge and road to be detected, and obtains high-definition image data, so that the resolution data of the image meets the requirements of crack detection, and at the same time saves the distance, height, GPS, attitude information, focal length, shooting distance and camera CMOS (sensor) parameters during shooting, and transmits the image taken by the drone to the image processing module in the computer, and the parameter information is saved in the computer for standby;
[0009] The image processing module, based on the high-resolution crack image obtained by the high-definition camera carried by the drone, transmits it to the image and processing module in the computer, first converts the original three-channel RGB (red, green, blue) color image into a grayscale image, and then uses an image filtering algorithm to remove the noise interference existing in the image;
[0010] The crack detection module based on matched filtering designs a convolution kernel by taking a Gaussian function as a matching template, obtains all feature convolution kernels based on the Gaussian function through the convolution kernel, and then uses all convolution kernel templates to detect the processed image to obtain the final crack result image, thereby realizing the segmentation of cracks in the image;
[0011] The crack skeleton extraction module uses morphological methods (dilation, erosion) to refine the segmented crack image to obtain a crack skeleton consisting of only single pixels, which is used to calculate the length of the crack;
[0012] The crack size measurement module calculates the actual length value represented by each pixel according to the parameter information during image acquisition, through the focal length and the distance to the photographed object, and then calculates the actual length value of the crack by accumulation.
[0013] Furthermore, the image acquisition module, through an unmanned aerial device equipped with a camera, adopts a high-precision technology suitable for crack detection to obtain a high-precision crack image to be detected that can meet the detection needs, and at the same time retains the shooting distance, height, GPS, attitude information, focal length, shooting distance and camera CMOS (sensor) parameters corresponding to each image. The main steps include:
[0014] Preliminary preparation: determine the shooting area and target; select and inspect the drone and its related equipment; set flight parameters and make a flight plan; understand and comply with the laws and regulations of the flight area;
[0015] Flight operation: Take off the drone according to the plan; monitor the drone's status and shooting effect in real time during the flight; control the drone to fly according to the scheduled route and adjust the shooting parameters; respond to emergencies during the flight to ensure safety;
[0016] Photography and image processing: Use drones to take photos or videos; transfer the captured data to a computer and save it in a storage device;
[0017] Post-processing: Write a shooting report to summarize the shooting process and results.
[0018] Furthermore, the image processing module, based on the high-resolution crack image obtained by the high-definition camera carried by the drone, transmits it to the image and processing module in the computer, first converts the original three-channel RGB (red, green, blue) color image into a grayscale image, and then uses an image filtering algorithm to remove the noise interference in the image. The main steps include:
[0019] The obtained RBG (red, green, blue) three-channel color image is converted into a grayscale image. The specific formula is as follows:
[0020] p=0.21×r+0.72×g+0.07×b
[0021] Among them, p represents the gray value in the grayscale image, r represents the brightness value of the red channel, g represents the brightness value of the green channel, and b represents the brightness value of the blue channel;
[0022] Afterwards, the obtained grayscale image is denoised by image filtering to effectively smooth the speckle noise and retain the overall grayscale distribution characteristics of the image. The specific mean filtering formula is as follows:
[0023]
[0024] Among them, f(x, y) is the original image containing noise, g(x, y) is the image obtained after mean filtering, s is the set of pixels in the template centered at point (i, j), and the template size is m×n. Furthermore, the crack detection module based on matched filtering generates a feature convolution kernel based on the Gaussian function template selected according to the crack feature, divides the crack direction into 12 directions, rotates the first feature matrix by 15°, and accumulates them in sequence to obtain the convolution kernels in all directions and the designed matching template. Its main steps include:
[0025] Based on the crack characteristics, the Gaussian function is selected as the template function for identifying cracks, as shown below;
[0026]
[0027] Where x and y are the grayscale intensity values; A represents the local background intensity; k is the reflectivity of the object being measured; d is the distance between the point (x, y) and the line segment passing through the center of the object; and σ represents the intensity distribution.
[0028] Select the appropriate length and width through the template function value. Generate the feature values in the convolution kernel of the first row according to the selected length and width values;
[0029] Copy the convolution kernel value of the first row to all rows to form the first convolution kernel;
[0030] Rotate the convolution kernel by a certain angle to obtain the convolution kernel of the angle around the entire circumference, as shown below;
[0031]
[0032] Among them, p i = the position of the point in the i-th θ angle; p = the corresponding point in the horizontal kernel; T = the transpose of the matrix.
[0033] Convolve the image with all convolution kernels in turn to obtain the final convolution result, which is the preliminary crack image screened by the convolution kernel;
[0034] The obtained crack image is subjected to connected domain denoising. This step can eliminate the influence of dark substances such as oil droplets and other spot substances on the final detection results.
[0035] Furthermore, the crack skeleton extraction module is implemented by the corrosion operation in the morphological method, and the crack detection result (black and white binary image of the crack, black is 0, white is 1) is corroded to gradually transform it into a single pixel grid crack skeleton. The main steps include:
[0036] The crack segmentation results are input into the crack skeleton extraction module. The module needs to set the corrosion block of size 7x7 in advance, and then obtain the refined crack skeleton by calling the morphology.skeletoni ze method in the skimage function package;
[0037] Furthermore, the crack size measurement module needs to obtain crack skeleton data, specifically the number of pixels of the crack skeleton. The real data of the crack in reality can be obtained through proportional mapping by recording the shooting distance, height, GPS, posture information, focal length, shooting distance and camera CMOS (sensor) parameter information at the same time during shooting. The specific formula is as follows:
[0038]
[0039] Among them, l is the actual length of the crack, k is the length value represented by each pixel in the camera, p is the number of pixels in the crack skeleton, f is the focal length of the camera, d is the shooting distance, and n is the size of the pixel in the CMOS.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] The present invention obtains digital image data of the area to be detected by an unmanned aerial vehicle, and simultaneously records the shooting distance, height, GPS, attitude information, focal length, shooting distance and camera CMOS (sensor) parameter information corresponding to each image, and saves this information together with the image in a computer storage device. The image is preprocessed by an image and processing module to eliminate speckle noise and make the image smooth. At the same time, the image is converted from the original three-channel color RGB (red, green, blue) image to a grayscale image to reduce the amount of calculation. The matching filter designed by using the Gaussian function as a matching template can well detect and segment the crack image of the corresponding feature, and eliminate the interference of small noise in the non-crack area through the two steps of threshold screening and connected domain denoising to obtain a pure crack image. The crack skeleton extraction module uses a morphological corrosion method to refine the crack image after detection and segmentation into a skeleton with only a single pixel, and calculates the total number of pixels contained in the skeleton. The crack size measurement module uses proportional mapping to calculate the length information of the detected crack in actual reality. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A flow chart of a crack length detection method based on matched filtering provided in Example 1 of the present application;
[0043] Figure 2 The image acquisition module provided in Example 1 of the present application acquires data images;
[0044] Figure 3 This is a flowchart of image acquisition and preprocessing provided in Example 1 of the present application;
[0045] Figure 4 Flowchart for generating a convolution template provided in Example 1 of the present application
[0046] Figure 5 A road surface grayscale image provided in Example 1 of the present application;
[0047] Figure 6 This is a crack detection result diagram provided in Example 1 of the present application;
[0048] Figure 7 This is a skeleton extraction diagram of the crack skeleton extraction module provided in Example 1 of the present application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] Embodiment 1:
[0051] like Figure 1 As shown, a crack length detection method based on matched filtering is implemented by the following technical solutions:
[0052] S1: Through the image acquisition module, a drone equipped with a high-precision camera is used to perform high-resolution scanning on the surface of the bridge and road to be inspected, and high-definition image data is obtained, so that the image resolution data meets the requirements of crack detection. At the same time, the distance, height, GPS, attitude information, focal length, shooting distance and camera CMOS (sensor) parameters are saved, and the images taken by the drone are transmitted to the image processing module in the computer, and the parameter information is saved in the computer for backup.
[0053] Specifically, since the implementation case involves the use of drones to collect data from the area to be inspected, the tasks performed by the drones and equipment must be planned in advance in actual operation. The specific steps are as follows:
[0054] Preliminary preparation: determine the shooting area and target; select and inspect the drone and its related equipment; set flight parameters and make a flight plan; understand and comply with the laws and regulations of the flight area;
[0055] Flight operation: Take off the drone according to the plan; monitor the drone's status and shooting effect in real time during the flight; control the drone to fly according to the scheduled route and adjust the shooting parameters; respond to emergencies during the flight to ensure safety;
[0056] Photography and image processing: Use drones to take photos or videos; transfer the captured data to a computer and save it in a storage device;
[0057] Post-processing: Write a shooting report to summarize the shooting process and results.
[0058] S2: Use the image processing module to perform domain value conversion and noise reduction on the obtained image. The high-resolution crack picture obtained by the high-definition camera carried by the drone is transmitted to the image and processing module in the computer. First, the original three-channel RGB (red, green, and blue) color image is converted into a grayscale image, and then the image filtering algorithm is used to remove the noise interference in the image.
[0059] Specifically, the obtained RBG (red, green, blue) three-channel color image is converted into a grayscale image. The specific formula is as follows:
[0060] p=0.21×r+0.72×g+0.07×b
[0061] Among them, p represents the gray value in the grayscale image, r represents the brightness value of the red channel, g represents the brightness value of the green channel, and b represents the brightness value of the blue channel;
[0062] Afterwards, the obtained grayscale image is denoised by image filtering to effectively smooth the speckle noise and retain the overall grayscale distribution characteristics of the image. The specific mean filtering formula is as follows:
[0063]
[0064] Among them, f(x,y) is the original image containing noise, g(x,y) is the image obtained after mean filtering, s is the set of pixels in the template centered at point (i,j), and the template size is m×n.
[0065] S3: The detection and segmentation of cracks is realized by a crack detection module based on matched filtering. The crack detection module based on matched filtering generates a feature convolution kernel according to a Gaussian function template selected based on crack features. The crack direction is divided into 12 directions, and the first feature matrix is rotated by 15° and accumulated in sequence to obtain convolution kernels in all directions and a designed matching template. The main steps include:
[0066] Specifically, the crack detection module based on matched filtering generates a feature convolution kernel based on a Gaussian function template selected according to crack features, divides the crack direction into 12 directions, rotates the first feature matrix by 15°, and accumulates them in sequence to obtain convolution kernels in all directions and a designed matching template. The main steps include:
[0067] Based on the crack characteristics, the Gaussian function is selected as the template function for identifying cracks, as shown below;
[0068]
[0069] Where x and y are the grayscale intensity values; A represents the local background intensity; k is the reflectivity of the object being measured; d is the distance between the point (x, y) and the line segment passing through the center of the object; and σ represents the intensity distribution.
[0070] Select the appropriate length and width through the template function value. Generate the feature values in the convolution kernel of the first row according to the selected length and width values;
[0071] Copy the convolution kernel value of the first row to all rows to form the first convolution kernel;
[0072] Rotate the convolution kernel by a certain angle to obtain the convolution kernel of the angle around the entire circumference, as shown below;
[0073]
[0074] Among them, p i = the position of the point in the i-th θ angle; p = the corresponding point in the horizontal kernel; T = the transpose of the matrix.
[0075] Convolve the image with all convolution kernels in turn to obtain the final convolution result, which is the preliminary crack image screened by the convolution kernel;
[0076] The obtained crack image is subjected to connected domain denoising. This step can eliminate the influence of dark substances such as oil droplets and other spot substances on the final detection results.
[0077] S4: Through the crack skeleton extraction module, the morphological method (dilation, erosion) is used to corrode and refine the segmented crack image (black and white binary image of the crack, black is 0, white is 1) to obtain a crack skeleton composed of only a single pixel, and the number of pixels in the skeleton is counted.
[0078] Specifically, the crack segmentation results are input into the crack skeleton extraction module, which needs to set the corrosion block of size 7x7 in advance, and then obtain the refined crack skeleton by calling the morphology.skeletoni ze method in the skimage function package;
[0079] S5: Through the crack size measurement module, the distance, height, GPS, attitude information, focal length, shooting distance and camera CMOS (sensor) parameter information recorded at the same time during shooting can be used to obtain the real data of the crack in reality through proportional mapping. The specific formula is as follows:
[0080]
[0081] Among them, l is the actual length of the crack, k is the length value represented by each pixel in the camera, p is the number of pixels in the crack skeleton, f is the focal length of the camera, d is the shooting distance, and n is the size of the pixel in the CMOS.
[0082] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.
[0083] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A crack length detection method based on matched filtering, characterized in that: It includes image acquisition module, image processing module, crack detection module based on matched filtering, crack skeleton extraction module, and crack size measurement module. The image acquisition module uses a drone equipped with a high-precision camera to perform high-resolution scanning on the surface of the bridge and road to be detected, and obtains high-definition image data, so that the resolution data of the image meets the requirements of crack detection, and at the same time saves the distance, height, GPS, attitude information, focal length, shooting distance and camera CMOS (sensor) parameters during shooting, and transmits the image taken by the drone to the image processing module in the computer, and the parameter information is saved in the computer for standby; The image processing module, based on the high-resolution crack image obtained by the high-definition camera carried by the drone, is transmitted to the image and processing module in the computer, first converting the original three-channel RGB (red, green, blue) color image into a grayscale image, and then using an image filtering algorithm to remove noise interference in the image; The crack detection module based on matched filtering designs a convolution kernel by taking a Gaussian function as a matching template, obtains all feature convolution kernels based on the Gaussian function through the convolution kernel, and then uses all convolution kernel templates to detect the processed image to obtain the final crack result image, thereby realizing the segmentation of cracks in the image; The crack skeleton extraction module uses morphological methods (dilation, erosion) to refine the segmented crack image to obtain a crack skeleton consisting of only single pixels, which is used to calculate the length of the crack; The crack size measurement module calculates the actual length value represented by each pixel according to the parameter information during image acquisition, through the focal length and the distance to the photographed object, and then calculates the actual length value of the crack by accumulation.
2. The crack length detection method based on matched filtering according to claim 1 is characterized in that: The data acquisition module of the UAV vision adopts high-precision technology suitable for crack detection, detects surface cracks through digital image processing technology, and then obtains high-precision crack data based on the selected detection technology.
3. A crack length detection method based on matched filtering according to claim 2, characterized in that: The image processing module includes image filtering and denoising, effectively smoothing speckle noise and retaining the overall grayscale distribution characteristics of the image. The specific mean filtering formula is as follows: Among them, f(x,y) is the original image containing noise, g(x,y) is the image obtained after mean filtering, s is the set of pixels in the template centered at point (i,j), and the template size is m×n.
4. The crack length detection method based on matched filtering according to claim 1 is characterized in that: The crack detection module based on matched filtering mainly includes: (1) By performing a convolution extraction operation on the designed matched filter template and the grayscale image, the preliminary convolution result of the old template features is obtained. (2) Set an appropriate screening threshold to filter the results of the preliminary processing, remove the background area, and retain the crack characteristics. (3) Through connected domain denoising, the point noise in the non-crack area is removed to obtain the final crack segmentation image.
5. The crack detection and segmentation method based on matched filtering according to claim 4 is characterized in that: The matching template designed based on the feature is characterized in that the main steps include: (1) Based on the crack characteristics, a Gaussian function is selected as a template function for identifying cracks, as shown below; Where x and y are the grayscale intensity values; A represents the local background intensity; k is the reflectivity of the object being measured; d is the distance between the point (x, y) and the line segment passing through the center of the object; and σ represents the intensity distribution. (2) Select appropriate length and width through the template function value. Generate the feature values in the first row of convolution kernels according to the selected length and width values; (3) Copy the convolution kernel value of the first row to all rows to form the first convolution kernel; (4) Rotate the convolution kernel by a certain angle to obtain the convolution kernel of the angle around the entire circumference, as shown below; Among them, p i = the position of the point in the i-th θ angle; p = the corresponding point in the horizontal kernel; T = the transpose of the matrix. (5) All convolution kernels are used to convolve the image in turn to obtain the final convolution result, which is the preliminary crack image selected according to the convolution kernel. (6) The obtained crack image is subjected to connected domain denoising. This step can eliminate the influence of dark substances such as oil droplets and other spot substances on the final detection results.
6. A crack length detection method based on matched filtering according to claim 5, characterized in that: Perform the specified convolution operation, the main steps include: (1) Perform convolution operations on the original image in sequence according to the convolution template generated by the template function to obtain the crack feature results extracted by convolution in the corresponding direction; (2) Filter out the maximum value of the convolution results in all directions and save the maximum value in the final image; (3) The final image is the preliminary screening image obtained by convolution of the matching template.
7. The crack detection and segmentation method based on matched filtering according to claim 1, characterized in that: The crack skeleton extraction module includes obtaining a skeleton by refining the crack image obtained based on detection and segmentation, and performing an erosion operation on the crack image using a morphological method, thereby obtaining a crack skeleton with only a single pixel while retaining the overall trend of the crack.
8. The crack detection and segmentation method using matched filtering according to claim 1, characterized in that: The crack size measurement module calculates the actual crack length through proportional mapping based on the distance, height, GPS, attitude information, focal length, shooting distance and camera CMOS (sensor) parameter information recorded during image acquisition. The specific details are as follows: Among them, l is the actual length of the crack, k is the length value represented by each pixel in the camera, p is the number of pixels in the crack skeleton, f is the focal length of the camera, d is the shooting distance, and n is the size of the pixel in the CMOS.
Citation Information
Patent Citations
Bridge bottom surface crack detection method based on unmanned aerial vehicle vision
CN109521019A
Bridge crack detection method based on dynamic threshold value
CN113592861A
Image detection method and device, computer, readable storage medium and program product
CN114331951A
Surface crack detection method based on image processing
CN117974627A
Crack length detection system based on computer image processing
CN118037730A
Cited By
Bag placement detection system and method based on machine vision and storage medium
CN119540248A
