Bridge crack calibration method and device based on computer vision
Through computer vision, the edge profile of the bridge grayscale image is analyzed, the closed profile is screened and its irregularity and coordination is evaluated. The bridge cracks are calibrated using discriminant coefficients, which solves the detection error problem under the influence of complex background and lighting environment, and improves the accuracy and safety of bridge crack detection.
Patent Information
- Application Number
- CN202510678275.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-05-26
AI Technical Summary
In the detection of bridge cracks, complex backgrounds and lighting environments lead to detection errors, affecting the accuracy of bridge safety assessment.
Through computer vision methods, the edge profile of the bridge grayscale image is analyzed, the closed profile is screened, the irregularity and coordination of the edge profile are evaluated, and the bridge cracks are calibrated using discriminant coefficients.
It reduces detection errors, improves the accuracy of bridge crack detection, and ensures safe use of bridges.
Smart Images

Figure CN120198512B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a bridge crack calibration method and device based on computer vision. Background Art
[0002] As vital transportation infrastructure, the safety and durability of bridges are crucial. Over the long term, bridges can develop cracks and other safety hazards due to various factors, including loads, environmental erosion, and material aging. Bridge crack detection is essential to assess bridge safety.
[0003] When visually inspecting cracks on bridges, the complex background on the bridge, such as scratches, marking patterns, and shadows caused by the lighting environment, will interfere with the detection of bridge cracks, resulting in errors in the detection of bridge cracks, affecting the accuracy of bridge crack calibration, and thus leading to inaccurate safety assessment of the bridge. Summary of the Invention
[0004] In order to solve the above technical problems, a bridge crack calibration method and device based on computer vision are provided to solve the existing problems.
[0005] The solution to the technical problem of this application is to provide a bridge crack calibration method and device based on computer vision, including the following steps:
[0006] In a first aspect, an embodiment of the present application provides a bridge crack calibration method based on computer vision, the method comprising the following steps:
[0007] Collect the grayscale image of the bridge and extract all edge contours in the grayscale image;
[0008] Obtain each suspected edge contour through the number of edge pixels in the neighborhood of each edge pixel on each edge contour and the average level of the grayscale values of the pixels within the edge contour;
[0009] Extracting a skeleton line of each edge contour, analyzing similarities of edges of each suspected edge contour on both sides of the skeleton line, and length and width features of each suspected edge contour, and determining a first evaluation value of each suspected edge contour;
[0010] Analyze the deviation of the number of all edge pixels in the neighborhood of each edge pixel on each suspected edge contour, as well as the deviation of the gradient direction of each edge pixel, and calculate the irregularity of each suspected edge contour;
[0011] Calculating the edge coordination degree of each suspected edge contour by using the direction difference of the skeleton line between each suspected edge contour and the other edge contours, and the length deviation of each suspected edge contour, and determining a second evaluation value of each suspected edge contour in combination with the irregularity;
[0012] Based on the first evaluation value and the second evaluation value, a discrimination coefficient of each suspected edge contour is determined, each suspected edge contour is evaluated, and cracks of the bridge are calibrated.
[0013] Preferably, obtaining each suspected edge contour includes:
[0014] Counting the number of all edge pixels in the neighborhood of any edge pixel on each edge contour; if the number is greater than or equal to a preset first value, recording the any edge pixel as an intersection point; if the number is equal to a preset second value, recording the any edge pixel as an endpoint; and recording edge contours in which the number of all endpoints is greater than the number of all intersection points as closed contours;
[0015] The average gray value of all pixels within each closed contour is recorded as the average gray value;
[0016] A segmentation threshold of the average grayscale of all closed contours in the grayscale image is obtained and recorded as a first segmentation threshold; closed contours whose average grayscale is less than the first segmentation threshold are recorded as suspected edge contours.
[0017] Preferably, determining the first evaluation value of each suspected edge contour includes:
[0018] Calculate the aspect ratio of the minimum circumscribed rectangle of each suspected edge contour;
[0019] Segmenting each suspected edge contour into two edge lines using the skeleton line; calculating the similarity between the two edge lines;
[0020] The first evaluation value is the product of the aspect ratio and the similarity level.
[0021] Preferably, the calculating of the irregularity of each suspected edge contour includes:
[0022] Count the number of all edge pixels in the local neighborhood of each edge pixel on each suspected edge contour, and record it as the number of neighborhoods;
[0023] The difference between the number of neighbors of each edge pixel point on each suspected edge contour and the average number of neighbors of all edge pixels points is recorded as the number deviation;
[0024] Calculate the tangent slope of each edge pixel through the gradient of each edge pixel;
[0025] The difference between the tangent slope of each edge pixel point and the mean of the tangent slopes of all other edge pixels in its local neighborhood is recorded as the direction deviation;
[0026] The irregularity is the sum of the products of the quantity deviation and the direction deviation of all edge pixels on each suspected edge contour.
[0027] Preferably, the calculating of the edge coordination degree of each suspected edge contour includes:
[0028] Calculating the direction angle of each edge contour through the skeleton line of each edge contour;
[0029] Expanding the width of the minimum circumscribed rectangle of each suspected edge contour to record it as an expanded area; calculating the cumulative sum of the differences between the direction angles of each suspected edge contour and all other edge contours in the expanded area;
[0030] Obtaining a segmentation threshold of the length of the skeleton line of all edge contours in the grayscale image, recorded as a second segmentation threshold;
[0031] Recording the difference between the length of each suspected edge contour and the second segmentation threshold as a length deviation; performing positive mapping on the length deviation;
[0032] The edge coordination degree is the ratio of the result of the forward mapping to the cumulative sum.
[0033] Preferably, the second evaluation value is the product of the irregularity and the edge coordination.
[0034] Preferably, the discrimination coefficient is a normalized result of the product of the first evaluation value and the second evaluation value.
[0035] Preferably, the evaluating each suspected edge contour includes: if the discrimination coefficient is greater than a preset threshold, it belongs to a crack contour; otherwise, it does not belong to a crack contour.
[0036] Preferably, the calibration of the cracks on the bridge includes: calculating the normal direction of any skeleton point on the skeleton line of the crack contour, searching for edge pixel points on both sides along the normal direction, calculating the distance between the edge pixel points on both sides, and recording it as the width of any skeleton point; selecting the maximum value of the width of all skeleton points on the skeleton line, and using the pinhole camera imaging principle to obtain the maximum width of the crack on the bridge in actual space, and calibrating the cracks on the bridge.
[0037] In a second aspect, an embodiment of the present application also provides a bridge crack calibration device based on computer vision, comprising a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of any one of the above-mentioned computer vision-based bridge crack calibration methods.
[0038] This application has at least the following beneficial effects:
[0039] The present application obtains closed contours by analyzing the bifurcation of edge contours in grayscale images, and obtains closed contours based on the average level of grayscale values of pixels within the closed contours. The beneficial effect of the application is that continuous and closed contours that may be formed by cracks are screened out, and the interference of other edge contours that are not cracks is eliminated. The shape similarity of the edges on both sides of the skeleton line of each suspected edge contour and the aspect ratio of each suspected edge contour are analyzed to determine the first evaluation value of each suspected edge contour. The beneficial effect of the application is that the narrow and long shape of each suspected edge contour and the changing trend of the edges on both sides of the skeleton line are taken into account to preliminarily evaluate the possibility that each suspected edge contour is formed by a crack. Secondly, the number and gradient direction of edge pixels in the neighborhood of each edge pixel point are analyzed to calculate the irregularity of each suspected edge contour. The beneficial effect of the application is that the irregularity of each suspected edge contour is calculated to take into account the bifurcation of the edges on both sides of the skeleton line. The cross situation reflects the irregularity of the suspected edge contour; further, the edge coordination degree of each suspected edge contour is calculated through the consistency of the direction of each suspected edge contour and the directions of other unconnected short cracks that are not completely cracked that appear around it, and the second evaluation value of each suspected edge contour is determined. The beneficial effect is that it takes into account the proximity of the directions of other cracks that appear around it to the direction of the suspected edge contour, and further reflects the possibility that the suspected edge contour is a crack; the discrimination coefficient of each suspected edge contour is determined, and each suspected edge contour is evaluated to calibrate the cracks of the bridge. The beneficial effect is that by capturing the subtle features of the cracks, it can effectively distinguish the real crack contour and the contours formed by other interferences, reduce the detection error of bridge cracks caused by other interferences, improve the accuracy of crack detection on the bridge, and calibrate the bridge cracks more accurately to ensure the safe use of the bridge. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The bridge crack calibration method based on computer vision of the present application is further described in detail below with reference to the accompanying drawings.
[0041] Figure 1 A flowchart of the steps of the bridge crack calibration method based on computer vision provided in an embodiment of the present application;
[0042] Figure 2 A flowchart of the steps of the method for obtaining the irregularity of each suspected edge contour provided in an embodiment of the present application;
[0043] Figure 3 A flowchart of the steps for determining the discriminant coefficient provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] To make the objectives, technical solutions, and advantages of this application more clearly understood, the following describes in further detail the computer vision-based bridge crack calibration method and device proposed in this application, with reference to the accompanying drawings and implementation examples. It should be understood that the specific embodiments described herein are intended only to explain this application and are not intended to limit this application.
[0045] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0046] See also Figure 1 , which shows a flowchart of a bridge crack calibration method based on computer vision provided by an embodiment of the present application, the method comprising the following steps:
[0047] Step 1: Collect a grayscale image of the bridge and extract all edge contours in the grayscale image.
[0048] Bridge images are collected using a drone equipped with a binocular high-definition camera. Since the collected bridge images are affected by lighting, noise, and interference, the bridge images are denoised and grayscaled to remove impurities in the image and obtain a grayscale image of the bridge.
[0049] In this embodiment, a median filtering algorithm is used for denoising, wherein the median filtering algorithm and grayscale processing are well-known technologies and will not be described in detail here. As other implementation methods, the implementer can adopt other methods of the existing technology, such as mean filtering, etc. This embodiment does not impose any special restrictions on this.
[0050] Perform edge detection on the grayscale image and extract all edge contours in the grayscale image;
[0051] In this embodiment, the Canny edge detection algorithm is used for edge detection. The Canny edge detection algorithm is a well-known technology and will not be described in detail here. As other implementation methods, the implementer can adopt other methods of the existing technology, such as the Sobel operator, etc. This embodiment does not impose any special restrictions on this.
[0052] At this point, a grayscale image of the bridge is obtained.
[0053] Step 2: Obtain each suspected edge contour based on the number of edge pixels in the neighborhood of each edge pixel on each edge contour and the average level of the grayscale values of the pixels within the edge contour; extract the skeleton line of each edge contour, analyze the similarity of the edges of each suspected edge contour on both sides of the skeleton line, and the length and width characteristics of each suspected edge contour, and determine the first evaluation value of each suspected edge contour.
[0054] When cracks appear on a bridge, the cracked area in the bridge image will appear as a shadow area that is distinct from other areas due to differences in lighting and shooting angles. Furthermore, if there are damp areas in the bridge image, there may also be some features similar to the shadow area present when the cracks appear, which will interfere with crack detection. However, compared to areas where cracks actually exist, the grayscale values of the pixels in the shadow area formed by factors such as moisture are higher, and the edges of the shadow area formed are somewhat different from the edges of the actual cracks. Secondly, the edge contours corresponding to cracks are generally continuous and closed. By screening closed contours, the interference effects of other factors can be initially eliminated.
[0055] Based on the above analysis, the suspected edge contour in the grayscale image is obtained, specifically:
[0056] Count the number of all edge pixels in the neighborhood of any edge pixel on each edge contour;
[0057] If the number is greater than or equal to a preset first value, any edge pixel point is recorded as an intersection point; if the number is equal to a preset second value, any edge pixel point is recorded as an endpoint; an edge contour whose number of all endpoints is greater than the number of all intersection points is recorded as a closed contour;
[0058] In this embodiment, the number of all edge pixels in the 3×3 neighborhood of any edge pixel on each edge contour is counted; secondly, the first numerical value is preset to be 3, and the second numerical value is preset to be 1. As other implementation methods, the implementer can set it according to actual conditions.
[0059] The edge contours whose number of endpoints is greater than the number of intersections are recorded as closed contours;
[0060] It should be noted that if there are 3 or more edge pixels within the 3×3 neighborhood of any edge pixel point, it means that any edge pixel point is an intersection point; if there is 1 edge pixel point within the 3×3 neighborhood of any edge pixel point, it means that any edge pixel point is an endpoint; and if the number of intersections is greater than or equal to the number of endpoints, it means that the edge contour is a closed edge contour; and when there are no endpoints and the number of intersections is 0, the edge contour is a closed contour without branches; when the number of endpoints is greater than the number of intersections, it means that the edge contour is an open edge contour.
[0061] The average gray value of all pixels within each closed contour is recorded as the average gray value;
[0062] Using a threshold segmentation algorithm, obtaining a segmentation threshold of the average grayscale of all closed contours in the grayscale image, recorded as a first segmentation threshold;
[0063] Recording the closed contour whose average grayscale is less than the first segmentation threshold as a suspected edge contour;
[0064] In this embodiment, the Otsu threshold segmentation algorithm is used to obtain the segmentation threshold, wherein the Otsu threshold segmentation algorithm is a well-known technology and will not be described in detail here. As other implementation methods, the implementer can adopt other methods of the existing technology, such as cross-validation method, etc. This embodiment does not impose any special restrictions on this.
[0065] Furthermore, for the contours corresponding to cracks in the grayscale image, the edge contours caused by cracking are mostly narrow and long, while the edge contours caused by other factors will form different contours according to their respective causes. For example, the edge contour of the shadow formed by the damp area in the grayscale image will have a diffuse shadow feature that spreads outward from the damp center. Therefore, the shape characteristics of the suspected edge contours are analyzed as follows:
[0066] Calculate the aspect ratio of the minimum circumscribed rectangle of each suspected edge contour;
[0067] It should be noted that, the larger the aspect ratio is, the larger the narrow length of the suspected edge profile is, and the greater the possibility that the suspected edge profile is a crack is.
[0068] Secondly, the contour change trends on both sides of the crack in the grayscale image should be similar, while the edge contours corresponding to the moisture factor have symmetry in their diffusion characteristics, but their change trends are different. For example, if the edge contour formed by moisture is an ellipse, the two edge lines are symmetrical, but the bending directions are different, so the change trends of the two edge lines are different. Therefore, by dividing each suspected edge contour into two segments, the similarity of the edge lines is analyzed, specifically:
[0069] Extracting a skeleton line of each edge contour; segmenting each suspected edge contour into two edge lines using the skeleton line;
[0070] It should be noted that the skeleton line extraction process is a well-known technology and will not be described in detail here.
[0071] Calculate the similarity between two edge lines;
[0072] In this embodiment, a shape context algorithm is used to calculate the similarity between two edge lines. The shape context algorithm is a well-known technology and will not be described in detail here.
[0073] It should be noted that if two edge lines are formed due to cracks, then the change trends of the two edge lines should be highly similar. The greater the similarity, the more likely the suspected edge contour is a crack.
[0074] Furthermore, based on the aspect ratio and the similarity, a first evaluation value is determined to preliminarily evaluate the possibility that the suspected edge contour is a crack, specifically:
[0075] taking the product of the aspect ratio and the similarity as a first evaluation value of each suspected edge contour;
[0076] It should be noted that, the larger the first evaluation value is, the more likely the suspected edge contour is caused by a crack.
[0077] At this point, the first evaluation value of each suspected edge contour is obtained.
[0078] Step 3: Analyze the deviation of the number of all edge pixels in the neighborhood of each edge pixel point on each suspected edge contour, as well as the deviation of the gradient direction of each edge pixel point, and calculate the irregularity of each suspected edge contour; use the direction difference of the skeleton line between each suspected edge contour and the other edge contours, as well as the length deviation of each suspected edge contour to calculate the edge coordination degree of each suspected edge contour, and combine the irregularity to determine the second evaluation value of each suspected edge contour.
[0079] Furthermore, for cracks on the bridge body, there will be some small cracks in other directions along the main cracking direction during the cracking process. These small cracks are the unique irregular features of cracks, and the contour interference such as the pattern in the bridge image will not show this feature. Therefore, the bifurcation formed by the cracking of each suspected edge contour in the grayscale image is analyzed and the irregularity is calculated. The step flow chart of the method for obtaining the irregularity of each suspected edge contour provided in the embodiment of the present application is as follows: Figure 2 As shown, specifically including:
[0080] Count the number of all edge pixels in the local neighborhood of each edge pixel on each suspected edge contour, and record it as the number of neighborhoods of each edge pixel;
[0081] In this embodiment, the number of all edge pixels within a 5×5 neighborhood of each edge pixel on each suspected edge contour is counted, and recorded as the number of neighborhoods of each edge pixel.
[0082] Calculate the average of the number of neighborhoods of all edge pixels on each suspected edge contour, and record it as the average number;
[0083] The difference between the number of the neighborhood of each edge pixel point on each suspected edge contour and the average number is recorded as the number deviation;
[0084] In this embodiment, the absolute value of the difference between the number of neighborhood pixels of each edge pixel point on each suspected edge contour and the average number is recorded as the number deviation.
[0085] Calculate the tangent slope of each edge pixel point through the gradient of each edge pixel point on each suspected edge contour;
[0086] It should be noted that the acquisition of the gradient of edge pixels and the process of calculating the tangent slope through the gradient are both well-known technologies and will not be repeated here. In this embodiment, the tangent slope of each edge pixel is measured by the ratio of the gradient of each edge pixel in the Y direction to the gradient in the X direction.
[0087] The average of the tangent slopes of all other edge pixels in the local neighborhood of each edge pixel on each suspected edge contour is recorded as the average slope;
[0088] In this embodiment, the average value of the tangent slopes of all other edge pixels in a 5×5 neighborhood of each edge pixel on each suspected edge contour is recorded as the average slope.
[0089] The difference between the tangent slope of each edge pixel point on each suspected edge contour and the average slope is recorded as the direction deviation;
[0090] In this embodiment, the absolute value of the difference between the tangent slope of each edge pixel point on each suspected edge contour and the average slope is recorded as the direction deviation.
[0091] The sum of the products of the quantity deviation and the direction deviation of all edge pixels on each suspected edge contour is used as the irregularity of each suspected edge contour;
[0092] In this embodiment, the calculation formula for the irregularity of each suspected edge contour is:
[0093]
[0094] in, For the The irregularity of the suspected edge contour, For the The number deviation of the edge pixels on the suspected edge contour, For the The first on the suspected edge contour The direction deviation of edge pixels, For the The number of all edge pixels on a suspected edge contour.
[0095] It should be noted that, the larger the quantitative deviation, the greater the difference in edge pixels contained in the local neighborhood of different edge pixel points, which means that there are more intersections on the suspected edge contour; secondly, the larger the directional deviation, the greater the directional difference of the remaining edge pixel points in the local neighborhood of each edge pixel point, which means that there is a bifurcation on the suspected edge contour, and the greater the resulting irregularity, the more irregular the suspected edge contour is, and the more consistent it is with other small cracks caused by crack splitting and the irregular characteristics of cracks, and the greater the possibility that the suspected edge contour is a crack.
[0096] Secondly, cracks can cause other short, incomplete cracks to appear around the bridge body that are not connected to the cracks. These cracks have directions similar to the cracks, but the interference of the corresponding edge contours on the bridge pattern will not produce these characteristics. Therefore, we analyze whether there are a large number of cracks with directions similar to the cracks around each suspected edge contour to determine whether each suspected edge contour is a crack edge and calculate the edge coordination degree. Specifically,
[0097] Calculating the direction angle of each edge contour through the skeleton line of each edge contour;
[0098] It should be noted that the direction angle can be obtained by the angle between the skeleton line and the horizontal direction of the image to obtain the direction angle of each edge contour.
[0099] The width of the minimum circumscribed rectangle of each suspected edge contour is expanded and recorded as the expanded area;
[0100] In this embodiment, the width of the minimum circumscribed rectangle of each suspected edge contour is expanded using the width as the expansion size. Therefore, the width of the rectangle can be expanded to twice the original width on both sides. As other implementation methods, the implementer can set it according to actual conditions.
[0101] Calculating the cumulative sum of differences between the direction angle of each suspected edge contour and the direction angles of all other edge contours within the dilated area;
[0102] In this embodiment, the cumulative sum of the absolute values of the differences between the direction angles of each suspected edge contour and the direction angles of all other edge contours in the expansion region is calculated.
[0103] Obtaining a segmentation threshold of the length of the skeleton line of all edge contours in the grayscale image, recorded as a second segmentation threshold;
[0104] In this embodiment, the Otsu threshold segmentation algorithm is used to obtain the segmentation threshold, wherein the Otsu threshold segmentation algorithm is a well-known technology and will not be described in detail here. As other implementation methods, the implementer can adopt other methods of the existing technology, such as cross-validation method, etc. This embodiment does not impose any special restrictions on this.
[0105] Recording the difference between the length of each suspected edge contour and the second segmentation threshold as length deviation;
[0106] In this embodiment, the difference between the length of each suspected edge contour and the second segmentation threshold is recorded as the length deviation.
[0107] Performing positive mapping on the length deviation; and using the ratio of the positive mapping result to the accumulated sum as the edge coordination degree of each suspected edge contour;
[0108] In this embodiment, when performing positive mapping, an exponential function is used to perform positive mapping on the length deviation, and the length deviation is recorded as ,Will The result of the positive mapping is as follows, where It is an exponential function with a natural constant as the base; since the length deviation may be a negative number, the length deviation is positively mapped so that the result of the positive mapping is greater than 0.
[0109] It should be noted that the larger the length deviation, the more likely the suspected edge contour is an edge contour formed by a crack. The smaller the cumulative sum, the more likely the direction of other cracks that are not completely cracked appearing near the suspected edge contour is close to the direction of the suspected edge contour. The greater the obtained edge synergy, the greater the possibility that the suspected edge contour is a crack.
[0110] Further, based on the irregularity and the edge coordination, a second evaluation value is determined, specifically:
[0111] The product of the irregularity and the edge coordination is used as a second evaluation value of each suspected edge contour;
[0112] It should be noted that, the larger the second evaluation value is, the more likely the suspected edge contour is a crack.
[0113] At this point, the second evaluation value of each suspected edge contour is obtained.
[0114] Step 4: Based on the first evaluation value and the second evaluation value, determine the discrimination coefficient of each suspected edge contour, evaluate each suspected edge contour, and calibrate the cracks of the bridge.
[0115] Based on the above analysis, the discrimination coefficient is calculated using the first evaluation value and the second evaluation value to assess the likelihood that each suspected edge contour is a bridge crack. Specifically, the discrimination coefficient is:
[0116] Normalizing the product of the first evaluation value and the second evaluation value as the discrimination coefficient of each suspected edge contour;
[0117] In this embodiment, the sigmoid function is used for normalization processing, wherein the sigmoid function is a well-known technology and will not be described in detail here. As other implementation methods, the implementer can adopt other methods of the existing technology, such as the tanh function, etc. This embodiment does not impose any special restrictions on this.
[0118] It should be noted that the larger the discrimination coefficient is, the greater the possibility that the suspected edge contour is a real crack. The flowchart of the discrimination coefficient step provided in the embodiment of the present application is as follows: Figure 3 shown.
[0119] If the discrimination coefficient of each suspected edge contour in the grayscale image is greater than a preset threshold, the suspected edge contour belongs to a crack contour; otherwise, the suspected edge contour does not belong to a crack contour;
[0120] In this embodiment, the preset threshold value is 0.8. As for other implementation methods, the implementer can set it according to actual conditions.
[0121] Calculating the normal direction of any skeleton point on the skeleton line of the crack outline in the grayscale image, searching for edge pixels on both sides along the normal direction, calculating the distance between the edge pixels on both sides, recording it as the width of any skeleton point, and taking the maximum value of the widths of all skeleton points on the skeleton line as the maximum width of the crack outline;
[0122] Utilizing the pinhole camera imaging principle, the conversion relationship between the camera pixel coordinate system and the camera coordinate system is determined according to the camera's intrinsic and extrinsic parameters. The maximum width of the crack outline in the grayscale image is proportionally converted in the actual space through the distance between a single pixel point and the actual space, thereby obtaining the maximum width of the crack on the bridge in the actual space. The cracks on the bridge are then calibrated.
[0123] Based on the same inventive concept as the above method, an embodiment of the present application also provides a bridge crack calibration device based on computer vision, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of any one of the above-mentioned bridge crack calibration methods based on computer vision.
[0124] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0125] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0126] The above-described embodiments merely represent several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the present application. It should be noted that a person skilled in the art can make a number of modifications and improvements without departing from the concept of the present application. Therefore, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application shall fall within the scope of protection of the technical solution of the present application.
Claims
1. A bridge crack calibration method based on computer vision, characterized in that: The method comprises the following steps: Collect the grayscale image of the bridge and extract all edge contours in the grayscale image; Obtain each suspected edge contour through the number of edge pixels in the neighborhood of each edge pixel on each edge contour and the average level of the grayscale values of the pixels within the edge contour; Extracting a skeleton line of each edge contour, analyzing similarities of edges of each suspected edge contour on both sides of the skeleton line, and length and width features of each suspected edge contour, and determining a first evaluation value of each suspected edge contour; Analyze the deviation of the number of all edge pixels in the neighborhood of each edge pixel on each suspected edge contour, as well as the deviation of the gradient direction of each edge pixel, and calculate the irregularity of each suspected edge contour; Calculating the edge coordination degree of each suspected edge contour by using the direction difference of the skeleton line between each suspected edge contour and the other edge contours, and the length deviation of each suspected edge contour, and determining a second evaluation value of each suspected edge contour in combination with the irregularity; Based on the first evaluation value and the second evaluation value, a discrimination coefficient of each suspected edge contour is determined, each suspected edge contour is evaluated, and cracks of the bridge are calibrated.
2. The bridge crack calibration method based on computer vision according to claim 1, characterized in that: The obtaining of each suspected edge contour includes: Counting the number of all edge pixels in the neighborhood of any edge pixel on each edge contour; if the number is greater than or equal to a preset first value, recording the any edge pixel as an intersection point; if the number is equal to a preset second value, recording the any edge pixel as an endpoint; and recording edge contours in which the number of all endpoints is greater than the number of all intersection points as closed contours; The average gray value of all pixels within each closed contour is recorded as the average gray value; A segmentation threshold of the average grayscale of all closed contours in the grayscale image is obtained and recorded as a first segmentation threshold; closed contours whose average grayscale is less than the first segmentation threshold are recorded as suspected edge contours.
3. The bridge crack calibration method based on computer vision according to claim 1, characterized in that: Determining a first evaluation value of each suspected edge contour includes: Calculate the aspect ratio of the minimum circumscribed rectangle of each suspected edge contour; Segmenting each suspected edge contour into two edge lines using the skeleton line; calculating the similarity between the two edge lines; The first evaluation value is the product of the aspect ratio and the similarity level.
4. The bridge crack calibration method based on computer vision according to claim 1, characterized in that: The calculating of the irregularity of each suspected edge contour includes: Count the number of all edge pixels in the local neighborhood of each edge pixel on each suspected edge contour, and record it as the number of neighborhoods; The difference between the number of neighbors of each edge pixel point on each suspected edge contour and the average number of neighbors of all edge pixels points is recorded as the number deviation; Calculate the tangent slope of each edge pixel through the gradient of each edge pixel; The difference between the tangent slope of each edge pixel point and the mean of the tangent slopes of all other edge pixels in its local neighborhood is recorded as the direction deviation; The irregularity is the sum of the products of the quantity deviation and the direction deviation of all edge pixels on each suspected edge contour.
5. The bridge crack calibration method based on computer vision according to claim 1, characterized in that: Calculating the edge coordination degree of each suspected edge contour includes: Calculating the direction angle of each edge contour through the skeleton line of each edge contour; Expanding the width of the minimum circumscribed rectangle of each suspected edge contour to record it as an expanded area; calculating the cumulative sum of the differences between the direction angles of each suspected edge contour and all other edge contours in the expanded area; Obtaining a segmentation threshold of the length of the skeleton line of all edge contours in the grayscale image, recorded as a second segmentation threshold; Recording the difference between the length of each suspected edge contour and the second segmentation threshold as a length deviation; performing positive mapping on the length deviation; The edge coordination degree is the ratio of the result of the forward mapping to the accumulated sum.
6. The bridge crack calibration method based on computer vision according to claim 1, characterized in that: The second evaluation value is the product of the irregularity and the edge coordination.
7. The bridge crack calibration method based on computer vision according to claim 1, characterized in that: The discrimination coefficient is a normalized result of the product of the first evaluation value and the second evaluation value.
8. The bridge crack calibration method based on computer vision according to claim 1, characterized in that: The evaluation of each suspected edge contour includes: if the discrimination coefficient is greater than a preset threshold, it belongs to a crack contour; otherwise, it does not belong to a crack contour.
9. The bridge crack calibration method based on computer vision according to claim 8, characterized in that: The bridge crack calibration includes: calculating the normal direction of any skeleton point on the skeleton line of the crack outline, searching for edge pixel points on both sides along the normal direction, calculating the distance between the edge pixel points on both sides, and recording it as the width of the any skeleton point; selecting the maximum width of all skeleton points on the skeleton line, and using the pinhole camera imaging principle to obtain the maximum width of the crack on the bridge in actual space, and calibrating the bridge crack.
10. A bridge crack calibration device based on computer vision, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the bridge crack calibration method based on computer vision as described in any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Bridge crack detection method and system
CN117237368A
Bridge workpiece machining track generation method, device, equipment, medium and product
CN119067938A