A method for detecting cracks in dam bodies of hydraulic engineering projects
Through technical means such as median filtering, maximum inter-class variance method and noise connectivity calculation, the problem of inaccurate identification of dam cracks in traditional detection methods is solved, and more accurate crack detection is achieved.
Patent Information
- Application Number
- CN202411245642.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2044-09-06
AI Technical Summary
Traditional dam crack detection methods are difficult to effectively identify noise in the connecting area, resulting in inaccurate identification of crack edges.
The crack image of the dam body was denoised by median filtering technology, and the crack profile area was obtained by the maximum inter-class variance method, and the noise connection degree and noise fit degree were calculated, and the crack image was enhanced, and finally the edge detection operator was extracted and detected. result.
It effectively avoids the interference of noise points in the connecting domain and burrs on the edge of the crack on detection, and improves the accuracy and clarity of crack detection.
Smart Images

Figure CN118762017B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image processing, and in particular to a method for detecting cracks in a dam body of a water conservancy project. Background Art
[0002] With the development of the global economy, people pay more and more attention to the use of water resources, and water conservancy projects have played a huge role in many areas of my country. According to statistics, concrete dams have more or less problems such as cracks, corrosion, collapse, and dam tilt. Among them, cracks are the most common and important problem. These cracks will cause great harm to the durability and integrity of the dam body, and long-term use will also lead to dam collapse accidents.
[0003] Traditional dam crack detection is based on the threshold segmentation method to identify the crack edge, but dam crack detection based on this method cannot identify the noise in the connected area well. Summary of the invention
[0004] In order to solve the above technical problems, an embodiment of the present invention provides a method for detecting cracks in a dam body of a water conservancy project. The cracks in the dam body are detected by image processing technology, which can better avoid the interference of noise points in the connected domain and burrs on the edges of the cracks on crack detection.
[0005] An embodiment of the present invention provides a method for detecting cracks in a dam body of a water conservancy project, comprising:
[0006] The crack images of concrete dams of water conservancy projects collected were de-noised by using median filtering technology;
[0007] Obtaining the crack contour area of the crack image after denoising by using the maximum inter-class variance method;
[0008] Calculate the noise connectivity of the skeleton region Noise crack fit , enhancing the crack contour area of the crack image; wherein the Indicates The pixel point at the position determines whether the connected crack edge is a noise area. Indicates The noise crack fit of the pixel at the position;
[0009] The enhanced crack image is extracted by an edge detection operator to obtain a crack detection result.
[0010] In one embodiment of the present invention, the denoising process of the collected crack image of the concrete dam of the water conservancy project by using the median filtering technology includes:
[0011] Use CCD camera to collect color RGB crack images of concrete dam of water conservancy project;
[0012] Converting the color RGB crack image into a grayscale image to obtain a crack image of the concrete dam of the water conservancy project;
[0013] The crack image is denoised by using a median filtering technique.
[0014] In one embodiment of the present invention, the method of obtaining the crack contour area of the crack image after denoising by using the maximum between-class variance method (OTSU) includes:
[0015] Determine the optimal threshold of the crack image after denoising by using the maximum inter-class variance method (OTSU);
[0016] The crack image after denoising is binarized according to the optimal threshold value to obtain a crack contour area of the crack image after denoising.
[0017] In one embodiment of the present invention, binarizing the crack image after denoising according to the optimal threshold to obtain the crack contour area of the crack image after denoising includes:
[0018] Binarizing the crack image after denoising according to the optimal threshold;
[0019] Performing expansion processing on the binary crack image so that the crack contour area is thickened;
[0020] Obtaining corresponding horizontal projection curves and vertical projection curves from the horizontal and vertical directions of the crack image after expansion processing by a grayscale projection method;
[0021] The crack contour area is obtained according to the grayscale values of the horizontal projection curve and the vertical projection curve at the crack after expansion.
[0022] In one embodiment of the present invention, the calculation of the noise connectivity of the skeleton region ,include:
[0023] For each pixel point in the foreground area of the binary image of the crack contour area, the minimum Euclidean distance with the pixel point in the background area is obtained as the distance transformation grayscale value. ;
[0024] The image after distance change is thinned to obtain the skeleton of the connected area, where the set of skeleton pixels is represented by express;
[0025] For each pixel on the skeleton, a ray is emitted in eight directions ,in, From 1 to The value corresponds to eight rays in the clockwise direction starting from 0 degrees;
[0026] According to the ray, calculate the degree of noise connectivity in the skeleton area .
[0027] In one embodiment of the present invention, the degree of noise connectivity of the skeleton region is calculated based on the ray. ,include:
[0028] Every time a ray extends outward through a pixel, the skeleton point ray extension frequency of the connected area of the airspace where the pixel is located is Add one until the gray value of the distance is reached The pixel is 0;
[0029] Get the skeleton point ray extension frequency , used to represent the frequency of each skeleton point in the connected area being passed by the ray;
[0030] The frequency of rays extending from the skeleton point Get the noise connectivity of the skeleton area .
[0031] In one embodiment of the present invention, the frequency of the rays extending from the skeleton point Get the noise connectivity of the skeleton area ,include:
[0032] The frequency of ray extension from the skeleton point is given by the following formula: Get the noise connectivity of the skeleton area :
[0033] ;
[0034] in, and In the crack image, OK Column pixels, The average value of the ray extension frequency of the connected area is represented.
[0035] In one embodiment of the present invention, the calculation of noise crack fit ,include:
[0036] The formula for calculating each pixel is as follows: :
[0037] ;
[0038] in, represents the number of edge direction lines, represents the gradient amplitude of the crack region, represents the average value of the gradient amplitude of each crack area, express The number of
[0039] In one embodiment of the present invention, the step of enhancing the crack contour area of the crack image includes:
[0040] Use the Gaussian surround function to filter each channel to obtain the illumination component ;
[0041] For the original image and lighting component Take the logarithm and then subtract;
[0042] Calculating the maximum and minimum values of the values obtained after the subtraction;
[0043] Linearly quantize each of the maximum value and the minimum value;
[0044] Perform exponential transformation on the linearly quantized value, and output the reflection component as the enhanced crack contour area.
[0045] In one embodiment of the present invention, the step of enhancing the crack contour area of the crack image includes:
[0046] Determine the original ;in, is the standard deviation of the Gaussian surround function, The larger the value, the greater the suppression of the noise of the channel image. The smaller it is, the greater the enhancement on the crack edge;
[0047] Based on the following formula, the and stated For the original Make corrections and get the corrected :
[0048] ;
[0049] Among them, and Take 0.7 and 0.4 respectively;
[0050] Through the The parameters utilize an image enhancement algorithm to improve each channel image of the crack image to obtain an enhanced crack contour area.
[0051] A method for detecting cracks in a dam body of a water conservancy project provided by an embodiment of the present invention detects cracks in the dam body through image processing technology, and can better avoid interference of noise points in a connected domain and burrs on crack edges on crack detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 A flow chart of a method for detecting cracks in a dam body of a water conservancy project provided by an embodiment of the present invention;
[0053] Figure 2 A crack image after binarization provided by an embodiment of the present invention;
[0054] Figure 3 A crack region and a noise region of a connected region skeleton provided by an embodiment of the present invention;
[0055] Figure 4 Rays emitted in eight directions from pixel points on the connected region skeleton provided by the embodiment of the present invention;
[0056] Figure 5 The embodiment of the present invention provides a central pixel point The four edge direction lines within the 3x3 neighborhood of .
[0057] The above drawings have shown clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0058] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure.
[0059] Figure 1 A flow chart of a method for detecting cracks in a dam body of a water conservancy project provided by an embodiment of the present invention.
[0060] The specific steps of the water conservancy project dam crack detection method are as follows:
[0061] S101, performing denoising on the collected crack image of the concrete dam of the water conservancy project by using a median filtering technique;
[0062] Specifically, under the illumination of a lighting lamp, a CCD camera can be used to collect a color RGB crack image of a concrete dam, and the RGB crack image can be converted into a grayscale image. The grayscale image is preprocessed, and the median filter method is used to process the image to eliminate the influence of noise and some external interference, while retaining the edge information of the image to enhance the accuracy of subsequent analysis.
[0063] The specific steps of performing denoising on the collected crack image of the concrete dam of the water conservancy project by using the median filtering technology provided by the embodiment of the present invention are as follows:
[0064] Use CCD camera to collect color RGB crack images of concrete dam of water conservancy project;
[0065] Converting the color RGB crack image into a grayscale image to obtain a crack image of the concrete dam of the water conservancy project;
[0066] The crack image is denoised by using a median filtering technique.
[0067] S102, obtaining a crack contour area of the crack image after denoising by using a maximum inter-class variance method;
[0068] Since concrete dams are basically distributed in black and white, the crack area that needs to be determined during detection is generally the black area. Therefore, in the embodiment of the present application, the maximum inter-class variance method OTSU is used to calculate the optimal threshold by traversing the grayscale value. The grayscale value greater than the optimal threshold is set to 0, and the grayscale value less than the optimal threshold is set to 255, which are used as the background area and foreground area respectively. Finally, the optimal threshold that can clearly distinguish the foreground and background areas is obtained, so that the crack area can be further located later.
[0069] Figure 2 This is a binary crack image provided by an embodiment of the present invention.
[0070] The binary image is expanded to thicken the crack contour area, thereby improving the accuracy of obtaining unclear lines.
[0071] For the grayscale image of the binary image area after expansion, the grayscale projection method is used to obtain the horizontal projection curve and the vertical projection curve in the horizontal and vertical directions respectively, and the crack area is obtained according to the grayscale values of the two curves at the crack after expansion.
[0072] The specific steps of obtaining the crack contour area of the crack image after denoising by the maximum inter-class variance method OTSU are as follows:
[0073] Determine the optimal threshold of the crack image after denoising by using the maximum inter-class variance method (OTSU);
[0074] The crack image after denoising is binarized according to the optimal threshold value to obtain a crack contour area of the crack image after denoising.
[0075] The specific steps of binarizing the crack image after denoising according to the optimal threshold value to obtain the crack contour area of the crack image after denoising provided by the embodiment of the present invention are as follows:
[0076] Binarizing the crack image after denoising according to the optimal threshold;
[0077] Performing expansion processing on the binary crack image so that the crack contour area is thickened;
[0078] Obtaining corresponding horizontal projection curves and vertical projection curves from the horizontal and vertical directions of the crack image after expansion processing by a grayscale projection method;
[0079] The crack contour area is obtained according to the grayscale values of the horizontal projection curve and the vertical projection curve at the crack after expansion.
[0080] S103, calculating the noise connectivity of the skeleton area Noise crack fit , enhancing the crack contour area of the crack image;
[0081] Among them, the Indicates The pixel point at the position determines whether the connected crack edge is a noise area. Indicates The noise crack fit of the pixel at the position;
[0082] Usually, the distance of shooting crack images is far, so the crack contour area in the image is relatively blurred. In addition, the shooting effect of crack images is greatly affected by lighting, so the contrast of the crack contour area in the image may not be obvious, and the crack edge features may not be clear. Furthermore, there may be many noise points in the concrete dam, which makes the parts that are not cracks in the connected area confused. In addition, the fit between noise points and cracks may be high, making it easy to be misjudged as burrs on the crack edge. Therefore, from the perspective of the degree of noise connectivity and the fit between noise cracks in the crack image, the crack image is further enhanced.
[0083] At the same time, the noise points of the dam image in the three RGB channels may be different. If we can perform Gaussian distribution function on the three channels to different degrees according to the distribution of noise points in each channel image, By improving the value, the target crack area can be further enhanced accurately, thereby reducing the error caused by grayscale image enhancement. If the value is larger, the noise of the image will be suppressed; if The smaller the crack edge, the stronger it is. Zoom in and out for precise enhancement.
[0084] In the embodiment of the present application, for the Gaussian surround functions of the three channels Take the empirical value of 90, and then based on the different distribution of noise points in each channel, the noise connectivity and noise crack fit are used to influence Take values to adjust the degree of enhancement of different noise points in each channel.
[0085] For the crack area image obtained by OTSU, although the cracks have been roughly segmented, there are some noise areas connected to the crack edges in the connected areas. The shape of this area does not have the characteristics of a slender crack. Therefore, when performing image enhancement, this foreground area that is not a crack will not be distinguished, but will be enhanced indiscriminately. This will cause errors in the enhanced image and lead to errors in subsequent crack detection.
[0086] In order to solve this connected noise, in the embodiment of the present application, the noise connectivity degree is used To mark this situation, the degree of noise connectivity It indicates the degree of connectivity of the noise points in the crack area that are connected to the crack edge in the connected area. By calculating the degree of noise connectivity, the Gaussian surround function of each pixel is corrected in the image enhancement stage. value to achieve weak enhancement of the noise connected area and strong enhancement of the crack area.
[0087] For the degree of connectivity of the marked noise, the distance transformation method is used in the embodiment of the present application. For each pixel point in the foreground area of the binary image of the crack area, the minimum Euclidean distance between it and the pixel point in the background area is obtained as its distance transformation gray value. The image after the distance change is thinned to obtain the skeleton of the connected area. In the embodiment of the present application, Represents a set of skeleton pixels.
[0088] Figure 3 The crack area and the noise area of the connected area skeleton provided by the embodiment of the present invention.
[0089] For the above skeleton pixel set For each pixel in the image, a ray is emitted from eight directions: 0 degrees, 45 degrees, 90 degrees, ..., 315 degrees. ,in, From 1 to The values correspond to eight rays starting from 0 degrees in the clockwise direction. Indicates that there are 8 rays. Each time a ray extends outward through a pixel, the skeleton point ray extension frequency of the connected area of the airspace where the pixel is located is Add one until it touches the distance transformation gray value When the pixel is 0, the extension stops.
[0090] Figure 4 The rays emitted in eight directions from the pixel points on the connected region skeleton provided in the embodiment of the present invention.
[0091] The obtained skeleton point ray extension frequency It is used to indicate the frequency of each skeleton point in the connected area being passed by the ray. The specific formula is as follows:
[0092] ;
[0093] in, Indicates that there are 8 rays. Calculate the ray extension frequency of each skeleton point on the skeleton . Indicates the first Whether the ray marks the pixel point , if passing through the pixel ,but The value is 1; if it does not pass through the pixel ,but The value is 0.
[0094] Traverse each pixel point of the skeleton of the connected area of the crack image and count the number of pixels passed by the ray emitted by each skeleton point , so we get the skeleton point ray extension frequency .
[0095] If the frequency of pixels passed by the rays from the skeleton point is small, it means that the area is irregular, making the ray distribution uneven and the density low. If the frequency is large, it means that the source skeleton point of the ray is closer to the boundary, and the distribution of the adjacent skeleton points is regular.
[0096] In this way, according to the skeleton point ray extension frequency Get the noise connectivity of the skeleton area , the formula is as follows:
[0097] ;
[0098] in, and Indicates that there are OK Column pixels, denominator The average frequency of ray extensions representing the connected region. The degree of noise connectivity in the skeleton region Indicates The degree to which the pixel point at the position is judged as a noise area for the connected crack edge. This indicator is used to correct the Gaussian surround function in image enhancement. If the noise connectivity of the skeleton area The larger the value, the more frequent the skeleton point ray extension. The larger the value, the higher the frequency of the point being passed by the ray. The closer the skeleton point that emits the ray is to the boundary point and the more regular the distribution of the end point is, the more likely the pixel is in the crack area. If the noise connectivity of the skeleton area is The smaller it is, the opposite is true, indicating that the pixel is very likely to be in the noise area.
[0099] Analysis of the binary image of the crack shows that some crack edges have burr-shaped noise points. These noise points close to the crack edges cannot be judged as crack edges and will affect the recognition of the crack edges. Therefore, it is necessary to mark these noise points close to the crack edges. In the embodiment of the present application, when performing convolution filtering on a single-channel image, each pixel point is appropriately adjusted. The size of the noise point is adjusted to achieve the effect of affecting the edge of the crack.
[0100] The distribution characteristics of these burr-shaped noise points close to the edge of the crack are generally unevenly distributed in the surrounding neighborhood, and unlike the edge of the crack, they are not regularly distributed with the same gradient on one side.
[0101] Based on this feature, a 3x3 neighborhood can be constructed to analyze the gradient distribution of each neighborhood. Specifically, in each neighborhood, if there is a uniform gradient amplitude, it is considered to be a crack area, background area or edge area; if there is an uneven gradient amplitude, it is considered to be a burr area. This metric can be named noise crack fit .
[0102] Figure 5 The embodiment of the present invention provides a central pixel point The four edge direction lines within the 3x3 neighborhood of .
[0103] In order to determine whether the current pixel is an edge or crack area, in the embodiment of the present application, by constructing a 3x3 neighborhood of the central pixel, it is possible to appear at the edge in a small range. Figure 5 In the four cases shown in FIG. 1 , serial number ① indicates the edge direction line that may appear in the vertical direction;
[0104] Serial number ② indicates the possible edge direction line in the main diagonal direction;
[0105] Serial number ③ indicates the edge direction line that may appear in the horizontal direction;
[0106] Serial number ④ indicates the edge direction line that may appear in the sub-diagonal direction.
[0107] The gradient amplitude of the crack area is obtained by the Sobel operator. To represent. For these four edge direction lines, if the variance of the edge direction line is small, then this edge direction line is considered to be an edge line. The variance of these four edge direction lines is summed up. The larger the value, the more uneven each line in this neighborhood is, and it is very likely to be a burr; the smaller the value, the smaller the difference between each line in this neighborhood is, and it is highly likely to be inside the region.
[0108] Through this analysis, the current center pixel can be further reflected. Whether the 3x3 neighborhood is a glitch area.
[0109] Therefore, the noise crack fit can be set , to determine whether each pixel is a burr area. is larger, it means that there are one or more edge direction lines with large gradient changes in the neighborhood, so The value of the value reflects whether the pixel is a burr area; if the indicator If it is smaller, it means that the gradient changes of the edge direction lines in the neighborhood are relatively small, so it can be judged as the interior of the region or the edge of the crack according to its size.
[0110] Noise crack fit at each pixel The indicator formula is as follows:
[0111] ;
[0112] in, Indicates that the pixel coordinates are The noise crack fit of the pixel point. The larger the value, the greater the probability that the pixel is a burr area; The smaller the value, the greater the probability that the pixel is an internal area or a crack edge. represents the number of edge direction lines, for example, The value can be 4, indicating that the current pixel has a total of four edge direction lines.
[0113] Through the above analysis, the degree of noise connectivity in the skeleton area is obtained Noise crack fit These two indicators are Make corrections and get the corrected As shown below:
[0114] ;
[0115] Among them, the noise connectivity degree of the skeleton area Indicates the degree of noise in the connected area, specifically:
[0116] if The larger the value, the more frequent the skeleton ray extension of the pixel. The larger the value is, the more times the rays emitted by the skeleton point pass through, indicating that the skeleton here is closer to the boundary and the more regular the distribution of the skeleton points is, then it can be considered that there is a greater possibility that this is a crack area, thus determining the need for Amplify the crack area to enhance it.
[0117] On the contrary, if The smaller the value is, the farther the skeleton at the pixel is from the boundary and the irregular distribution of the skeleton points is. It can be considered that there is a high possibility that this is a noise area, so it is necessary to determine Reduce it to weakly enhance the noise area.
[0118] Noise crack fit The influence of the burr noise near the crack edge on the crack is as follows:
[0119] if The larger the value is, the greater the change in the pixel gradient of one or more of the four edge direction lines is. If the grayscale values of the pixels near the pixel point are irregular, the area can be considered to be a burr area, thus determining the need for correction. To reduce the size, use To indicate the degree of reduction, the burr area is weakly enhanced;
[0120] if The smaller the value is, the smaller the change of the pixel gradient of the four edge direction lines is. If there are some similar gradient values in the grayscale values of the pixels near the pixel, it can be considered that the area is not a burr area, so it is determined that the burr area needs to be corrected. To zoom in, use To indicate the degree of magnification, the interior of the region is strongly enhanced.
[0121] In the embodiment of the present application, the noise crack fit Noise connectivity with skeleton region After normalization, these two indicators are multiplied by the mapping coefficient, and the resulting value range is 0 to 1.1. Specifically, since the noise area is larger than the burr area and has a greater impact on crack extraction, the noise connectivity of the skeleton area is Add a mapping factor of 0.7 , add a mapping coefficient of 0.4 to the noise crack fit That is to say, in the embodiment of the present application, and Take 0.7 and 0.4 respectively.
[0122] when If this coefficient is less than 0.9, then Thus, the coefficient is controlled between 0.9 and 1.1, so that the corrected The value of can be kept in the optimal range of 80 to 100 to prevent it from expanding or shrinking to an unreasonable range.
[0123] For the Gaussian surround function The value correction analysis of Then, the Gaussian surround function is used for calculation. The three channels are filtered using the Gaussian surround function to obtain the illumination components. , for the original image and lighting component After taking the logarithm, subtract them, calculate the maximum and minimum values of the values obtained after the subtraction, and linearly quantize each value. After exponential transformation, the reflection component is output as the final enhanced result image.
[0124] Calculating the noise connectivity of skeleton regions provided by the embodiment of the present invention The specific steps are as follows:
[0125] For each pixel point in the foreground area of the binary image of the crack contour area, the minimum Euclidean distance with the pixel point in the background area is obtained as the distance transformation grayscale value. ;
[0126] The image after distance change is thinned to obtain the skeleton of the connected area, where the set of skeleton pixels is represented by express;
[0127] For each pixel on the skeleton, a ray is emitted in eight directions ,in, From 1 to The value corresponds to eight rays in the clockwise direction starting from 0 degrees;
[0128] According to the ray, calculate the degree of noise connectivity in the skeleton area .
[0129] According to the ray, the embodiment of the present invention provides a method for calculating the noise connectivity degree of the skeleton region. The specific steps are as follows:
[0130] Every time a ray extends outward through a pixel, the skeleton point ray extension frequency of the connected area of the airspace where the pixel is located is Add one until the gray value of the distance is reached The pixel is 0;
[0131] Get the skeleton point ray extension frequency , used to represent the frequency of each skeleton point in the connected area being passed by the ray;
[0132] The frequency of rays extending from the skeleton point Get the noise connectivity of the skeleton area .
[0133] The embodiment of the present invention provides the frequency of extending the skeleton point ray Get the noise connectivity of the skeleton area The specific steps are as follows:
[0134] The frequency of ray extension from the skeleton point is given by the following formula: Get the noise connectivity of the skeleton area :
[0135] ;
[0136] in, and In the crack image, OK Column pixels, The average value of the ray extension frequency of the connected area is represented.
[0137] Calculation of noise crack fit provided by an embodiment of the present invention The specific steps are as follows:
[0138] The formula for calculating each pixel is as follows: :
[0139] ;
[0140] in, represents the number of edge direction lines, represents the gradient amplitude of the crack region, represents the average value of the gradient amplitude of each crack area, express The number of
[0141] The specific steps of enhancing the crack contour area of the crack image provided by the embodiment of the present invention are as follows:
[0142] Use the Gaussian surround function to filter each channel to obtain the illumination component ;
[0143] For the original image and lighting component Take the logarithm and then subtract;
[0144] Calculating the maximum and minimum values of the values obtained after the subtraction;
[0145] Linearly quantize each of the maximum value and the minimum value;
[0146] Perform exponential transformation on the linearly quantized value, and output the reflection component as the enhanced crack contour area.
[0147] The specific steps of enhancing the crack contour area of the crack image provided by the embodiment of the present invention are as follows:
[0148] Determine the original ;in, is the standard deviation of the Gaussian surround function, The larger the value, the greater the suppression of the noise of the channel image. The smaller it is, the greater the enhancement on the crack edge;
[0149] Based on the following formula, the and stated For the original Make corrections and get the corrected :
[0150] ;
[0151] Among them, and Take 0.7 and 0.4 respectively;
[0152] Through the The parameters utilize an image enhancement algorithm to improve each channel image of the crack image to obtain an enhanced crack contour area.
[0153] S104, extracting the enhanced crack image through an edge detection operator to obtain a crack detection result.
[0154] Through the above-mentioned different degrees of enhancement processing of the noise points in the connected areas of the image and the burrs on the edges of the cracks in the three channels, the cracks in the crack image are presented more clearly. In the embodiment of the present application, the Canny operator is used to further extract the enhanced crack edges, thereby completing the detection of the cracks.
[0155] In the application scenario of the present application, a concrete dam in a water conservancy project is photographed. Usually, the distance for photographing the crack image is far, so the crack outline area in the image is relatively blurred. In addition, the shooting effect of the crack image is greatly affected by the lighting, so the contrast of the crack outline area in the image may not be obvious, and the crack edge features may not be clear. Furthermore, the concrete dam may have many noise points, which may confuse the parts that are not cracks in the connected area. Moreover, the fit between the noise points and the cracks may be high, making it easy to be misjudged as burrs on the edge of the cracks, interfering with the detection results of the cracks. The present invention improves the Retinex theory to distribute the different noises of the three channel images of the dam body cracks, and according to the degree of noise connectivity in the skeleton area, the noise points are selected. Noise crack fit Two indicators are used to mark the degree of noise points in the connected area and burrs on the edge of the crack. These two indicators are used to measure the Gaussian surround function. Corrections of different degrees are performed respectively to better avoid the interference of noise points in the connected domain and burrs on the crack edge on crack detection.
[0156] In the several embodiments provided by the present invention, it should be understood that the disclosed methods can be implemented in other ways. The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention is described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some or all of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting cracks in a dam body of a water conservancy project, characterized in that: include: The crack images of concrete dams of water conservancy projects collected were de-noised by using median filtering technology; Obtaining the crack contour area of the crack image after denoising by using the maximum inter-class variance method; Calculate the noise connectivity of the skeleton region Noise crack fit , enhancing the crack contour area of the crack image; wherein the Indicates The pixel point at the position determines whether the connected crack edge is a noise area. Indicates The noise crack fit of the pixel at the position; Extracting the enhanced crack image by edge detection operator to obtain crack detection results; The calculation of the noise connectivity of the skeleton region ,include: For each pixel point in the foreground area of the binary image of the crack contour area, the minimum Euclidean distance with the pixel point in the background area is obtained as the distance transformation grayscale value. ; The image after distance change is thinned to obtain the skeleton of the connected area, where the set of skeleton pixels is represented by express; For each pixel on the skeleton, a ray is emitted in eight directions ,in, From 1 to The value corresponds to eight rays in the clockwise direction starting from 0 degrees; According to the ray, calculate the degree of noise connectivity in the skeleton area ; The noise connectivity of the skeleton region is calculated according to the ray. ,include: Every time a ray extends outward through a pixel, the skeleton point ray extension frequency of the connected area of the airspace where the pixel is located is Add one until the gray value of the distance is reached The pixel is 0; Get the skeleton point ray extension frequency , used to represent the frequency of each skeleton point in the connected area being passed by the ray; The frequency of rays extending from the skeleton point Get the noise connectivity of the skeleton area ; The frequency of extending the ray from the skeleton point Get the noise connectivity of the skeleton area ,include: The frequency of ray extension from the skeleton point is given by the following formula: Get the noise connectivity of the skeleton area : in, and In the crack image, OK Column pixels, An average value of the ray extension frequency representing the connected area; The calculation of noise crack fit ,include: The formula for calculating each pixel is as follows: : in, represents the number of edge direction lines, represents the gradient amplitude of the crack region, represents the average value of the gradient amplitude of each crack area, express The number of 2. A method for detecting cracks in a dam body of a water conservancy project according to claim 1, characterized in that: The method of performing denoising on the collected crack image of the concrete dam of the water conservancy project by using the median filtering technology includes: Use CCD camera to collect color RGB crack images of concrete dam of water conservancy project; Converting the color RGB crack image into a grayscale image to obtain a crack image of the concrete dam of the water conservancy project; The crack image is denoised by using a median filtering technique.
3. A method for detecting cracks in a dam body of a water conservancy project according to claim 1, characterized in that: The method of obtaining the crack contour area of the crack image after denoising by using the maximum inter-class variance method (OTSU) includes: Determine the optimal threshold of the crack image after denoising by using the maximum inter-class variance method (OTSU); The crack image after denoising is binarized according to the optimal threshold value to obtain a crack contour area of the crack image after denoising.
4. A method for detecting cracks in a dam body of a water conservancy project according to claim 3, characterized in that: The step of binarizing the crack image after denoising according to the optimal threshold value to obtain a crack contour area of the crack image after denoising includes: Binarizing the crack image after denoising according to the optimal threshold; Performing expansion processing on the binary crack image so that the crack contour area is thickened; Obtaining corresponding horizontal projection curves and vertical projection curves from the horizontal and vertical directions of the crack image after expansion processing by a grayscale projection method; The crack contour area is obtained according to the grayscale values of the horizontal projection curve and the vertical projection curve at the crack after expansion.
5. A method for detecting cracks in a dam body of a water conservancy project according to claim 1, characterized in that: The step of enhancing the crack contour area of the crack image includes: Use the Gaussian surround function to filter each channel to obtain the illumination component ; For the original image and lighting component Take the logarithm and then subtract; Calculating the maximum and minimum values of the values obtained after the subtraction; Linearly quantize each of the maximum value and the minimum value; Perform exponential transformation on the linearly quantized value, and output the reflection component as the enhanced crack contour area.
6. A method for detecting cracks in a dam body of a water conservancy project according to claim 5, characterized in that: The step of enhancing the crack contour area of the crack image includes: Determine the original ;in, is the standard deviation of the Gaussian surround function, The larger the value, the greater the suppression of the noise of the channel image. The smaller it is, the greater the enhancement on the crack edge; Based on the following formula, the and stated For the original Make corrections and get the corrected : Among them, and Take 0.7 and 0.4 respectively; Through the The parameters utilize an image enhancement algorithm to improve each channel image of the crack image to obtain an enhanced crack contour area.
