A method for optimizing noise in concrete crack delineation images
By combining grayscale, adaptive binarization, fuzzy processing and contour analysis, the problem of noise interference in concrete crack delineation was solved, and accurate crack delineation results were achieved.
Patent Information
- Application Number
- CN202210928120.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-03
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2042-08-03
AI Technical Summary
Existing technologies struggle to effectively distinguish between the main crack structure and noise factors during concrete crack delineation, leading to inaccurate delineation results, especially with significant noise impact over large areas.
A combination of grayscale conversion, adaptive binarization, Gaussian blurring, Canny operator, and contour analysis is used to eliminate non-standard contours and optimize image noise by calculating the minimum bounding rectangle and aspect ratio.
While ensuring that the outline of the main crack is not affected, large-area and small image noise is effectively removed, thus improving the accuracy of the outline.
Smart Images

Figure CN115170553B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of engineering quality and safety testing technology, and in particular to a method for optimizing noise in concrete crack delineation images. Background Technology
[0002] Concrete cracks are physical structural changes caused by the influence of internal and external factors on concrete structures. Cracks are the main reason for the reduction in the load-bearing capacity, durability, and waterproofing of concrete structures. In civil engineering, concrete structures dominate, and cracks are inevitable due to the influence of internal and external factors. Therefore, the detection of concrete cracks and their expansion trends is necessary and important.
[0003] When using image processing to delineate concrete cracks from photographs, the characteristics of concrete mean that small air pockets, fine sand and gravel on the surface, surface cracks, or color differences in concrete due to water immersion may appear around the crack, affecting the delineation results. Simple image delineation algorithms cannot distinguish between the main crack and these error factors. Therefore, during delineation, all situations are delineated together, thus affecting the accuracy of the crack delineation results.
[0004] In existing technologies, image processing techniques such as Gaussian blurring are commonly used to mitigate errors in image delineation results caused by external interference factors. Gaussian blurring is often effective against minor image noise. To eliminate noise over large areas, the blurring coefficient needs to be increased. However, setting the blurring coefficient too high can affect the accuracy of the crack delineation. Therefore, current techniques are not ideal for handling large-area influencing factors such as voids and color differences on concrete surfaces. Therefore, this paper proposes a method to optimize image noise in concrete crack delineation results. Summary of the Invention
[0005] The purpose of this invention is to provide a method for optimizing the noise of concrete crack outline images, which can effectively identify and eliminate large-area image noise and small image noise while ensuring that the main outline of the crack is not affected.
[0006] To achieve the above objectives, the present invention provides the following solution:
[0007] A method for noise optimization of concrete crack delineation image includes the following steps:
[0008] Step 1: Acquire crack images, and then perform grayscale conversion and adaptive binarization on the crack images in sequence to convert the crack images into black and white binary images;
[0009] Step 2: Use the Gaussian blur algorithm to blur the black and white binary image to obtain the processed black and white image of the crack;
[0010] Step 3: Use the Canny operator to outline the processed crack black and white image to obtain the outlined image;
[0011] Step 4: Use the findCountours function to extract all the contour frames in the outlined image individually to obtain individual contour frames;
[0012] Step 5: Calculate the minimum bounding rectangle of the individual contour frame, analyze it in conjunction with the contour vector and aspect ratio of the minimum bounding rectangle, and based on the analysis, remove contours that do not meet the standards to obtain the final crack delineation result image.
[0013] Optionally, in step 2, the black and white binary image is blurred using a Gaussian blur algorithm to obtain the processed black and white image of the crack, specifically as follows:
[0014] The Gaussian blur algorithm is used to blur a black and white binary image. The convolution kernel side length in the Gaussian blur algorithm is set to 4. After blurring, the processed black and white image of the crack is obtained.
[0015] Optionally, in step 3, the Canny operator is used to outline the processed crack black-and-white image to obtain an outlined image, specifically:
[0016] The Canny operator is used to outline the crack in the black and white image, depicting the edge parts of different color difference blocks in all images, and thus obtaining the outlined image.
[0017] Optionally, in step 5, the minimum bounding rectangle of each individual contour frame is calculated. The contour vector and aspect ratio of the minimum bounding rectangle are then analyzed. Based on the analysis, contours that do not meet the standards are removed to obtain the final crack delineation image. This process includes the following steps:
[0018] S1: Calculate the minimum bounding rectangle of all individual contour frames, and calculate the aspect ratio of the minimum bounding rectangle based on the minimum bounding rectangle of the individual contour frames. Remove contours with an aspect ratio greater than 1 / 5.
[0019] S2: Calculate the area of the smallest bounding rectangle of the unremoved contours, take the contour with the largest area of the smallest bounding rectangle as the main contour of the crack, and calculate the image vector vector1 of the main contour of the crack.
[0020] S3: Obtain the original image length (width) and original image height (height) of the outline image, calculate the distance from all unremoved outlines around the main crack outline to the main crack outline, and compare them with... In comparison, if the value is greater than 30°, the contour is retained; if the value is less than 30°, the contour vector vector2 is calculated. Based on the contour vector vector2 and the image vector vector1 of the main contour of the crack, the angle between vector2 and vector1 is calculated. It is determined whether the angle is less than 30°. If it is less than 30°, the contour is removed; if it is greater than or equal to 30°, the contour is retained.
[0021] S4: Get the area of the smallest bounding rectangle of all unremoved contours, and determine if it is less than width / 20*height / 20. If it is less, remove the contour; otherwise, keep the contour.
[0022] S5: Remove all contours that do not meet the criteria to obtain the final crack outline image.
[0023] According to specific embodiments provided by the present invention, the following technical effects are disclosed: The method for optimizing noise in concrete crack delineation images provided by the present invention first acquires crack images, and then performs grayscale conversion and adaptive binarization on the crack images sequentially to convert the crack images into black and white binary images. A Gaussian blur algorithm is then used to blur the black and white binary images to obtain processed black and white crack images, eliminating minor image noise. Specifically, setting the convolution kernel side length in the Gaussian blur algorithm to 4 ensures that various minor image noises are effectively removed without affecting the main outline of the crack. The Canny operator is used to delineate the outline of the processed black and white crack images to obtain outlined images. The findCountours function is used to extract all outline frames from the outlined images individually to obtain individual outline frames. Finally, the outline vector and the aspect ratio of the minimum bounding rectangle of the outline are combined for judgment to eliminate large-area image noise such as voids and color differences on the concrete surface, resulting in accurate crack delineation results. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a schematic diagram of the noise optimization method for concrete crack delineation result images according to an embodiment of the present invention;
[0026] Figure 2 This is the original image of the crack;
[0027] Figure 3 A schematic diagram showing the best outline of the cracks in the old version;
[0028] Figure 4 This is a schematic diagram of the optimal crack delineation result obtained using the method of the present invention. Detailed Implementation
[0029] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0030] The purpose of this invention is to provide a method for optimizing the noise of concrete crack outline images, which can effectively identify and eliminate large-area image noise and small image noise while ensuring that the main outline of the crack is not affected.
[0031] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0032] like Figure 1 As shown, the method for optimizing noise in concrete crack delineation image provided in this embodiment of the invention includes the following steps:
[0033] Step 1: Acquire crack images, and then perform grayscale conversion and adaptive binarization on the crack images in sequence to convert the crack images into black and white binary images;
[0034] Step 2: Use the Gaussian blur algorithm to blur the black and white binary image to obtain the processed black and white image of the crack;
[0035] Step 3: Use the Canny operator to outline the processed crack black and white image to obtain the outlined image;
[0036] Step 4: Use the findCountours function to extract all the contour frames in the outlined image individually to obtain individual contour frames;
[0037] Step 5: Calculate the minimum bounding rectangle of the individual contour frame, analyze it in conjunction with the contour vector and aspect ratio of the minimum bounding rectangle, and based on the analysis, remove contours that do not meet the standards to obtain the final crack delineation result image.
[0038] In step 1, the values of the R (red), G (green), and B (blue) channels of the crack acquisition image are first converted to grayscale with weights of 0.3*R, 0.59*G, and 0.11*B. These weights represent the human eye's sensitivity to red, green, and blue. Finally, the grayscale image is thresholded to 127 bits, with pixels less than 127 being set to 0 and pixels greater than or equal to 127 being set to 255, generating a black and white binary image.
[0039] In step 2, the Gaussian blur algorithm is used to blur the black and white binary image to obtain the processed black and white image of the crack, specifically:
[0040] The Gaussian blur algorithm is used to blur black and white binary images. The convolution kernel side length in the Gaussian blur algorithm is set to 4. After blurring, the processed black and white image of the crack is obtained. Setting the convolution kernel side length to 4 in the Gaussian blur algorithm can better ensure that various small image noises are effectively removed without affecting the main outline of the crack.
[0041] In step 3, the Canny operator is used to outline the processed crack black-and-white image, resulting in an outlined image, specifically:
[0042] The Canny operator is used to outline the crack in the black and white image, depicting only the edge parts of different color difference blocks in all images to obtain the outlined image.
[0043] In step 5, the minimum bounding rectangle of each individual contour frame is calculated. The contour vector and aspect ratio of the minimum bounding rectangle are then analyzed. Based on the analysis, contours that do not meet the standards are removed, resulting in the final crack delineation image. This process includes the following steps:
[0044] S1: Calculate the minimum bounding rectangle of all individual contour frames, and calculate the aspect ratio of the minimum bounding rectangle based on the minimum bounding rectangle of the individual contour frames. According to the characteristics of concrete cracks, the direction and trend of crack growth are uniform and there will be no back growth. Therefore, contours with an aspect ratio greater than 1 / 5 are removed.
[0045] S2: Calculate the area of the smallest bounding rectangle of the unremoved contours, and take the contour with the largest area of the smallest bounding rectangle as the main contour of the crack, and calculate the image vector vector1 of the main contour of the crack.
[0046] S3: Obtain the original image length (width) and original image height of the outline image. Traverse the main outline pixels of the crack and the surrounding unremoved outline pixels, calculate the distance between two pixels, and find the shortest distance, which is the distance from all unremoved outlines around the main outline of the crack to the main outline of the crack. Then, compare this distance with the distance from the unremoved outlines around the main outline of the crack to the main outline of the crack. If the value is greater than the value, the contour is retained; if the value is less than the value, the least squares fitting is used to calculate the vector vector2 of the contour for all pixels of the contour. The angle between vector2 and vector1 is calculated based on the contour vector vector2 and the image vector vector1 of the main contour of the crack. It is determined whether the angle is less than 30°. If it is less than 30°, the contour is removed; if it is greater than or equal to 30°, the contour is retained.
[0047] S4: Get the area of the smallest bounding rectangle of all unremoved contours, and determine if it is less than width / 20*height / 20. If it is less, remove the contour; otherwise, keep the contour.
[0048] S5: Remove all contours that do not meet the criteria to obtain the final crack outline image.
[0049] One embodiment of the present invention is as follows: Figures 2-4 As shown, where Figure 2 Image of the crack. Figure 3 This is a schematic diagram showing the best outline of the cracks in the old version. Figure 3 This is a schematic diagram of the optimal crack delineation result obtained using the method of the present invention, and... Figure 2 In comparison, the optimal crack delineation result obtained using the method of the present invention can eliminate large-area image noise and small image noise, and obtain accurate crack delineation results.
[0050] This invention provides a method for optimizing noise in concrete crack delineation images. The method first acquires crack images and then sequentially performs grayscale conversion and adaptive binarization to convert the crack images into black-and-white binary images. A Gaussian blur algorithm is then used to blur the black-and-white binary images, resulting in a processed black-and-white crack image that eliminates minor image noise. Specifically, setting the convolution kernel side length in the Gaussian blur algorithm to 4 ensures effective removal of various minor image noises without affecting the main crack outline. The Canny operator is then used to delineate the outline of the processed black-and-white crack image, resulting in a delineated image. The findCountours function is used to extract all individual contour frames from the delineated image, obtaining individual contour frames. Finally, the contour vector and the aspect ratio of the minimum bounding rectangle of the contour are combined to eliminate large-area image noise such as voids and color differences on the concrete surface, resulting in an accurate crack delineation result.
[0051] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for optimizing noise of a concrete crack delineation result image, characterized in that, Comprising the following steps: Step 1: collect the crack image, and sequentially carry out gray scale and adaptive binaryzation on the crack image, and convert the crack image into a black and white binary image; Step 2: utilize a Gaussian blur algorithm to perform blur processing on the black and white binary image, and obtain a processed crack black and white image; Step 3: utilize a Canny operator to perform contour outlining on the processed crack black and white image, and obtain a contour outlined image; Step 4: utilize a findCountours function to separately extract all contour frames in the contour outlined image, and obtain a separate contour frame; Step 5: calculate the minimum circumscribed rectangle of the separate contour frame, analyze the contour vector and the aspect ratio of the minimum circumscribed rectangle, and according to the analysis judgment, eliminate the contour that does not meet the standard, and obtain a final crack outlined result image, specifically comprising the following steps: S1: calculate the minimum circumscribed rectangle of all separate contour frames, and according to the minimum circumscribed rectangle of the separate contour frame, calculate the aspect ratio of the minimum circumscribed rectangle, and eliminate the contour whose aspect ratio is greater than 1 / 5; S2: calculate the area of the minimum circumscribed rectangle of the contour that is not eliminated, take the contour with the maximum minimum circumscribed rectangle area as the main crack contour, and calculate the image vector vector1 of the main crack contour; S3: Obtain the original image length width and the original image height height of the contour sketch image, calculate the distance from all the non-removed contours around the crack main body contour to the crack main body contour, and compare the distance with the crack main body contour. In contrast, if greater than, the contour is retained, if less than, the contour vector vector2 is calculated, the angle between vector2 and the image vector vector1 of the crack main body contour is calculated according to the contour vector vector2 and the image vector vector1 of the crack main body contour, it is judged whether the angle is less than 30°, if less than, the contour is removed, if greater than or equal to, the contour is retained; S4: obtain the area of the minimum circumscribed rectangle of all contours that are not eliminated, and judge whether it is less than width / 20*height / 20, if it is less than, the contour is eliminated, otherwise, the contour is retained; S5: eliminate all contours that do not meet the judgment, and obtain a final crack outlined result image.
2. The method of claim 1, wherein, In step 2, the Gaussian blur algorithm is utilized to perform blur processing on the black and white binary image, and the processed crack black and white image is obtained, specifically as follows: The Gaussian blur algorithm is utilized to perform blur processing on the black and white binary image, wherein the convolution kernel edge length in the Gaussian blur algorithm is set to 4, and after the blur processing, the processed crack black and white image is obtained.
3. The method of claim 1, wherein, In step 3, the Canny operator is utilized to perform contour outlining on the processed crack black and white image, and the contour outlined image is obtained, specifically as follows: The Canny operator is utilized to perform contour outlining on the processed crack black and white image, and the edge part of all image different color difference blocks is depicted, and the contour outlined image is obtained.
Citation Information
Patent Citations
Bridge crack detection method based on image regeneration
CN110298816A
Bridge crack recognition method based on recursive search
CN110487497A