A Bridge Crack Width Classification Algorithm Based on Gray Difference Value
By using a classification algorithm based on grayscale difference value in bridge crack detection, the grayscale difference value of the grayscale value value point on the normal line is calculated, and the crack area belongs to the crack area and background area are distinguished, the problem of background pixel interference is solved, and the accurate judgment of the width of the bridge crack is achieved.
Patent Information
- Application Number
- CN202310502282.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-06
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2043-05-06
AI Technical Summary
In the existing bridge crack width detection method, interference from background pixels will affect the accuracy of width discrimination.
A bridge crack width classification algorithm based on grayscale difference values is used. By selecting equal distance points on the crack skeleton, the grayscale difference value of the grayscale value point on the normal line is calculated, and the crack area and background area are distinguished, thereby avoiding the influence of background pixels on judgment.
Accurate judgment of the width of bridge cracks is achieved, and the accuracy and reliability of detection are improved.
Smart Images

Figure CN116543209B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of bridge disease detection, and in particular to a method for detecting the width of a bridge crack. Background Art
[0002] As one of the important projects in transportation construction, bridge engineering is widely used in highways, railways, and urban interchanges. With the increase in the number of bridges, more and more research has been conducted on the detection and maintenance of bridge defects during service. During the service of a bridge, due to the effects of construction quality, bad weather, material degradation, and non-steady working loads, cracks and other defects may occur on the bridge, which reduces the bearing capacity and stability of the bridge and seriously affects the service level of the bridge. Therefore, regular detection and maintenance of bridge crack defects are of great significance to improving the service level of bridges. The width of a bridge crack is an important parameter for measuring the development status and severity of cracks. By comparing the length and width values of crack defects at different stages, an accurate prediction of the development trend of the cracks can be made, which can provide data support for maintenance decisions.
[0003] Based on image segmentation technology, the pixel information contained in the crack disease can be extracted, and the length and width features of the crack can be extracted by post-processing the crack segmentation mask. At present, the common crack width extraction algorithm estimates the actual crack width by calculating the width of the segmentation mask area, but the segmentation mask may contain interference from background pixels, which will affect the width quantization effect. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a bridge crack width classification algorithm based on grayscale difference values to solve the technical problem that background pixels may interfere with crack width discrimination.
[0005] The bridge crack width classification algorithm based on grayscale difference value of the present invention comprises the following steps:
[0006] Step 1: Select N equidistant points on the crack skeleton and record them as value positioning points;
[0007] Step 2: Draw the normal line of the crack skeleton at each value positioning point, and select X points on both sides of the value positioning point along the normal line as gray value points;
[0008] Step 3: Perform the following processing on the grayscale value points on each normal line:
[0009] 1) The coordinates of the gray value point are brought into the crack segmentation mask binary image to distinguish whether it belongs to the crack area or the background area. If it belongs to the crack area, the gray value point is the crack area point; if it belongs to the background area, the gray value point is the background area point;
[0010] 2) Substitute the coordinates of the value-taking points in each crack area and the coordinates of the value-taking points in the background area into the original grayscale image, and calculate the grayscale values of the value-taking points in the crack area and the value-taking points in the background area corresponding to the coordinates in the original grayscale image;
[0011] 3) Calculate the average grayscale value of the value-taking points in the background area and the average grayscale value of the value-taking points in the crack respectively to obtain the grayscale difference value. The calculation formula is as follows:
[0012]
[0013] where i represents the value-taking point in the crack area corresponding to the original grayscale image, p i is the grayscale value of this value-taking point in the crack area, and N is the number of value-taking points in the crack area; j represents the value-taking point in the background area corresponding to the original grayscale image, P j is the grayscale value of this value-taking point in the background area, and M is the number of value-taking points in the background area.
[0014] Step 4: Compare the grayscale difference value obtained in Step 3 with the reference threshold for crack width classification to determine the category of the crack width at the corresponding normal line.
[0015] Further, in Step 1, if the number of pixel points on the crack skeleton is less than 200, then N is taken as 10; if the number of pixel points on the crack skeleton is greater than 200, then N is taken as 40.
[0016] Further, the reference threshold for crack width classification in Step 4 includes Grey1 and Grey2, Grey1 = 11.7, Grey2 = 19.0;
[0017] If the grayscale difference value Grey < Grey1, then it is determined that the crack width category is 0.2 - 0.5 mm; if Grey1 < Grey < Grey2, then it is determined that the crack width category is 0.6 mm - 1 mm; if Grey > Grey2, then it is determined that the crack width category is > 1 mm.
[0018] Advantages of the present invention:
[0019] The bridge crack width classification algorithm based on the grayscale difference value of the present invention distinguishes the value-taking points of the grayscale values on the normal line of the crack skeleton according to the belonging area, and calculates the grayscale difference value between the two value-taking points of the grayscale values on the normal line, thus avoiding the influence of the pixel points belonging to the background area on the normal line on the judgment of the crack width, and further realizing the accurate discrimination of the crack width. Description of the Drawings
[0020] Figure 1 It is a schematic diagram of selecting equally spaced points on the crack skeleton.
[0021] Figure 2Schematic diagram of taking points on the normal line of the crack skeleton.
[0022] Figure 3 Schematic diagram of the area to which the grayscale value sampling points belong. Specific implementation mode
[0023] The present invention will be further described below in conjunction with the drawings and embodiments.
[0024] As Figures 1 - 3 shown, the bridge crack width classification algorithm based on the grayscale difference value in this embodiment includes the steps:
[0025] Step 1: Select N equally spaced points on the crack skeleton, denoted as sampling positioning points. After the original grayscale image with cracks is processed by binaryzation, thinning algorithm and instance segmentation algorithm, the crack skeleton is obtained. To balance the operation time and accuracy, through experiments, it is determined that if the number of pixel points on the crack skeleton is less than 200, N is preferably taken as 10; if the number of pixel points on the crack skeleton is greater than 200, N is preferably taken as 40; of course, in specific implementation, the value of N can also be adjusted according to needs. Figure 1 Schematic diagram of taking points when N is equal to 10.
[0026] Step 2: At each sampling positioning point, make the normal line of the crack skeleton, and take X points on both sides of the sampling positioning point along the normal line as the grayscale value sampling points. In this embodiment, X is equal to 10. Of course, in specific embodiments, the value of X can also be adjusted according to needs. Figure 2 Schematic diagram of taking points when X is 10.
[0027] Step 3: Make the following treatments for the grayscale value sampling points on each normal line respectively:
[0028] 1) Substitute the coordinates of the grayscale value sampling points into the binary image of the crack segmentation mask to distinguish whether it belongs to the crack area or the background area. If it belongs to the crack area, the grayscale value sampling point is a crack area sampling point; if it belongs to the background area, the grayscale value sampling point is a background area sampling point. As Figure 3 shown, where the blue line segments represent the sampling points belonging to the background area, the red line segments represent the sampling points belonging to the crack area, and the white area is the crack segmentation mask.
[0029] 2) Substitute the coordinates of each crack area sampling point and the coordinates of the background area sampling point into the original grayscale image, and calculate the grayscale values of the crack area sampling point and the background area sampling point corresponding to the coordinates in the original grayscale image.
[0030] 3) Calculate the average grayscale value of the background area sampling points and the average grayscale value of the crack sampling points respectively to obtain the grayscale difference value. The calculation formula is as follows:
[0031]
[0032] where \(i\) represents the crack region value-taking point corresponding to the original grayscale image, and \(p\) i is the grayscale value of this crack region value-taking point, and \(N\) is the number of crack region value-taking points; \(j\) represents the background region value-taking point corresponding to the original grayscale image, and \(P\) j is the grayscale value of this background region value-taking point, and \(M\) is the number of background region value-taking points.
[0033] Step 4: Compare the grayscale difference value obtained in Step 3 with the crack width classification reference threshold to determine the category of the crack width at the corresponding normal line. In this step, the crack width classification reference threshold includes Grey1 and Grey2, Grey1 = 11.7, Grey2 = 19.0; if the grayscale difference value Grey < Grey1, then determine that the crack width category is 0.2 - 0.5 mm; if Grey1 < Grey < Grey2, then determine that the crack width category is 0.6 mm - 1 mm; if Grey > Grey2, then determine that the crack width category is > 1 mm. Of course, the values of Grey1 and Grey2 described in this embodiment are only reference values determined by experiments. In specific implementations, the specific values of Grey1 and Grey2 can also be adjusted as needed.
[0034] In this embodiment, the bridge crack width classification algorithm based on the grayscale difference value distinguishes the grayscale value-taking points on the crack skeleton normal line according to the belonging region, and calculates the grayscale difference value between the two grayscale value-taking points on the normal line, thereby avoiding the influence of the pixel points belonging to the background region on the normal line on the crack width judgment, and further realizing the accurate discrimination of the crack width.
[0035] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the purpose and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.
Claims
1. A bridge crack width classification algorithm based on gray difference value, characterized in that: It includes the steps: Step 1: Select N equally spaced points on the crack skeleton, denoted as value positioning points; Step 2: At each value positioning point, make a normal line of the crack skeleton, and take X points on both sides of the value positioning point along the normal line as gray value sampling points; Step 3: Process the gray value sampling points on each normal line as follows: 1) Substitute the coordinates of the gray value sampling points into the binary image of the crack segmentation mask to distinguish whether it belongs to the crack area or the background area. If it belongs to the crack area, the gray value sampling point is a crack area sampling point; if it belongs to the background area, the gray value sampling point is a background area sampling point; 2) Substitute the coordinates of each crack area sampling point and the coordinates of the background area sampling points into the original gray image, and calculate the gray values of the crack area sampling points and the background area sampling points corresponding to the coordinates in the original gray image; 3) Calculate the average gray value of the background area sampling points and the average gray value of the crack sampling points respectively to obtain the gray difference value. The calculation formula is as follows: where i represents the crack region value points corresponding in the original grayscale image, and p i is the grayscale value of the crack region value point, and N is the number of crack region value points; j represents the background region value points corresponding in the original grayscale image, and P j is the grayscale value of the background region value point, and M is the number of background region value points; Step 4: Compare the gray difference value obtained in Step 3 with the reference threshold for crack width classification to determine the category of the crack width at the corresponding normal line; the reference threshold for crack width classification includes Grey1 and Grey2, Grey1 = 11.7, Grey2 = 19.0; if the gray difference value Grey < Grey1, it is determined that the crack width category is 0.2 - 0.5 mm; if Grey1 < Grey < Grey2, it is determined that the crack width category is 0.6 mm - 1 mm; if Grey > Grey2, it is determined that the crack width category is > 1 mm.
2. The bridge crack width classification algorithm based on gray difference value according to claim 1, characterized in that: In Step 1, if the number of pixel points on the crack skeleton is less than 200, N is taken as 10; if the number of pixel points on the crack skeleton is greater than 200, N is taken as 40.
Citation Information
Patent Citations
A stepwise refinement detection method for pavement cracks
CA3006240A1
Bridge crack detection method based on dynamic threshold value
CN113592861A