Method and system for detecting maximum crack width in building structures based on machine vision

By binarizing and dividing the surface image of the building structure into contour segments, combining the nearest neighbor search algorithm to calibrate the crack direction, and calculating and comparing the crack width values, the problems of large errors and low efficiency in building structure crack detection in the existing technology are solved, and efficient and accurate maximum crack width measurement is achieved.

CN120318230BActive Publication Date: 2025-09-19EAST CHINA JIAOTONG UNIVERSITY +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510796464.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-16
Publication Date
2025-09-19
Estimated Expiration
2045-06-16

AI Technical Summary

Technical Problem

Existing technologies for detecting cracks in building structures suffer from large errors, low efficiency, and difficulty in achieving large-scale rapid screening. Especially when dealing with complex engineering scenarios, the measurement direction is inconsistent with the actual physical direction, leading to systematic errors.

Method used

Image acquisition equipment is used to capture images of the building surface, construct a binary image, and extract the crack contours, dividing them into multiple segments. A nearest neighbor search algorithm is used to calibrate the extension and width of each segment, calculate the crack width, and compare the widths of each segment to determine the maximum crack width.

Benefits of technology

The consistency between the crack measurement direction and the actual physical direction is achieved, which reduces systematic errors, improves the robustness and accuracy of detection, and can quickly and accurately measure the maximum crack width of building structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120318230B_ABST
    Figure CN120318230B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for detecting the maximum crack width of a building structure based on machine vision, which relates to the field of image processing technology. The method obtains a surface image of a building structure through an image acquisition device, constructs a binary image corresponding to the surface image, and extracts the crack contour of the building structure based on the binary image. The crack contour is then divided into multiple contour segments, a crack width value is calculated for each contour segment, and finally the crack width value of each contour segment is compared to determine the maximum crack width of the crack in the building structure, thereby achieving measurement and positioning of the maximum crack width. This embodiment can make the crack measurement direction consistent with the actual physical direction, reduce systematic errors, have high robustness, and can quickly and accurately measure the maximum crack width of the building structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method and system for detecting the maximum crack width of a building structure based on machine vision. Background Art

[0002] Traditional building crack detection relies primarily on manual visual inspection or simple tools (such as crack cards and microscopes) for measurement. Manual interpretation is subject to subjective experience, ambient lighting, and viewing angle, making it difficult to accurately quantify crack widths. This is especially true for hairline cracks less than 0.1 mm, where the error rate can reach over 30%. Furthermore, manual point-by-point measurement is time-consuming and labor-intensive, poses safety risks in high-altitude and hidden areas, and is incapable of rapid screening of large structures.

[0003] While existing machine vision-based methods have partially replaced manual labor, they are still limited to simple edge detection or threshold segmentation techniques. These methods are sensitive to lighting variations and background noise (such as stains and graffiti), leading to missed or false detections. For example, the traditional Canny operator is prone to extracting false edges in complex backgrounds, while U-Net-based segmentation models fail to adequately handle the continuity of long and narrow cracks, resulting in broken contours or over-segmentation, which directly affects the accuracy of subsequent width calculations.

[0004] Most machine vision methods estimate crack width directly based on pixel distance, without considering the crack's extension direction and local deformation. For example, algorithms based on projection or minimum enclosing rectangles assume that the crack's orientation is aligned with the image coordinate system. However, when the actual image is taken at an angle or the crack's distribution is winding, the measured orientation deviates from the true physical orientation, introducing systematic errors (typical deviations exceeding 0.2 mm).

[0005] Furthermore, existing research lacks the ability to dynamically fuse multi-source data. Analysis of a single image fails to capture the spatiotemporal evolution of cracks, while traditional PCA methods fail to incorporate contour geometry when calibrating principal directions, resulting in inaccurate width-wise calibration. These issues limit the algorithm's application in complex engineering scenarios, such as tunnel linings and bridge cracks. A directionally adaptive and highly robust measurement framework is urgently needed. Summary of the Invention

[0006] In view of the deficiencies in the prior art, the purpose of the present invention is to provide a method and system for detecting the maximum crack width of a building structure based on machine vision, aiming to solve the above-mentioned problems recorded in the prior art.

[0007] A first aspect of the present invention is to provide a method for detecting the maximum crack width of a building structure based on machine vision, the method comprising:

[0008] Capturing a surface image of a building structure where cracks occur by a preset image acquisition device, constructing a binary image of the surface image, extracting a crack contour based on the binary image, and dividing the crack contour into a plurality of contour segments;

[0009] According to the crack contour data of each contour segment, the first contour line and the second contour line of the contour segment are calibrated in the extension direction and the width direction respectively, and the main direction and the vertical direction of the first contour line and the second contour line are determined;

[0010] Projecting each contour point in the first contour line onto a preset coordinate axis according to the main direction and the perpendicular direction, and using a nearest neighbor search algorithm to search for the coordinates of the second contour point closest to each first contour point in the main direction of the first contour segment in the perpendicular direction of the second contour segment, to obtain a set of nearest neighbor points corresponding to all first contour points;

[0011] Determine the corresponding vertical coordinate value based on the horizontal coordinate value of each first contour point on the first contour segment, subtract the vertical coordinate value corresponding to each second contour point in the nearest neighbor point set corresponding to the first contour point, obtain a coordinate vector of the two vertical coordinate values, and calculate the crack width value between the first contour point on the first contour line and the second contour point on the second contour line of the contour segment;

[0012] The crack width values ​​of all contour segments are compared to determine the maximum crack width, and the corresponding coordinate vector is reversely searched. The point on the corresponding crack contour is found according to the coordinate vector to achieve the measurement and positioning of the maximum crack width of the building structure.

[0013] According to one aspect of the above technical solution, the steps of capturing a surface image of a building structure having cracks using a preset image acquisition device, constructing a binary image of the surface image, extracting a crack contour based on the binary image, and dividing the crack contour into a plurality of contour segments include:

[0014] Capturing images of the surface of the building structure using a preset image acquisition device to obtain a surface image of the building structure where cracks occur;

[0015] Dilate and erode the surface image to obtain a binary image corresponding to the surface image;

[0016] Extracting a crack contour using a Canny operator based on the binary image to determine an outer edge of the contour; wherein the crack contour is a connected domain of the crack, and the outer edge of the crack contour includes a first contour line and a second contour line on both sides of an extension direction of the connected domain;

[0017] The crack contour is divided according to preset indicators to obtain a plurality of mutually independent contour segments.

[0018] According to one aspect of the above technical solution, the step of dividing the crack profile according to preset indicators to obtain a plurality of mutually independent profile segments includes:

[0019] Fitting the extracted crack profile with a high-order polynomial, and calculating the curvature of the high-order polynomial at different points of the crack profile;

[0020] Based on a preset curvature threshold, the crack contour is divided into multiple segments to obtain multiple independent contour segments.

[0021] According to one aspect of the above technical solution, the method further includes:

[0022] A crack cloud image corresponding to the crack contour is created according to the crack contour.

[0023] According to one aspect of the above technical solution, the step of creating a crack cloud map corresponding to the crack contour according to the crack contour includes:

[0024] Acquire a binary image obtained by dilation and erosion, identify a crack region in the binary image, use the crack region as a drawing domain of a crack cloud map, and obtain a coordinate set of the drawing points;

[0025] The set of nearest neighbor points of each drawing point in the coordinate set is searched and obtained, the second-order norm of the pointing vector is calculated, the minimum inscribed circle radius is searched and obtained, and the crack cloud map is drawn according to the size of the minimum inscribed circle radius.

[0026] According to one aspect of the above technical solution, the steps of searching for a set of nearest neighbor points of each drawing point in a coordinate set, calculating a second-order norm of a pointing vector, searching for a minimum inscribed circle radius, and drawing a crack cloud map according to the size of the minimum inscribed circle radius include:

[0027] Project each drawing point in the coordinate set and all contour points in any direction to obtain the first random projection point of the current point, the second random projection point of the first contour point, and the third random projection point of the second contour point;

[0028] Project the first random projection point, the second random projection point, and the third random projection point in a direction perpendicular to the current projection direction to obtain a first vertical projection point, a second vertical projection point, and a third vertical projection point, respectively;

[0029] Use the bisection method to search for the nearest neighbor points of the first random projection point and the first vertical projection point in multiple groups of projection points, and select one adjacent point forward and one adjacent point backward as the minimum radius of the search point set based on the search results;

[0030] Traversing all the points to be searched in the set of points to be searched, deriving a pointing vector toward the point to be searched from any drawn point and calculating the second-order norm, and finding the minimum inscribed circle radius of the minimum value;

[0031] Traverse all the drawing points, calculate the minimum inscribed circle radius corresponding to all the drawing points, and set different colors according to the size of the minimum inscribed circle radius to draw the crack cloud map.

[0032] A second aspect of the present invention is to provide a machine vision-based maximum crack width detection system for building structures, which is applied to the method described in the above technical solution. The system comprises:

[0033] an image processing module, configured to acquire a surface image of a building structure having cracks by using a preset image acquisition device, construct a binary image of the surface image, extract a crack contour based on the binary image, and divide the crack contour into a plurality of contour segments;

[0034] a direction calibration module, configured to calibrate the extension direction and width direction of the first contour line and the second contour line of each contour segment according to the crack contour data of the contour segment, and determine the main direction and the vertical direction of the first contour line and the second contour line;

[0035] a neighbor point search module, configured to project each contour point in the first contour line onto a preset coordinate axis according to a main direction and a vertical direction, and use a nearest neighbor search algorithm to search for the coordinates of the second contour point closest to each first contour point in the main direction of the first contour segment in the vertical direction of the second contour segment, to obtain a set of nearest neighbor points corresponding to all first contour points;

[0036] a width calculation module, configured to determine a corresponding vertical coordinate value based on the horizontal coordinate value of each first contour point on the first contour segment, subtract the vertical coordinate value corresponding to each second contour point in the nearest neighbor point set corresponding to the first contour point, obtain a coordinate vector of the two vertical coordinate values, and calculate a crack width value between the first contour point on the first contour line and the second contour point on the second contour line of the contour segment;

[0037] The width comparison module is used to compare the crack width values ​​of all contour segments, determine the maximum crack width, and reversely search for the corresponding coordinate vector. According to the coordinate vector, the point on the corresponding crack contour is found to achieve the measurement and positioning of the maximum crack width of the building structure.

[0038] According to one aspect of the above technical solution, the image processing module is specifically used to:

[0039] Capturing images of the surface of the building structure using a preset image acquisition device to obtain a surface image of the building structure where cracks occur;

[0040] Dilate and erode the surface image to obtain a binary image corresponding to the surface image;

[0041] Extracting a crack contour using a Canny operator based on the binary image to determine an outer edge of the contour; wherein the crack contour is a connected domain of the crack, and the outer edge of the crack contour includes a first contour line and a second contour line on both sides of an extension direction of the connected domain;

[0042] The crack contour is divided according to preset indicators to obtain a plurality of mutually independent contour segments.

[0043] A third aspect of the present invention is to provide a readable storage medium having a computer program stored thereon, which implements the method described in the above technical solution when executed by a processor.

[0044] The fourth aspect of the present invention is to provide an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the above technical solution when executing the computer program.

[0045] Compared with the prior art, the method and system for detecting the maximum crack width of a building structure based on machine vision shown in the present invention have the following beneficial effects:

[0046] The present invention obtains a surface image of a building structure through an image acquisition device, constructs a binary image corresponding to the surface image, extracts the crack outline of the building structure based on the binary image, then divides the crack outline into multiple outline segments, calculates the crack width value for each outline segment, and finally compares the crack width value of each outline segment to determine the maximum crack width of the building structure crack, thereby achieving measurement and positioning of the maximum crack width. The present invention can make the crack measurement direction consistent with the real physical direction, reduce systematic errors, have high robustness, and can quickly and accurately measure the maximum crack width of the building structure. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments with reference to the accompanying drawings, in which:

[0048] Figure 1 Schematic diagram of a flow chart of a method for detecting the maximum crack width of a building structure based on machine vision in one embodiment of the present invention;

[0049] Figure 2 is a surface image of a building structure in one embodiment of the present invention;

[0050] Figure 3A binary image constructed based on a surface image in one embodiment of the present invention;

[0051] Figure 4 A crack contour determined based on a binary image in one embodiment of the present invention;

[0052] Figure 5 This is a structural block diagram of a system for detecting the maximum crack width of a building structure based on machine vision in one embodiment of the present invention. DETAILED DESCRIPTION

[0053] To make the objectives, features, and advantages of the present invention more readily apparent, the following detailed description of specific embodiments of the present invention is provided in conjunction with the accompanying drawings. The accompanying drawings illustrate several embodiments of the present invention. However, the present invention may be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and comprehensive understanding of the present invention.

[0054] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be an intermediate element. When an element is referred to as being "connected to" another element, it may be directly connected to the other element or there may be an intermediate element. The terms "vertical," "horizontal," "left," "right," and similar expressions used herein are for illustrative purposes only.

[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one skilled in the art to which this invention pertains. The terms used in this specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0056] Example 1

[0057] See also Figure 1-Figure 4 The first embodiment of the present invention provides a method for detecting the maximum crack width of a building structure based on machine vision. In this embodiment, the method includes steps S10 to S50:

[0058] Step S10 , capturing a surface image of a building structure with cracks by a preset image capturing device, constructing a binary image of the surface image, extracting a crack contour based on the binary image, and dividing the crack contour into a plurality of contour segments.

[0059] First of all, it should be noted that building structures include the surfaces of various building components such as concrete structures, masonry structures, and steel structures, with a focus on common crack types such as hairline cracks, through cracks, and diagonal cracks. This embodiment takes the tunnel lining of a subway as an example. When the subway train is not in operation, the building structure is continuously scanned by an image acquisition device integrated on the detection vehicle to obtain a scanned image, which is then cropped according to a preset size to obtain multiple scanned images. The scanned images of the building structure with cracks on the surface are screened out, that is, the surface image is obtained.

[0060] After the surface image is acquired, it is expanded and eroded to output a binary image corresponding to the surface image, that is, a black and white image. The grayscale value of any pixel in the image is 0 or 255, representing black and white respectively.

[0061] More specifically, the black area in the binary image is determined to be the surface area of ​​the building structure. In the binary image, the black area includes at least one connected domain, or it can be multiple independent connected domains. Then, the white area in the black area is determined to be the crack area of ​​the building structure, so that the crack contour of the crack can be extracted according to the binary image, and the crack contour is divided into multiple contour segments according to a preset curvature threshold. Specifically, the division is performed according to the curvature of the crack contour according to the preset curvature threshold and combined with the trend of the crack contour. For example, the crack contour is divided into 3 segments, 5 segments, etc., and then the maximum crack width is detected for all contour segments, including maximum width detection and position detection.

[0062] In this embodiment, the steps of capturing a surface image of a building structure having cracks by a preset image acquisition device, constructing a binary image of the surface image, extracting a crack contour based on the binary image, and dividing the crack contour into a plurality of contour segments include:

[0063] Capturing images of the surface of the building structure using a preset image acquisition device to obtain a surface image of the building structure where cracks occur;

[0064] Dilate and erode the surface image to obtain a binary image corresponding to the surface image;

[0065] Extracting a crack contour using a Canny operator based on the binary image to determine an outer edge of the contour; wherein the crack contour is a connected domain of the crack, and the outer edge of the crack contour includes a first contour line and a second contour line on both sides of an extension direction of the connected domain;

[0066] The crack contour is divided according to preset indicators to obtain a plurality of mutually independent contour segments.

[0067] The step of dividing the crack profile according to preset indicators to obtain a plurality of mutually independent profile segments includes:

[0068] Fitting the extracted crack profile with a high-order polynomial, and calculating the curvature of the high-order polynomial at different points of the crack profile;

[0069] Based on a preset curvature threshold, the crack contour is divided into multiple segments to obtain multiple independent contour segments.

[0070] Specifically, after the surface image is subjected to dilation and erosion operations, a binary image of the crack will be obtained. The crack contour is extracted using the Canny operator to obtain the outer edge of the crack. Then, the principal direction of crack development (PCA) is determined. The extension direction of the crack is the principal direction of development, so the width direction is the vertical direction. Further considering the development direction of the crack at different positions, a segmented principal direction calibration method is proposed for calibration.

[0071] More specifically, the extracted crack profile is fitted with a high-order polynomial to obtain a high-order polynomial describing the complex line. and ,in is the horizontal axis, and For the unknown coefficients, calculate the curvature of the high-order polynomial at different points, based on the formula Calculation is performed by setting a curvature threshold so that the contour is broken into multiple segments when the curvature exceeds the threshold, thereby obtaining multiple contour segments.

[0072] Step S20 , based on the crack contour data of each contour segment, calibrate the extension direction and width direction of the first contour line and the second contour line of the contour segment respectively, and determine the main direction and vertical direction of the first contour line and the second contour line.

[0073] In this embodiment, the processing of each contour segment includes:

[0074] a) Contour coordinate data centering

[0075] First, obtain the positions of all pixels in all contour segments in the rectangular coordinate system of the image and calculate their coordinate centers: ,in is the coordinate of the i-th contour point. The coordinate centering calculation of all pixel points is: ,in is the decentralized coordinate point.

[0076] b) Calculate the covariance matrix

[0077] Covariance matrix C calculation method: , which describes the distribution differences of data points in various directions.

[0078] c) Perform singular value decomposition on the covariance matrix

[0079] The decomposition formula is , and obtain the eigenvalues and eigenvectors , where the eigenvector corresponding to the largest eigenvalue is Indicates the main direction of crack development, the eigenvector corresponding to the minimum eigenvalue Indicates the vertical direction of the crack.

[0080] Step S30: Project each contour point in the first contour line onto the preset coordinate axis according to the main direction and the vertical direction, and use the nearest neighbor search algorithm to search for the coordinates of the second contour point closest to each first contour point in the main direction of the first contour segment in the vertical direction of the second contour segment to obtain the nearest neighbor point set corresponding to all first contour points.

[0081] Specifically, each point on the contour is projected onto the main direction of the coordinate axis and width direction Above, the projection formula: , where the projection coordinates of the main directions are , the projection coordinates in the width direction are: , the main direction coordinates after projection Indicates the position along the crack extension direction, width direction coordinate Indicates the offset of the point along the width direction.

[0082] Step S40: Determine the corresponding vertical coordinate value based on the horizontal coordinate value of each first contour point on the first contour segment, subtract the vertical coordinate value corresponding to each second contour point in the nearest neighbor point set corresponding to the first contour point, obtain the coordinate vector of the two vertical coordinate values, and calculate the crack width value between the first contour point on the first contour line and the second contour point on the second contour line of the contour segment.

[0083] Specifically, the nearest neighbor search searches for the coordinates of the nearest neighbor of each projection point in the main direction in the perpendicular direction of another contour, including:

[0084] a) Project the points of the first contour line and the second contour line according to the main direction Sort to get an ordered array: ;

[0085] b) Use bisection to find the nearest neighbor: for a point in the first contour line ,exist Use binary search to find the insertion position idx, and check the The coordinate points are included in In the set of nearest neighbor points, the point The coordinate set of the nearest neighbor points is: ,in Generally, 2 or 3 are selected.

[0086] c) Calculate the nearest neighbor set for all points on the first contour line and obtain the nearest neighbor set table of all points on the first contour line.

[0087] Furthermore, for each point in the first contour line , find the point corresponding to its projection in the vertical direction , minus each point in the set of nearest neighbors of the point Corresponding to the projection coordinate in the vertical direction , get the direction The pointing vector of the vector is calculated as the second-order norm of the vector, which is the width of the crack at the current corresponding point, as shown in the following formula .

[0088] In step S50, the crack width values ​​of all contour segments are compared to determine the maximum crack width, and the corresponding coordinate vector is reversely searched. The point on the corresponding crack contour is searched according to the coordinate vector to measure and locate the maximum crack width of the building structure.

[0089] Specifically, each crack width value is compared with The vector creates a corresponding relationship between the crack scanning width and obtains a corresponding set of crack corresponding widths and nearest neighbor vectors of all points on the first contour line.

[0090] Then, the crack widths of all contour segments are searched to find the maximum crack width, and the corresponding vector is obtained. The points on the original contour corresponding to the two points on the vector are found to achieve the measurement and positioning of the crack with the maximum width.

[0091] Compared with the prior art, the method for detecting the maximum crack width of a building structure based on machine vision shown in this embodiment has the following beneficial effects:

[0092] This embodiment acquires a surface image of a building structure through an image acquisition device, constructs a binary image corresponding to the surface image, and extracts the crack outline of the building structure based on the binary image. The crack outline is then divided into multiple contour segments, a crack width value is calculated for each contour segment, and finally the crack width values ​​of each contour segment are compared to determine the maximum crack width of the cracks in the building structure, thereby achieving measurement and positioning of the maximum crack width. This embodiment can make the crack measurement direction consistent with the actual physical direction, reduce systematic errors, have high robustness, and can quickly and accurately measure the maximum crack width of the building structure.

[0093] Example 2

[0094] To further improve the visualization of crack width, the Cross-Nest method is proposed to draw a crack width cloud map for each point in the crack area, thereby improving the search efficiency of the original geometric position. The second embodiment of the present invention also provides a method for detecting the maximum crack width of a building structure based on machine vision. The method shown in this embodiment is basically similar to the method shown in the first embodiment, except that:

[0095] In this embodiment, the method further includes:

[0096] A crack cloud image corresponding to the crack contour is created according to the crack contour.

[0097] The step of creating a crack cloud map corresponding to the crack contour according to the crack contour includes:

[0098] Acquire a binary image obtained by dilation and erosion, identify a crack region in the binary image, use the crack region as a drawing domain of a crack cloud map, and obtain a coordinate set of the drawing points;

[0099] The set of nearest neighbor points of each drawing point in the coordinate set is searched and obtained, the second-order norm of the pointing vector is calculated, the minimum inscribed circle radius is searched and obtained, and the crack cloud map is drawn according to the size of the minimum inscribed circle radius.

[0100] Furthermore, searching for a set of nearest neighbor points of each drawing point in the coordinate set, calculating the second-order norm of the pointing vector, searching for a minimum inscribed circle radius, and drawing a crack cloud map according to the size of the minimum inscribed circle radius include:

[0101] Project each drawing point in the coordinate set and all contour points in any direction to obtain the first random projection point of the current point, the second random projection point of the first contour point, and the third random projection point of the second contour point;

[0102] Project the first random projection point, the second random projection point, and the third random projection point in a direction perpendicular to the current projection direction to obtain a first vertical projection point, a second vertical projection point, and a third vertical projection point, respectively;

[0103] Use the bisection method to search for the nearest neighbor points of the first random projection point and the first vertical projection point in multiple groups of projection points, and select one adjacent point forward and one adjacent point backward as the minimum radius of the search point set based on the search results;

[0104] Traversing all the points to be searched in the set of points to be searched, deriving a pointing vector toward the point to be searched from any drawn point and calculating the second-order norm, and finding the minimum inscribed circle radius of the minimum value;

[0105] Traverse all the drawing points, calculate the minimum inscribed circle radius corresponding to all the drawing points, and set different colors according to the size of the minimum inscribed circle radius to draw the crack cloud map.

[0106] Specifically, in this embodiment, the step of drawing a crack cloud map includes:

[0107] a) Get the white area of ​​the binary image as the drawing area of ​​the crack cloud map, and save the coordinate set of all the drawing points: , where the coordinates of the i-th point are .

[0108] b) For each point in the coordinate set and all contour points, move in any direction Perform the projection operation to obtain the first random projection point of the current point And the second random projection point of the first contour line and the third random projection point of the second contour line , and project in the direction perpendicular to the current projection direction , get the first vertical projection point and the second vertical projection point and the third vertical projection point .

[0109] c) Use the bisection method to search for the third random projection point on each of the four groups of contour projection points and the third vertical projection point The nearest neighbor point of the searched nearest neighbor point is taken forward and backward as the set of points to be searched with the minimum radius. .

[0110] d) Set at the points to be searched Traverse all points ,from Direction leads to orientation Direction vector and calculate the second-order norm: , from which the minimum contact radius of the minimum value is found.

[0111] e) Traverse all the plotted points, calculate the minimum contact radius of all points, standardize it, set the color ladder and draw the heat map to achieve Calculation is performed to complete the search for the minimum inscribed circle radius of all drawn points.

[0112] Example 3

[0113] See also Figure 5 A third embodiment of the present invention provides a machine vision-based maximum crack width detection system for building structures, which is applied to the method described in any of the above embodiments. The system includes:

[0114] An image processing module 10 is configured to capture a surface image of a building structure having cracks using a preset image acquisition device, construct a binary image of the surface image, extract a crack contour based on the binary image, and divide the crack contour into a plurality of contour segments;

[0115] a direction calibration module 20 for calibrating the extension direction and width direction of the first contour line and the second contour line of each contour segment according to the crack contour data of the contour segment, and determining the main direction and vertical direction of the first contour line and the second contour line;

[0116] a neighbor point search module 30 for projecting each contour point in the first contour line onto a preset coordinate axis according to the main direction and the vertical direction, and using a nearest neighbor search algorithm to search for the coordinates of the second contour point closest to each first contour point in the main direction of the first contour segment in the vertical direction of the second contour segment, to obtain a set of nearest neighbor points corresponding to all first contour points;

[0117] a width calculation module 40 for determining a corresponding vertical coordinate value based on the horizontal coordinate value of each first contour point on the first contour segment, subtracting the vertical coordinate value corresponding to each second contour point in the nearest neighbor point set corresponding to the first contour point to obtain a coordinate vector of the two vertical coordinate values, and calculating a crack width value between the first contour point on the first contour line and the second contour point on the second contour line of the contour segment;

[0118] The width comparison module 50 is used to compare the crack width values ​​of all contour segments, determine the maximum crack width, and reversely search for the corresponding coordinate vector. According to the coordinate vector, the point on the corresponding crack contour is searched to achieve the measurement and positioning of the maximum crack width of the building structure.

[0119] The image processing module 10 is specifically configured to:

[0120] Capturing images of the surface of the building structure using a preset image acquisition device to obtain a surface image of the building structure where cracks occur;

[0121] Dilate and erode the surface image to obtain a binary image corresponding to the surface image;

[0122] Extracting a crack contour using a Canny operator based on the binary image to determine an outer edge of the contour; wherein the crack contour is a connected domain of the crack, and the outer edge of the crack contour includes a first contour line and a second contour line on both sides of an extension direction of the connected domain;

[0123] The crack contour is divided according to preset indicators to obtain a plurality of mutually independent contour segments.

[0124] Compared with the prior art, the machine vision-based building structure maximum crack width detection system shown in this embodiment has the following beneficial effects:

[0125] This embodiment acquires a surface image of a building structure through an image acquisition device, constructs a binary image corresponding to the surface image, and extracts the crack outline of the building structure based on the binary image. The crack outline is then divided into multiple contour segments, a crack width value is calculated for each contour segment, and finally the crack width values ​​of each contour segment are compared to determine the maximum crack width of the cracks in the building structure, thereby achieving measurement and positioning of the maximum crack width. This embodiment can make the crack measurement direction consistent with the actual physical direction, reduce systematic errors, have high robustness, and can quickly and accurately measure the maximum crack width of the building structure.

[0126] Example 3

[0127] A third embodiment of the present invention provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method described in the above embodiment is implemented.

[0128] Example 4

[0129] A fourth embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the method described in the above embodiments when executing the computer program.

[0130] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0131] The above-described embodiments merely illustrate several implementations of the present invention. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make numerous modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.

Claims

1. A method for detecting the maximum crack width of a building structure based on machine vision, characterized in that: The method comprises: Capturing a surface image of a building structure where cracks occur by a preset image acquisition device, constructing a binary image of the surface image, extracting a crack contour based on the binary image, and dividing the crack contour into a plurality of contour segments; According to the crack contour data of each contour segment, the first contour line and the second contour line of the contour segment are calibrated in the extension direction and the width direction respectively, and the main direction and the vertical direction of the first contour line and the second contour line are determined; Projecting each contour point in the first contour line onto a preset coordinate axis according to the main direction and the vertical direction, and using a nearest neighbor search algorithm to search for the coordinates of the second contour point closest to each first contour point in the main direction of the first contour segment in the vertical direction of the second contour segment, to obtain a set of nearest neighbor points corresponding to all first contour points; Determine the corresponding vertical coordinate value based on the horizontal coordinate value of each first contour point on the first contour segment, subtract the vertical coordinate value corresponding to each second contour point in the nearest neighbor point set corresponding to the first contour point, obtain a coordinate vector of the two vertical coordinate values, and calculate the crack width value between the first contour point on the first contour line and the second contour point on the second contour line of the contour segment; Compare the crack width values ​​of all contour segments to determine the maximum crack width, and reversely search for the corresponding coordinate vector. According to the coordinate vector, find the point on the corresponding crack contour to achieve measurement and positioning of the maximum crack width of the building structure; The steps of collecting a surface image of a building structure having cracks by a preset image acquisition device, constructing a binary image of the surface image, extracting a crack contour based on the binary image, and dividing the crack contour into a plurality of contour segments include: Capturing images of the surface of the building structure using a preset image acquisition device to obtain a surface image of the building structure where cracks occur; Dilate and erode the surface image to obtain a binary image corresponding to the surface image; Extracting a crack contour using a Canny operator based on the binary image to determine an outer edge of the contour; wherein the crack contour is a connected domain of the crack, and the outer edge of the crack contour includes a first contour line and a second contour line on both sides of an extension direction of the connected domain; Dividing the crack profile according to preset indicators to obtain multiple independent profile segments; The step of dividing the crack contour according to preset indicators to obtain a plurality of mutually independent contour segments includes: Fitting the extracted crack profile with a high-order polynomial, and calculating the curvature of the high-order polynomial at different points of the crack profile; Based on a preset curvature threshold, the crack contour is divided into multiple segments to obtain multiple independent contour segments; According to the crack contour data of each contour segment, the first contour line and the second contour line of the contour segment are calibrated in the extension direction and the width direction respectively, and in the step of determining the main direction and the vertical direction of the first contour line and the second contour line, the processing of each contour segment includes: a) Contour coordinate data centering Get the positions of all pixels in all contour segments in the rectangular coordinate system of the image, calculate the coordinate center, and calculate the expression: ,in For the i The coordinates of the contour points; Calculate the coordinate center of all pixel points and calculate the expression: ,in is the coordinate point after decentralization; b) Calculate the covariance matrix The calculation expression for covariance matrix calculation is: , used to describe the distribution differences of data points in various directions; c) Perform singular value decomposition on the covariance matrix The decomposition formula is , and obtain the eigenvalues and eigenvectors , where the eigenvector corresponding to the largest eigenvalue is Indicates the main direction of crack development, the eigenvector corresponding to the minimum eigenvalue Indicates the vertical direction of the crack.

2. The method for detecting the maximum crack width of a building structure based on machine vision according to claim 1, characterized in that: The method further comprises: A crack cloud image corresponding to the crack contour is created according to the crack contour.

3. The method for detecting the maximum crack width of a building structure based on machine vision according to claim 2, characterized in that: The step of creating a crack cloud map corresponding to the crack contour according to the crack contour comprises: Obtaining a binary image obtained by dilation and erosion, identifying a crack region in the binary image, using the crack region as a drawing domain of a crack cloud map, and obtaining a coordinate set of drawing points; The set of nearest neighbor points of each drawing point in the coordinate set is searched and obtained, the second-order norm of the pointing vector is calculated, the minimum inscribed circle radius is searched and obtained, and the crack cloud map is drawn according to the size of the minimum inscribed circle radius.

4. The method for detecting the maximum crack width of a building structure based on machine vision according to claim 3, characterized in that: The steps of searching for a set of nearest neighbor points of each drawing point in the coordinate set, calculating the second-order norm of the pointing vector, searching for a minimum inscribed circle radius, and drawing a crack cloud map according to the minimum inscribed circle radius include: Project each drawing point in the coordinate set and all contour points in any direction to obtain the first random projection point of the current point, the second random projection point of the first contour point, and the third random projection point of the second contour point; Project the first random projection point, the second random projection point, and the third random projection point in a direction perpendicular to the current projection direction to obtain a first vertical projection point, a second vertical projection point, and a third vertical projection point, respectively; Use the bisection method to search for the nearest neighbor points of the first random projection point and the first vertical projection point in multiple groups of projection points, and select one adjacent point forward and one adjacent point backward as the minimum radius of the search point set based on the search results; Traversing all the points to be searched in the set of points to be searched, deriving a pointing vector toward the point to be searched from any drawn point and calculating the second-order norm, and finding the minimum inscribed circle radius of the minimum value; Traverse all the drawing points, calculate the minimum inscribed circle radius corresponding to all the drawing points, and set different colors according to the size of the minimum inscribed circle radius to draw the crack cloud map.

5. A machine vision-based building structure maximum crack width detection system, characterized in that: The method according to any one of claims 1 to 4, wherein the system comprises: an image processing module, configured to acquire a surface image of a building structure having cracks by using a preset image acquisition device, construct a binary image of the surface image, extract a crack contour based on the binary image, and divide the crack contour into a plurality of contour segments; a direction calibration module, configured to calibrate the extension direction and width direction of the first contour line and the second contour line of each contour segment according to the crack contour data of the contour segment, and determine the main direction and the vertical direction of the first contour line and the second contour line; a neighbor point search module, configured to project each contour point in the first contour line onto a preset coordinate axis according to a main direction and a vertical direction, and use a nearest neighbor search algorithm to search for the coordinates of the second contour point closest to each first contour point in the main direction of the first contour segment in the vertical direction of the second contour segment, to obtain a set of nearest neighbor points corresponding to all first contour points; a width calculation module, configured to determine a corresponding vertical coordinate value based on the horizontal coordinate value of each first contour point on the first contour segment, subtract the vertical coordinate value corresponding to each second contour point in the nearest neighbor point set corresponding to the first contour point, obtain a coordinate vector of the two vertical coordinate values, and calculate a crack width value between the first contour point on the first contour line and the second contour point on the second contour line of the contour segment; The width comparison module is used to compare the crack width values ​​of all contour segments, determine the maximum crack width, and reversely search for the corresponding coordinate vector. According to the coordinate vector, the point on the corresponding crack contour is found to achieve the measurement and positioning of the maximum crack width of the building structure.

6. The machine vision-based building structure maximum crack width detection system according to claim 5, characterized in that: The image processing module is specifically used for: Capturing images of the surface of the building structure using a preset image acquisition device to obtain a surface image of the building structure where cracks occur; Dilate and erode the surface image to obtain a binary image corresponding to the surface image; Extracting a crack contour using a Canny operator based on the binary image to determine an outer edge of the contour; wherein the crack contour is a connected domain of the crack, and the outer edge of the crack contour includes a first contour line and a second contour line on both sides of an extension direction of the connected domain; The crack contour is divided according to preset indicators to obtain a plurality of mutually independent contour segments.

7. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Crack size measurement method based on image processing

    CN118583052A

  • Multi-crack width quantification method and system based on machine vision and local unit method

    CN119379618A