Building structure maximum crack width detection method and system based on machine vision

The method aligns crack directions with physical directions using machine vision to accurately and efficiently measure maximum crack widths in buildings, addressing human error and environmental sensitivity issues.

CN120318230AActive Publication Date: 2025-07-15EAST CHINA JIAOTONG UNIVERSITY +1

Patent Information

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

AI Technical Summary

Technical Problem

Existing architectural crack detection methods rely on manual measurements to be easily affected by subjective experience and the environment. The machine vision method has large errors in complex backgrounds, making it difficult to accurately measure small cracks and insufficient fusion capabilities of multi-source data, resulting in inaccurate measurements and safety hazards.

Method used

The surface image of the building structure is obtained through the image acquisition device, a binary image is constructed, the crack contour is extracted and divided into multiple contour segments, and the nearest neighbor search algorithm and higher-order polynomial fit are used to calibrate the crack direction and the vertical direction, calculate the crack width value, and draw a crack cloud map to improve visualization effect.

Benefits of technology

It realizes rapid and accurate measurement and positioning of the maximum crack width of the building structure, reduces systematic errors, improves robustness and measurement accuracy, and is suitable for complex engineering scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120318230A_ABST
    Figure CN120318230A_ABST
Patent Text Reader

Abstract

The invention discloses a method and system for detecting the maximum crack width of a building structure based on machine vision, and relates to the technical field of image processing.The method comprises the steps that a surface image of the building structure is obtained through image acquisition equipment, a binary image corresponding to the surface image is constructed, and the crack contour of the building structure is extracted according to the binary image; the method comprises the steps that firstly, a crack contour is divided into a plurality of contour sections, crack width value calculation is conducted on each contour section, finally, the crack width values of all the contour sections are compared, the maximum crack width of the building structure crack is determined, and measurement and positioning of the maximum crack width are achieved. Systematic errors are reduced, high robustness is achieved, and the maximum crack width of the building structure can be rapidly and accurately measured.
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 particularly to a method and system for detecting the maximum crack width of building structures based on machine vision. Background Art

[0002] Traditional building crack detection mainly relies on manual visual inspection or simple tools (such as crack gauges, microscopes) for measurement. Manual interpretation is susceptible to subjective experience, environmental light, and viewing angle limitations, making it difficult to accurately quantify the crack width. Especially for hairline cracks with a width less than 0.1 mm, the error rate is over 30%. In addition, manual point-by-point measurement is time-consuming and laborious, poses safety hazards for high-altitude and concealed areas, and cannot achieve rapid screening of large-scale structures.

[0003] Although existing machine vision-based methods partially replace manual work, they are still limited to simple edge detection or threshold segmentation techniques. These methods are sensitive to light changes and background noise (such as stains, graffiti), easily leading to missed detections or false detections. For example, the traditional Canny operator is prone to extracting false edges in complex backgrounds, while the U-Net-based segmentation model has insufficient processing of the continuity of slender cracks, resulting in contour breaks or over-segmentation, directly affecting the accuracy of subsequent width calculation.

[0004] Most machine vision methods directly estimate the crack width through pixel distance without considering the crack extension direction and local deformation. For example, algorithms based on projection or minimum bounding rectangles assume that the crack direction is aligned with the image coordinate system. However, when the actual shooting angle is tilted or the crack has a meandering distribution, the measurement direction deviates from the true physical direction, introducing systematic errors (typical deviations are over 0.2 mm).

[0005] In addition, existing research lacks the ability to dynamically fuse multi-source data. The analysis of a single image is difficult to reflect the spatio-temporal evolution law of cracks, and the traditional PCA method does not combine contour geometric characteristics when calibrating the main direction, resulting in inaccurate calibration of the width direction. These problems limit the application of the algorithm in complex engineering scenarios (such as tunnel linings, bridge cracks), and there is an urgent need for a direction-adaptive and highly robust measurement framework. Summary of the Invention

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

[0007] The first aspect of the present invention is to provide a method for detecting the maximum crack width of building structures based on machine vision, and the method includes: Collect the surface image of the cracked building structure through a preset image acquisition device, construct a binary image of the surface image, extract the crack contour according to the binary image, and divide the crack contour into multiple contour segments; According to the crack contour data of each of the contour segments, respectively calibrate the extension direction and width direction of the first contour line and the second contour line of the contour segment to determine the main direction and the vertical direction of the first contour line and the second contour line; Project each contour point position in the first contour line onto a 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 points closest to each first contour point in the vertical direction of the main direction of the first contour segment, so as to obtain a set of nearest neighbor points corresponding to all the first contour points; According to the horizontal coordinate value of each first contour point on the first contour segment, determine the corresponding vertical coordinate value, subtract the vertical coordinate value corresponding to each second contour point in the set of nearest neighbor points corresponding to the first contour point, obtain a coordinate vector of two vertical coordinate values, and calculate the crack width value between the first contour point on the first contour line of the contour segment and the second contour point on the second contour line; Compare the crack width values of all the contour segments to determine the maximum crack width, and inversely search for the corresponding coordinate vector, and search for the points on the corresponding crack contour according to the coordinate vector, so as to realize the measurement and positioning of the maximum crack width of the building structure.

[0008] According to one aspect of the above technical solution, the steps of collecting the surface image of the cracked building structure through a preset image acquisition device, constructing a binary image of the surface image, extracting the crack contour according to the binary image, and dividing the crack contour into multiple contour segments include: Collect an image of the surface of the building structure through a preset image acquisition device to obtain the surface image of the cracked building structure; Dilate and erode the surface image to obtain the binary image corresponding to the surface image; According to the binary image, use the canny operator to extract the crack contour to determine the outer edge of the contour; wherein the crack contour is the connected domain of the crack, and the outer edge of the crack contour includes the first contour line and the second contour line on both sides of the extension direction of the connected domain; Divide the crack contour according to a preset index to obtain multiple independent contour segments.

[0009] According to one aspect of the above technical solution, the steps of dividing the crack contour according to a preset index to obtain multiple independent contour segments include: The extracted crack profile is fitted with a high-order polynomial, and the curvature of the high-order polynomial at different points on the crack profile is calculated; Based on a preset curvature threshold, the crack profile is divided into multiple segments to obtain multiple independent contour segments.

[0010] According to one aspect of the above technical solution, the method further includes: According to the crack profile, a crack cloud map corresponding to the crack profile is created.

[0011] According to one aspect of the above technical solution, the step of creating a crack cloud map corresponding to the crack profile according to the crack profile includes: An obtained binary image after dilation and erosion is acquired, the crack region in the binary image is identified, and the crack region is used as the drawing domain of the crack cloud map to obtain a coordinate set of the drawing points; A set of nearest neighbor points of each drawing point in the coordinate set is searched and acquired, 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.

[0012] According to one aspect of the above technical solution, the step of searching and acquiring a set of nearest neighbor points of each drawing point in the coordinate set, calculating the second-order norm of the pointing vector, searching and obtaining the minimum inscribed circle radius, and drawing the crack cloud map according to the size of the minimum inscribed circle radius includes: Each drawing point in the coordinate set is projected in an arbitrary direction with all the contour points to obtain a first randomly projected point of the current point, a second randomly projected point of the first contour point, and a third randomly projected point of the second contour point; The first randomly projected point, the second randomly projected point, and the third randomly projected point are projected in the direction perpendicular to the current projection direction to obtain a first vertically projected point, a second vertically projected point, and a third vertically projected point respectively; The bisection method is used to search for the nearest neighbor points of the first randomly projected point and the first vertically projected point in multiple sets of projected points respectively, and one neighboring point is taken forward and backward based on the search results as a set of points to be searched for the minimum radius; All the points to be searched in the set of points to be searched are traversed, a pointing vector is drawn from an arbitrary drawing point towards the point to be searched and the second-order norm is calculated, and the minimum inscribed circle radius with the minimum value is found; All the drawing points are traversed, the minimum inscribed circle radii corresponding to all the drawing points are calculated, and different colors are set according to the size of the minimum inscribed circle radius to draw the crack cloud map.

[0013] The second aspect of the present invention lies in providing a maximum crack width detection system for building structures based on machine vision, which is applied to the method described in the above technical solution. The system includes: An image processing module, configured to collect a surface image of a building structure with cracks through a preset image acquisition device, construct a binary image of the surface image, extract a crack contour according to the binary image, and divide the crack contour into multiple 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 respectively according to the crack contour data of each contour segment, and determine the main direction and perpendicular direction of the first contour line and the second contour line; A neighboring point search module, configured to project each contour point position on the first contour line onto a preset coordinate axis according to the main direction and perpendicular direction, and use the nearest neighbor search algorithm to search for the coordinates of the second contour point closest to each first contour point position in the perpendicular direction of the second contour segment in the main direction of the first contour segment, so as to obtain a set of nearest neighbor points corresponding to all first contour point positions; A width calculation module, configured to determine the corresponding vertical coordinate value according to the horizontal coordinate value of each first contour point position on the first contour segment, subtract the vertical coordinate value corresponding to each second contour point in the set of nearest neighbor points corresponding to the first contour point position, obtain a coordinate vector of 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; A width comparison module, configured to compare the crack width values of all contour segments, determine the maximum crack width, and reverse-search for the corresponding coordinate vector, and find the point positions on the corresponding crack contour according to the coordinate vector, so as to realize the measurement and positioning of the maximum crack width of the building structure.

[0014] According to one aspect of the above technical solution, the image processing module is specifically configured to: Collect an image of the surface of the building structure through a preset image acquisition device to obtain a surface image of the building structure with cracks; Dilate and erode the surface image to obtain a binary image corresponding to the surface image; According to the binary image, use the canny operator to extract the crack contour to determine the outer edge of the contour; wherein the crack contour is the connected domain of the crack, and the outer edge of the crack contour includes the first contour line and the second contour line on both sides of the connected domain extension direction; Divide the crack contour according to a preset index to obtain multiple independent contour segments.

[0015] The third aspect of the present invention lies in providing a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described in the above technical solution is implemented.

[0016] The fourth aspect of the present invention lies in providing an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the method described in the above technical solution is implemented.

[0017] Compared with the prior art, the beneficial effects of adopting the method and system for detecting the maximum crack width of a building structure based on machine vision shown in the present invention are as follows: The present invention obtains the surface image of the building structure through an image acquisition device, constructs a binary image corresponding to the surface image, extracts the crack contour of the building structure according to the binary image, then divides the crack contour into multiple contour segments, calculates the crack width value for each contour segment, and finally compares the crack width values of each contour segment to determine the maximum crack width of the building structure crack, realizing the measurement and positioning of the maximum crack width. Then, the present invention can make the crack measurement direction consistent with the true physical direction, reduce systematic errors, has high robustness, and can quickly and accurately measure the maximum crack width of the building structure. Description of the Drawings

[0018] The above and / or additional aspects and advantages of the present invention will become obvious and easy to understand from the description of the embodiments in conjunction with the following drawings, where: Figure 1 is a schematic flowchart of a method for detecting the maximum crack width of a building structure based on machine vision in an embodiment of the present invention; Figure 2 is the surface image of the building structure in an embodiment of the present invention; Figure 3 is the binary image constructed based on the surface image in an embodiment of the present invention; Figure 4 is the crack contour determined based on the binary image in an embodiment of the present invention; Figure 5 is a structural block diagram of a system for detecting the maximum crack width of a building structure based on machine vision in an embodiment of the present invention. Detailed Embodiments

[0019] To make the objectives, features, and advantages of the present invention more obvious and understandable, the following detailed description of the specific embodiments of the present invention is provided in conjunction with the drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0020] It should be noted that when an element is referred to as being "fixed to" another element, it can be directly on the other element or there may also be an intermediate element. When an element is considered to be "connected to" another element, it can be directly connected to the other element or there may be an intermediate element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used in this article are only for the purpose of illustration.

[0021] Unless otherwise defined, all technical and scientific terms used in this article have the same meaning as commonly understood by those skilled in the technical field to which this invention belongs. The terms used in the description of the present invention in this article are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used in this article includes any and all combinations of one or more of the related listed items.

[0022] Embodiment 1 Please refer to Figures 1-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 - S50: Step S10, collect the surface image of the building structure with cracks through a preset image acquisition device, construct a binary image of the surface image, extract the crack contour according to the binary image, and divide the crack contour into multiple contour segments.

[0023] First of all, it should be noted that the building structure includes the surfaces of various building components such as concrete structures, masonry structures, and steel structures, and mainly covers common crack types such as hairline cracks, through cracks, and inclined cracks. This embodiment takes the tunnel lining of the subway as an example for illustration. During the non - operating time of the subway train, the building structure is continuously scanned through the image acquisition device integrated on the detection vehicle to obtain a scanned image, and then the image is cropped according to a preset size to obtain multiple scanned images, and the scanned images with cracks on the surface of the building structure are screened out, that is, the surface image is obtained.

[0024] Among them, after the surface image is collected, the surface image will be dilated and eroded, and a binary image corresponding to the surface image, that is, a black - and - white image, will be output. The gray value of any pixel point in the image is 0 or 255, representing black and white respectively.

[0025] More specifically, the black area in the binary image is determined as the surface area of the building structure. In the binary image, the black area includes at least one connected component, which can also be multiple independent connected components. Then, the white area existing within the black area is determined as the crack area of the building structure, so that the crack contour of the crack can be extracted from 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 in combination with the trend of the crack contour according to the preset curvature threshold. For example, the crack contour is divided into 3 segments, 5 segments, etc. Subsequently, the maximum crack width of all contour segments is detected, including the maximum width detection and the position detection.

[0026] In this embodiment, a surface image of a cracked building structure is collected by a preset image acquisition device, and a binary image of the surface image is constructed. The steps of extracting a crack contour from the binary image and dividing the crack contour into multiple contour segments include: The surface of the building structure is imaged by a preset image acquisition device to obtain a surface image of the cracked building structure; The surface image is dilated and eroded to obtain a binary image corresponding to the surface image; According to the binary image, the canny operator is used to extract the crack contour to determine the outer edge of the contour; wherein the crack contour is the connected component 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 the extending direction of the connected component; The crack contour is divided according to a preset index to obtain multiple independent contour segments.

[0027] Among them, the steps of dividing the crack contour according to a preset index to obtain multiple independent contour segments include: The extracted crack contour is fitted with a high-order polynomial, and the curvature of the high-order polynomial at different points on the crack contour is calculated; Based on a preset curvature threshold, the crack contour is divided into multiple segments to obtain multiple independent contour segments.

[0028] Specifically, after the surface image is dilated and eroded, a binary image of the crack will be obtained. The canny operator is used to extract the crack contour to obtain the outer edge of the crack. Then, the main direction of crack development (PCA) is determined first. The extending direction of the crack is the main direction of development. Therefore, the width direction is the vertical direction. Further considering the development direction of the crack at different positions, a segmented main direction calibration method is proposed for calibration.

[0029] More specifically, the extracted crack contour is fitted with a high-order polynomial to obtain a high-order polynomial describing a complex line With , where is the abscissa,[ and are undetermined coefficients. Calculate the curvature of the high-order polynomial at different points, and calculate based on the formula . By setting the threshold of the curvature, when the curvature of the contour exceeds the threshold, it is interrupted into multiple segments to obtain multiple contour segments.[

[0030] Step S20: According to the crack contour data of each of the contour segments, 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 the perpendicular direction of the first contour line and the second contour line.[

[0031] In this embodiment, the processing of each contour segment includes:[ a) Centralize the contour coordinate data First, obtain the positions of all pixel points in all contour segments in the picture rectangular coordinate system, and calculate its coordinate center:[ , where is the coordinate of the i-th contour point. Calculate the coordinate centralization of all pixel points:[ , where is the coordinate point after decentralization.[

[0032] b) Calculate the covariance matrix Calculation method of the covariance matrix C:[ , which describes the distribution difference of data points in each direction.[

[0033] c) Perform singular value decomposition on the covariance matrix The decomposition formula is , obtain the eigenvalues and eigenvectors , where the eigenvector corresponding to the largest eigenvalue represents the main direction of crack development, and the eigenvector corresponding to the smallest eigenvalue represents the perpendicular direction of the crack.[

[0034] Step S30: Project each contour point position in the first contour line onto a preset coordinate axis according to the main direction and the perpendicular direction, and use the nearest neighbor search algorithm to search for the coordinates of the second contour point closest to each first contour point position 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 point positions.[

[0035] Specifically, project each point on the contour onto the main direction and the width direction of the coordinate axis. Projection formula:[ , where the projection coordinates in the main direction are , and the projection coordinates in the width direction are: , the main direction coordinates after projection represents the position along the crack extension direction, and the width direction coordinate represents the offset of the point in the width direction.

[0036] Step S40, according to the horizontal coordinate values of each first contour point on the first contour segment, determine the corresponding vertical coordinate values, subtract the vertical coordinate values corresponding to each second contour point in the nearest neighbor point set corresponding to the first contour point, obtain the coordinate vectors 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.

[0037] Specifically, the nearest neighbor search searches for the coordinates of the nearest neighbor points of each projection point in the main direction in the direction perpendicular to the other contour, including: a) Project the points on the first contour line and the second contour line respectively in the main direction Sort to obtain an ordered array: ; b) Use the binary search method to find the nearest neighbor: For a certain point in the first contour line, use binary search in to find the insertion position idx, and check the coordinate points before and after this insertion position by each and include them in the set of nearest neighbor points. At this time, the coordinate set of the nearest neighbor points of point is: , where generally takes 2 or 3.

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

[0039] Further, for each point in the first contour line, find the point corresponding to its projection in the vertical direction, subtract the projection coordinates corresponding to each point in the nearest neighbor point set of this point in the vertical direction, obtain the pointing vector pointing to , and calculate the second-order norm of this vector as the width of the crack under the current corresponding point, as shown in the following formula .

[0040] Step S50: Compare the crack width values of all contour segments to determine the maximum crack width, and inversely search for the corresponding coordinate vectors. Locate the points on the corresponding crack contour according to the coordinate vectors to achieve the measurement and positioning of the maximum crack width of the building structure.

[0041] Specifically, compare each crack width value with the vector to establish a correspondence with the crack scanning width, and obtain a corresponding set that includes the crack corresponding widths and the nearest neighbor vectors of all points on the first contour line.

[0042] Then, search for the crack widths of all contour segments to find the size of the maximum crack width, and obtain its corresponding vector. Locate the points on the original contour corresponding to the two points on the vector to achieve the measurement and positioning of the crack with the maximum width.

[0043] Compared with the prior art, the beneficial effect of adopting the method for detecting the maximum crack width of a building structure based on machine vision shown in this embodiment is as follows: In this embodiment, the surface image of the building structure is acquired by an image acquisition device, and a binary image corresponding to the surface image is constructed to extract the crack contour of the building structure according to the binary image. Then, the crack contour is divided into multiple contour segments, the crack width value of each contour segment is calculated, and finally, the crack width values of each contour segment are compared to determine the maximum crack width of the building structure crack, so as to achieve the measurement and positioning of the maximum crack width. Therefore, this embodiment can make the crack measurement direction consistent with the real physical direction, reduce the systematic error, has high robustness, and can quickly and accurately measure the maximum crack width of the building structure.

[0044] Embodiment 2 In order to further improve the visualization effect of the crack width, the cross-space nearest neighbor method (Cross-Nest) is proposed to draw a crack width cloud map for each point in the crack area to improve 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, and the differences are as follows: In this embodiment, the method further includes: Create a crack cloud map corresponding to the crack contour according to the crack contour.

[0045] Among them, the step of creating a crack cloud map corresponding to the crack contour according to the crack contour includes: Obtain the binary image obtained by dilation and erosion, identify the crack area in the binary image, use the crack area as the drawing domain of the crack cloud map, and obtain the coordinate set of the drawing points; Search for the set of nearest neighbor points of each drawing point in the coordinate set, calculate the second-order norm of the pointing vector, search for the minimum inscribed circle radius, and draw the crack cloud diagram according to the size of the minimum inscribed circle radius.

[0046] Further, the steps of searching for the set of nearest neighbor points of each drawing point in the coordinate set, calculating the second-order norm of the pointing vector, searching for the minimum inscribed circle radius, and drawing the crack cloud diagram according to the size of the minimum inscribed circle radius include: Project each drawing point in the coordinate set and all contour points in an arbitrary direction to obtain the first randomly projected point of the current point, the second randomly projected point of the first contour point, and the third randomly projected point of the second contour point; Project the first randomly projected point, the second randomly projected point, and the third randomly projected point in the direction perpendicular to the current projection direction to obtain the first vertically projected point, the second vertically projected point, and the third vertically projected point respectively; Use the bisection method to search for the nearest neighbor points of the first randomly projected point and the first vertically projected point in multiple sets of projected points respectively, and take one neighboring point forward and backward based on the search results as the set of points to be searched for the minimum radius; Traverse all the points to be searched in the set of points to be searched, draw a pointing vector from any drawing point towards the point to be searched and calculate the second-order norm, and find the minimum inscribed circle radius with 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 diagram.

[0047] Specifically, in this embodiment, the steps of drawing the crack cloud diagram include: a) Obtain the white area part of the binary image as the drawing area of the crack cloud diagram area, and save the coordinate set of all drawing points: , where the coordinates of the i-th point are .

[0048] b) For each point in the coordinate set and all the contour points in an arbitrary direction Perform a projection operation to obtain the first randomly projected point of the current point And the second randomly projected point of the first contour line And the third randomly projected point of the second contour line , and at the same time project in the direction perpendicular to the current projection direction , to obtain the first vertically projected point And the second vertically projected point And the third vertically projected point .

[0049] c) Use the bisection method to search for the third random projection point position and the third vertical projection point position among the four groups of contour projection points respectively, and take one adjacent point forward and backward based on the searched nearest neighbor points as the set of points to be searched with the minimum radius .

[0050] d) Traverse all the points in the set of points to be searched , draw a direction vector from direction towards direction and calculate the second-order norm: , and find the minimum contact radius with the minimum value from them.

[0051] e) Traverse all the drawn points, calculate the minimum contact radius of all the points, standardize it, set the color gradient and draw the heat map to implement the calculation to complete the search for the minimum inscribed circle radius of all the drawn points.

[0052] Embodiment III Please refer to Figure 5 , the third embodiment of the present invention provides a maximum crack width detection system for building structures based on machine vision, which is applied to the method described in any of the above embodiments. The system includes: An image processing module 10, configured to collect a surface image of a cracked building structure through a preset image acquisition device, construct a binary image of the surface image, extract the crack contour according to the binary image, and divide the crack contour into multiple contour segments; A direction calibration module 20, configured to calibrate the extension direction and width direction of the first contour line and the second contour line of each contour segment respectively according to the crack contour data of each contour segment, and determine the main direction and perpendicular direction of the first contour line and the second contour line; A neighboring point search module 30, configured to project each contour point position in the first contour line onto a preset coordinate axis according to the main direction and perpendicular direction, and use the nearest neighbor search algorithm to search for the coordinates of the second contour points closest to each first contour point position in the perpendicular direction of the second contour segment in the main direction of the first contour segment, so as to obtain a set of nearest neighbor points corresponding to all first contour point positions; A width calculation module 40, configured to determine the corresponding vertical coordinate value according to the horizontal coordinate value of each first contour point position on the first contour segment, subtract the vertical coordinate value corresponding to each second contour point position in the set of nearest neighbor points corresponding to the first contour point position, obtain a coordinate vector of two vertical coordinate values, and calculate the crack width value between the first contour point position on the first contour line of the contour segment and the second contour point position on the second contour line; A width comparison module 50 is configured to compare the crack width values of all contour segments, determine the maximum crack width, inversely search for the corresponding coordinate vector, and search for the points on the corresponding crack contour according to the coordinate vector, so as to measure and locate the maximum crack width of the building structure.

[0053] Wherein, the image processing module 10 is specifically configured to: Collect images of the surface of the building structure through a preset image acquisition device to obtain a surface image of the building structure with cracks; Dilate and erode the surface image to obtain a binary image corresponding to the surface image; Extract the crack contour by using the canny operator according to the binary image to determine the outer edge of the contour; wherein the crack contour is the 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 the extending direction of the connected domain; Divide the crack contour according to a preset index to obtain a plurality of independent contour segments.

[0054] Compared with the prior art, the use of the machine vision-based maximum crack width detection system for building structures shown in this embodiment has the beneficial effects that: In this embodiment, the surface image of the building structure is obtained through an image acquisition device, a binary image corresponding to the surface image is constructed, the crack contour of the building structure is extracted according to the binary image, then the crack contour is divided into a plurality of contour segments, the crack width value of each contour segment is calculated, and finally the crack width values of each contour segment are compared to determine the maximum crack width of the building structure crack, realizing the measurement and positioning of the maximum crack width. Then, this embodiment can make the crack measurement direction consistent with the true physical direction, reduce the systematic error, has high robustness, and can quickly and accurately measure the maximum crack width of the building structure.

[0055] Embodiment III The third embodiment of the present invention provides a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described in the above embodiment is implemented.

[0056] Embodiment IV The fourth embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the method described in the above embodiment is implemented.

[0057] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0058] The above-described embodiments merely represent several implementation manners of the present invention. The descriptions are relatively specific and detailed, but should not be construed as a limitation on the scope of the patent of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can still be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to 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 includes: Collecting a surface image of a cracked building structure by a preset image acquisition device, constructing a binary image of the surface image, extracting a crack contour according to the binary image, and dividing the crack contour into a plurality of contour segments; 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 each contour segment, and determining the main direction and perpendicular direction of the first contour line and the second contour line; Projecting each contour point position in the first contour line onto a preset coordinate axis in the main direction and perpendicular direction, and using the nearest neighbor search algorithm to search for the coordinates of the second contour point closest to each first contour point position 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 point positions; Determining the corresponding vertical coordinate value according to the horizontal coordinate value of each first contour point position 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 position, to obtain a coordinate vector of two vertical coordinate values, and calculating the crack width value between the first contour point position on the first contour line and the second contour point position on the second contour line of the contour segment; Comparing the crack width values of all contour segments to determine the maximum crack width, and inversely searching for the corresponding coordinate vector, and searching for the point positions on the corresponding crack contour according to the coordinate vector, so as to realize the measurement and positioning of the maximum crack width of the building structure.

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 steps of collecting a surface image of a cracked building structure by a preset image acquisition device, constructing a binary image of the surface image, extracting a crack contour according to the binary image, and dividing the crack contour into a plurality of contour segments include: Collecting an image of the surface of the building structure by a preset image acquisition device to obtain a surface image of the cracked building structure; Performing dilation and erosion on the surface image to obtain a binary image corresponding to the surface image; Extracting a crack contour by using a canny operator according to the binary image to determine the outer edge of the contour; wherein the crack contour is the 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 the connected domain extension direction; Dividing the crack contour according to a preset index to obtain a plurality of independent contour segments.

3. The method for detecting the maximum crack width of a building structure based on machine vision according to claim 2, wherein, The steps of dividing the crack contour according to a preset index to obtain a plurality of independent contour segments include: Fitting the extracted crack contour with a high-order polynomial, and calculating the curvature of the high-order polynomial at different point positions of the crack contour; Based on a preset curvature threshold, dividing the crack contour into multiple segments to obtain a plurality of independent contour segments.

4. The method for detecting the maximum crack width of a building structure based on machine vision according to any one of claims 1-3, characterized in that, The method further includes: Creating a crack cloud map corresponding to the crack contour according to the crack contour.

5. The method for detecting the maximum crack width of a building structure based on machine vision according to claim 4, wherein The steps of creating a crack cloud map corresponding to the crack contour according to the crack contour include: Obtaining the binary image obtained by dilation and erosion, identifying the crack region in the binary image, taking the crack region as the drawing domain of the crack cloud map, and obtaining a set of coordinates of the drawing points; Search for the set of nearest neighbor points of each drawing point in the coordinate set, calculate the second-order norm of the pointing vector, search for the minimum inscribed circle radius, and draw a crack nephogram corresponding to the size of the minimum inscribed circle radius.

6. The method for detecting the maximum crack width of a building structure based on machine vision according to claim 5, wherein, The steps of searching for the set of nearest neighbor points of each drawing point in the coordinate set, calculating the second-order norm of the pointing vector, searching for the minimum inscribed circle radius, and drawing a crack nephogram corresponding to the size of 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 randomly projected point of the current point, the second randomly projected point of the first contour point, and the third randomly projected point of the second contour point; Project the first randomly projected point, the second randomly projected point, and the third randomly projected point in the direction perpendicular to the current projection direction to obtain the first vertically projected point, the second vertically projected point, and the third vertically projected point respectively; Use the bisection method to search for the nearest neighbor points of the first randomly projected point and the first vertically projected point in multiple sets of projected points respectively, and take one neighboring point forward and backward based on the search results as the set of points to be searched for the minimum radius; Traverse all the points to be searched in the set of points to be searched, draw a pointing vector from any drawing point towards the point to be searched and calculate the second-order norm, and find 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 a crack nephogram.

7. A building structure maximum crack width detection system based on machine vision, characterized in that, Applied to the method described in any one of claims 1-6, the system includes: An image processing module for collecting a surface image of a cracked building structure through a preset image acquisition device, constructing a binary image of the surface image, extracting a crack contour according to the binary image, and dividing the crack contour into multiple contour segments; A direction calibration module 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 each contour segment, and determining the main direction and perpendicular direction of the first contour line and the second contour line; A neighbor point search module for projecting each contour point in the first contour line onto a preset coordinate axis in the main direction and the perpendicular direction, and using the nearest neighbor search algorithm to search for the coordinates of the second contour points closest to each first contour point in the perpendicular direction of the second contour segment in the main direction of the first contour segment, to obtain the set of nearest neighbor points corresponding to all first contour points; A width calculation module for determining the corresponding vertical coordinate value according to 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 set of nearest neighbor points corresponding to the first contour point, obtaining a coordinate vector of two vertical coordinate values, and calculating 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; A width comparison module is used to compare the crack width values of all contour segments, determine the maximum crack width, inversely find the corresponding coordinate vector, and find the points on the corresponding crack contour according to the coordinate vector, so as to realize the measurement and positioning of the maximum crack width of the building structure.

8. The machine vision-based building structure maximum crack width detection system according to claim 7, wherein, The image processing module is specifically used for: Collecting images of the surface of the building structure through a preset image acquisition device to obtain a surface image of the building structure with cracks; Performing dilation and erosion on the surface image to obtain a binary image corresponding to the surface image; Extracting the crack contour by using the canny operator according to the binary image to determine the outer edge of the contour; wherein the crack contour is the 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 the extending direction of the connected domain; Dividing the crack contour according to a preset index to obtain a plurality of mutually independent contour segments.

9. A readable storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by a processor, the method described in any one of claims 1-6 is implemented.

10. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that When the processor executes the computer program, the method described in any one of claims 1-6 is implemented.

Citation Information

Patent Citations

  • Wall crack detection device excellent in profile identification and filtering performances

    CN105678770A

  • Bridge crack information fusion method

    CN109829856A

  • Crack measurement method based on mobile phone

    CN111724382A

  • Concrete crack detection method and device

    CN115682957A

  • Crack length detection system based on computer image processing

    CN118037730A

Cited By

  • Building crack detection method based on neural network

    CN121120565A

  • A neural network-based building crack detection method

    CN121120565B