Multi-crack width quantification method and system based on machine vision and local unit method
Based on the method of machine vision and local unit method, the problem of quantitative accuracy in the existing technology in the existing technologies in multi -cracks or irregular cracks, and achieved high -precision crack width and quantitativeization, suitable for large -scale structural health monitoring.
Patent Information
- Application Number
- CN202411403200.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-10-09
AI Technical Summary
The existing crack width quantization method is difficult to achieve accurate and reliable quantization results when facing multi-crack scenes or cracks with irregular shapes, and the overall pixel calculation results in low accuracy.
Adopt the method based on the method of machine vision and local unit method, to generate a two -value mask of the crack through the visual segmentation model, automatically divide the split seam with the connecting domain marking function, calculate the inclined angle and generate an external rectangular box, divide the local unit along the length direction, and carry out the part of the length. Linear fitting and sub -pixel interpolation to determine the width of the crack.
The accuracy of the width of the crack is greatly improved, especially in the irregular crack detection, it has performed well, overcoming the error problem of traditional methods at the mutation of the crack shape, improved the detection efficiency, and is suitable for large -scale structural health monitoring.
Smart Images

Figure CN119379618A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of crack detection in civil engineering structures, and in particular to a method and system for quantifying multiple crack widths based on machine vision and a local unit method. Background Art
[0002] In the health monitoring of civil engineering structures, crack width is one of the key indicators for assessing the degree of structural damage and potential safety risks. Timely and accurate quantification of crack width is crucial to ensuring structural safety and extending its service life. With the rapid development of computer vision technology, crack width detection and quantification methods based on machine vision have gradually become an efficient and non-contact detection method. However, existing crack width quantification methods still have shortcomings in practical applications, especially when facing multi-crack scenarios or irregularly shaped cracks, it is difficult to achieve accurate and reliable quantification results.
[0003] Common crack width quantification methods currently include crack width calculation based on the vertical line of the central axis, the minimum distance of the edge line, the local average width, and the change of grayscale value. These methods perform well when dealing with simple and regular cracks, but the quantification accuracy is significantly limited when the crack width varies greatly, the shape is irregular, or the number of cracks is large. In addition, most existing methods are based on integer pixel calculations, resulting in low accuracy and cannot meet higher requirements for application scenarios. Summary of the invention
[0004] In order to solve the above technical problems existing in the prior art, the embodiment of the present invention provides a method and system for quantifying multiple crack widths based on machine vision and local unit method. The technical solution is as follows:
[0005] On the one hand, a method for quantifying the width of multiple cracks based on machine vision and local unit method is provided, and the method comprises: processing the crack image of the civil engineering structure through a visual segmentation model to generate a binary mask of the crack; automatically dividing the binary mask using a connected domain labeling function to identify the connected domain of each crack; calculating the inclination angle of the crack using linear fitting based on the pixel coordinates of the crack in each connected domain; combining the connected domain analysis method to generate a crack region circumscribed rectangular frame consistent with the inclination angle; dividing each crack region circumscribed rectangular frame into a plurality of local units along the length direction; extracting the crack pixel coordinates in each local unit, and calculating all crack images. The method comprises the following steps: obtaining the center point coordinates of the pixels of the local unit, and performing linear fitting on all crack pixels in each local unit based on the crack pixel coordinates to obtain a center line fitting straight line and the slope of the center line fitting straight line; extracting the crack edge pixel coordinates and corner point coordinates in each local unit based on edge detection and corner point detection algorithms, and performing linear fitting on the crack edge pixel coordinates and the corner point coordinates to obtain an edge fitting straight line; determining the crack width of each local unit based on the center point coordinates, the center line fitting straight line, the slope of the center line fitting straight line and the edge fitting straight line; and determining the complete crack width parameter of each crack based on the crack width of each local unit.
[0006] Optionally, the visual segmentation model includes at least one of the following: an image segmentation model, a deep learning-based segmentation model, and a large visual segmentation model.
[0007] Optionally, using linear fitting to calculate the inclination angle of the crack includes: fitting all pixel coordinates in each connected domain based on a least squares linear fitting function to obtain the inclination angle of the crack in each connected domain.
[0008] Optionally, in combination with a connected domain analysis method, a circumscribed rectangular frame of the crack area consistent with the inclination angle is generated, including: based on the connected domain analysis method, obtaining the minimum area circumscribed rectangular frame of each crack, and extracting the angle of the minimum area circumscribed rectangular frame; comparing the difference between the angle of the minimum area circumscribed rectangular frame and the inclination angle and correcting it to obtain the circumscribed rectangular frame of the crack area.
[0009] Optionally, linear fitting is performed based on the crack edge pixel coordinates and the corner point coordinates to obtain an edge fitting straight line, including: traversing the crack edge pixel coordinates, and determining the edge line to which each crack edge pixel coordinate belongs based on the distance from each crack edge pixel coordinate to each corner point coordinate; performing sub-pixel interpolation on the crack edge pixel coordinates of each edge line, and performing linear fitting on the edge pixels on both sides using the least squares method to obtain the edge fitting straight line.
[0010] Optionally, the crack width of each local unit is determined based on the center point coordinates, the centerline fitting straight line, the slope of the centerline fitting straight line and the edge fitting straight line, including: determining a normal on the centerline fitting straight line passing through the midline point coordinates based on the slope of the centerline fitting straight line, and determining two intersection points of the normal line and two edge fitting straight lines; and determining the Euclidean distance between the two intersection points as the crack width.
[0011] Optionally, the method further comprises: determining the boundary according to the minimum and maximum width values of the cracks, and visually displaying the width distribution of all the cracks through a cloud map.
[0012] On the other hand, a multi-crack width quantification system based on machine vision and local unit method is also provided, including: a segmentation module, a first division module, a first fitting module, an analysis module, a second division module, a second fitting module, a third fitting module, a first determination module and a second determination module; wherein the segmentation module is used to process the crack image of the civil engineering structure through a visual segmentation model to generate a binary mask of the crack; the first division module is used to automatically divide the binary mask using a connected domain marking function to identify the connected domain of each crack; the first fitting module is used to calculate the inclination angle of the crack based on the pixel coordinates of the crack in each connected domain using linear fitting; the analysis module is used to generate a crack area circumscribed rectangular frame consistent with the inclination angle in combination with a connected domain analysis method; the second division module is used to divide the circumscribed rectangular frame of each crack area along the length direction The method is divided into a plurality of local units; the second fitting module is used to extract the crack pixel coordinates in each local unit, calculate the center point coordinates of all crack pixels, and perform linear fitting on all crack pixels in each local unit based on the crack pixel coordinates to obtain a center line fitting straight line and the slope of the center line fitting straight line; the third fitting module is used to extract the crack edge pixel coordinates and corner point coordinates in each local unit based on edge detection and corner point detection algorithms, and perform linear fitting based on the crack edge pixel coordinates and the corner point coordinates to obtain an edge fitting straight line; the first determining module is used to determine the crack width of each local unit based on the center point coordinates, the center line fitting straight line, the slope of the center line fitting straight line and the edge fitting straight line; the second determining module is used to determine the complete crack width parameters of each crack based on the crack width of each local unit.
[0013] On the other hand, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method provided by the present invention when executing the computer program.
[0014] On the other hand, a computer-readable storage medium is provided, in which a program code is stored. The program code can be called by a processor to execute the method provided by the present invention.
[0015] The embodiment of the present invention provides a method and system for quantifying the width of multiple cracks based on machine vision and the local unit method. By combining sub-pixel interpolation and local unit analysis, the accuracy of crack width quantification is greatly improved, especially in the detection of irregular cracks. The local unit segmentation accurately captures the local width changes of the cracks, overcoming the error problem of the traditional method at the point where the crack shape changes suddenly. In addition, the present invention improves the detection efficiency by automatically quantifying the crack width, and is suitable for large-scale structural health monitoring. The method also supports the simultaneous detection of multiple cracks, and visualizes the crack width distribution through cloud maps, intuitively presents the changes in the size of the cracks, and provides reliable data support for structural health assessment. It solves the technical problem of low crack width quantification accuracy in the prior art when the crack width changes greatly, the shape is irregular, or the number of cracks is large. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0017] Figure 1 It is a flow chart of a method for quantifying multiple crack widths based on machine vision and local unit method provided by an embodiment of the present invention;
[0018] Figure 2 is a flow chart of another method for quantifying multiple crack widths based on machine vision and local unit method provided by an embodiment of the present invention;
[0019] Figure 3 This is a schematic diagram of quantifying crack width in a local unit provided by an embodiment of the present invention;
[0020] Figure 4 It is a schematic diagram of a multiple crack width quantization system based on machine vision and local unit method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0021] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0022] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.
[0023] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0024] Embodiment 1
[0025] Figure 1 1 is a flow chart of a method for quantifying multiple crack widths based on machine vision and local unit method according to an embodiment of the present invention. Figure 1 As shown, the method specifically comprises the following steps:
[0026] Step S102, processing the crack image of the civil engineering structure by using a visual segmentation model to generate a binary mask of the crack.
[0027] Step S104: Use the connected domain labeling function to automatically divide the binary mask and identify the connected domain of each crack.
[0028] Step S106, based on the pixel coordinates of the cracks in each connected domain, the inclination angle of the cracks is calculated using linear fitting.
[0029] Step S108, combining the connected domain analysis method, generating a rectangular frame circumscribing the crack area consistent with the inclination angle.
[0030] Step S110, dividing the circumscribed rectangular frame of each crack region into a plurality of local units along the length direction.
[0031] Step S112, extracting the crack pixel coordinates in each local unit, calculating the center point coordinates of all crack pixels, and performing linear fitting on all crack pixels in each local unit based on the crack pixel coordinates to obtain the center line fitting line and the slope of the center line fitting line.
[0032] Step S114, based on edge detection and corner point detection algorithms, extract the crack edge pixel coordinates and corner point coordinates in each local unit, and perform linear fitting based on the crack edge pixel coordinates and corner point coordinates to obtain an edge fitting line.
[0033] Step S116, determining the crack width of each local unit based on the center point coordinates, the center line fitting straight line, the slope of the center line fitting straight line and the edge fitting straight line.
[0034] Step S118, based on the crack width of each local unit, determine the complete crack width parameter of each crack.
[0035] Figure 2 FIG. 1 is a flowchart of another method for quantifying multiple crack widths based on machine vision and local unit method according to an embodiment of the present invention. Figure 2 As shown, in step S102, the crack image is processed by the visual segmentation model to generate a binary mask of the crack. After the crack image is acquired by the image acquisition device, the image is input into the visual segmentation model to automatically output a binary mask containing only the crack.
[0036] Preferably, the visual segmentation model includes at least one of the following: an image segmentation model, a deep learning-based segmentation model, and a large visual segmentation model. Specifically, the visual segmentation model may adopt any one of the traditional image segmentation technology, the deep learning-based segmentation model, and the large visual segmentation model, or a combination of two or more models to achieve efficient segmentation of crack images.
[0037] Specifically, step S104 also includes: using a connected domain labeling function to automatically divide the generated binary mask, and numbering each crack area. First, the connected domain of each crack is identified from the binary mask image using the connected domain labeling function, and then numbered from small to large according to the coordinate position of the upper left corner of the circumscribed rectangular box of each connected domain in the image coordinate system, and the crack number i=1, 2, 3... N. In addition, in the image coordinate system, the numbering is first performed according to the minimum y-axis coordinate of the upper left corner of the circumscribed rectangular box of the connected domain. When the y-axis coordinates are the same, the numbering is performed according to the minimum x-axis coordinate to ensure that the numbering order is arranged from top to bottom and from left to right.
[0038] Specifically, step S106 further includes: fitting all pixel coordinates in each connected domain based on the least squares linear fitting function to obtain the inclination angle of the crack in each connected domain. The inclination angle of the fitting line corresponding to different crack numbers i is θ i .
[0039] Specifically, step S108 also includes the following steps:
[0040] Step S1081: Based on the connected domain analysis method, the minimum area circumscribed rectangular frame of each crack is obtained, and the angle α of the minimum area circumscribed rectangular frame is extracted. i ;
[0041] Step S1082, comparing the angle α of the minimum area circumscribed rectangular frame i and the tilt angle θ iThe difference is corrected so that the angle of the rectangular frame is consistent with the crack direction, and the circumscribed rectangular frame of the crack area is obtained.
[0042] Specifically, step S110 further includes: dividing the circumscribed rectangular frame of each crack into a plurality of local units along the length direction, and assigning an ID number to each local unit. Specifically, the rectangular frame is divided into a plurality of local units along the length direction of the circumscribed rectangular frame of the crack, and the ID number of each unit is set to (i, j), where i represents the number of the crack, j represents the jth local unit of the crack, i=1, 2, 3,...N, j=1, 2, 3,...M.
[0043] Figure 3 is a schematic diagram of quantifying crack width in a local unit according to an embodiment of the present invention. Figure 3 As shown, specifically, step S112 also includes: firstly, calculating the center point coordinates of all crack pixels in the local unit coordinate system, and using the least squares method to linearly fit all crack pixel coordinates to obtain the slope of the fitting line, and then converting the slope to the global coordinate system to obtain the center point coordinates P of all crack pixels in the local unit. ij (x ij , y ij ) and the slope k of the fitted line ij .
[0044] Specifically, step S114 also includes the following steps:
[0045] Step S1141, traversing the crack edge pixel coordinates, and determining the edge line to which each crack edge pixel coordinate belongs based on the distance from each crack edge pixel coordinate to each corner point coordinate;
[0046] Step S1142 , performing sub-pixel interpolation on the pixel coordinates of the crack edge of each edge line, and performing linear fitting on the edge pixels on both sides using the least square method to obtain an edge fitting straight line.
[0047] Specifically, first, the pixel coordinates of the outermost edges of all crack pixels in the local unit (i, j) are found through the edge detection algorithm, and the coordinates of the four corner points are extracted through the corner detection algorithm and boundary conditions; then, each pixel in the outermost edge is traversed and classified into four edge lines (upper, right, lower, and left) according to the distance from the pixel coordinates to the four corner point coordinates. When traversing each pixel point, the angle between the point and the four corner points is calculated, and the edge line to which the point belongs is determined based on the minimum angle value.
[0048] Then, the extracted edge pixels are interpolated at a sub-pixel level, and the edge pixels on both sides are linearly fitted using the least squares method to obtain the edge fitting line. For the four distinguished edge line pixels, since two of the edge lines are the boundaries of the local unit, the other two are the crack edge lines used to calculate the crack width. Next, the pixels of the edge line are interpolated at a sub-pixel level, and the interpolation method is spline interpolation, or other appropriate interpolation algorithms can be selected. Then, the interpolation results of the crack edge lines on both sides are linearly fitted using the least squares method to obtain the slope k of the fitting line. Aij and k Bij .
[0049] Specifically, step S116 also includes: determining the normal line passing through the coordinates of the midline point on the centerline fitting line based on the slope of the centerline fitting line, and determining two intersection points of the normal line and the two edge fitting lines; and determining the Euclidean distance between the two intersection points as the crack width.
[0050] Specifically, Figure 3 As shown in the figure, the normal line of the crack pixel fitting line in the local unit passes through the crack pixel center point P of the unit. ij (x ij , y ij ), and intersect with the fitted straight lines of the edge lines on both sides. The two intersection points are A ij (x Aij , y Aij ) and B ij (x Bij , y Bij ), then the crack width value d of the local unit ij The calculation formula is as follows:
[0051]
[0052]
[0053]
[0054]
[0055]
[0056] In the formula, It is the transformation coefficient of image pixels into physical size information, which can be determined by known formulas or acquisition equipment; ( , )and( , ) are the coordinates of the known points on the fitting edge lines on both sides.
[0057] Specifically, step S118 also includes: traversing all local units of the crack in sequence to obtain the complete width parameter of the entire crack. As shown below. In addition, the maximum crack width can be obtained and its corresponding local unit position (i, j).
[0058]
[0059]
[0060] Optionally, the method provided by the present invention further comprises: determining the boundary according to the minimum and maximum width values of the cracks, and visually displaying the width distribution of all cracks through a cloud map.
[0061] Specifically, the minimum and maximum crack widths in the entire image are used as boundaries, different colors are used to represent the size changes of the crack widths, and the crack width distribution corresponding to each position is intuitively displayed on the original image.
[0062] The embodiment of the present invention provides a method for quantifying the width of multiple cracks based on machine vision and local unit method. By combining visual segmentation model, connected domain analysis, automatic crack numbering and division, local unit analysis, corner point detection and edge line pixel separation, and edge pixel sub-pixel interpolation, it realizes high-precision and high-efficiency quantification of multiple crack width parameters. This method effectively avoids the common error problems of traditional central axis refinement algorithm and crack direction mutation and edge parts. This quantification method provides reliable technical support for the quantitative evaluation of cracks on the surface of the structure, helping to reveal the stress mechanism of the structure and evaluate the safety of the structure.
[0063] Embodiment 2
[0064] Figure 4 Schematic diagram of a multi-crack width quantization system based on machine vision and local unit method provided according to an embodiment of the present invention. Figure 4 As shown, the system includes: a segmentation module 10, a first division module 20, a first fitting module 30, an analysis module 40, a second division module 50, a second fitting module 60, a third fitting module 70, a first determination module 80 and a second determination module 90.
[0065] Specifically, the segmentation module 10 is used to process the crack image of the civil engineering structure through the visual segmentation model to generate a binary mask of the crack;
[0066] A first segmentation module 20 is used to automatically segment the binary mask using a connected domain labeling function to identify the connected domain of each crack;
[0067] A first fitting module 30 is used to calculate the inclination angle of the crack by using linear fitting based on the pixel coordinates of the crack in each connected domain;
[0068] An analysis module 40 is used to generate a rectangular frame circumscribing the crack region consistent with the inclination angle by combining a connected domain analysis method;
[0069] A second division module 50 is used to divide each crack region circumscribed rectangular frame into a plurality of local units along the length direction;
[0070] A second fitting module 60 is used to extract the coordinates of crack pixels in each local unit, calculate the coordinates of the center points of all crack pixels, and perform linear fitting on all crack pixels in each local unit based on the crack pixel coordinates to obtain a center line fitting straight line and a slope of the center line fitting straight line;
[0071] A third fitting module 70 is used to extract the crack edge pixel coordinates and corner point coordinates in each local unit based on edge detection and corner point detection algorithms, and perform linear fitting based on the crack edge pixel coordinates and corner point coordinates to obtain an edge fitting line;
[0072] A first determination module 80 is used to determine the crack width of each local unit based on the center point coordinates, the center line fitting straight line, the slope of the center line fitting straight line and the edge fitting straight line;
[0073] The second determination module 90 is used to determine the complete crack width parameter of each crack based on the crack width of each local unit.
[0074] Specifically, the analysis module 40 is also used to: obtain the minimum area circumscribed rectangular frame of each crack based on the connected domain analysis method, and extract the angle of the minimum area circumscribed rectangular frame; compare the difference between the angle of the minimum area circumscribed rectangular frame and the inclination angle and make corrections to obtain the circumscribed rectangular frame of the crack area.
[0075] Specifically, the third fitting module 70 is also used to: traverse the crack edge pixel coordinates, and determine the edge line to which each crack edge pixel coordinate belongs based on the distance from each crack edge pixel coordinate to each corner point coordinate; perform sub-pixel interpolation on the crack edge pixel coordinates of each edge line, and use the least squares method to perform linear fitting on the edge pixels on both sides to obtain an edge fitting straight line.
[0076] Specifically, the first determination module 80 is also used to: determine the normal line passing through the coordinates of the midline point on the centerline fitting line based on the slope of the centerline fitting line, and determine the two intersection points of the normal line and the two edge fitting lines; determine the Euclidean distance between the two intersection points as the crack width.
[0077] The present invention further provides 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 provided in the embodiment of the present invention when executing the computer program.
[0078] The present invention further provides a computer-readable storage medium, in which program codes are stored. The program codes can be called by a processor to execute the method provided in the embodiment of the present invention.
[0079] It should be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0080] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0081] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0082] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0083] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0084] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0085] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0086] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0087] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0088] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for quantifying multiple crack widths based on machine vision and local element method, characterized in that: The method comprises: The crack images of civil engineering structures are processed by visual segmentation models to generate binary masks of cracks; Using a connected domain marking function to automatically divide the binary mask to identify the connected domain of each crack; Based on the pixel coordinates of the cracks in each connected domain, the tilt angle of the cracks is calculated using linear fitting; Combined with the connected domain analysis method, a rectangular frame circumscribing the crack region consistent with the tilt angle is generated; Divide the rectangular frame circumscribing each crack region into multiple local units along the length direction; Extracting the coordinates of crack pixels in each local unit, calculating the coordinates of the center points of all crack pixels, and performing linear fitting on all crack pixels in each local unit based on the crack pixel coordinates to obtain a center line fitting straight line and the slope of the center line fitting straight line; Based on edge detection and corner point detection algorithms, the crack edge pixel coordinates and corner point coordinates in each local unit are extracted, and linear fitting is performed based on the crack edge pixel coordinates and the corner point coordinates to obtain an edge fitting straight line; Determine the crack width of each local unit based on the center point coordinates, the center line fitting straight line, the slope of the center line fitting straight line and the edge fitting straight line; Based on the crack width of each local unit, a complete crack width parameter of each crack is determined.
2. The method according to claim 1, characterized in that The visual segmentation model includes at least one of the following: an image segmentation model, a deep learning-based segmentation model, and a large visual segmentation model.
3. The method according to claim 1, characterized in that The method uses linear fitting to calculate the inclination angle of the crack, including: fitting all pixel coordinates in each connected domain based on a least squares linear fitting function to obtain the inclination angle of the crack in each connected domain.
4. The method according to claim 1, characterized in that: Combined with the connected domain analysis method, a rectangular frame circumscribing the crack region consistent with the inclination angle is generated, including: Based on the connected domain analysis method, the minimum area circumscribed rectangular frame of each crack is obtained, and the angle of the minimum area circumscribed rectangular frame is extracted; The angle of the minimum area circumscribed rectangular frame and the tilt angle are compared and corrected to obtain the crack area circumscribed rectangular frame.
5. The method according to claim 1, characterized in that Performing linear fitting based on the crack edge pixel coordinates and the corner point coordinates to obtain an edge fitting straight line includes: Traversing the crack edge pixel coordinates, and determining the edge line to which each crack edge pixel coordinate belongs based on the distance from each crack edge pixel coordinate to each corner point coordinate; Sub-pixel interpolation is performed on the pixel coordinates of the crack edge of each edge line, and a least square method is used to perform linear fitting on the edge pixels on both sides to obtain the edge fitting straight line.
6. The method according to claim 1, characterized in that Determining the crack width of each local unit based on the center point coordinates, the center line fitting straight line, the slope of the center line fitting straight line and the edge fitting straight line includes: Based on the slope of the centerline fitting straight line, determine a normal line on the centerline fitting straight line passing through the coordinates of the midline point, and determine two intersection points of the normal line and the two edge fitting straight lines; The Euclidean distance between the two intersection points is determined as the crack width.
7. The method according to claim 1, characterized in that The method further includes: determining the boundary according to the minimum and maximum width values of the cracks, and visually displaying the width distribution of all the cracks through a cloud map.
8. A multi-crack width quantification system based on machine vision and local unit method, characterized in that: include: a segmentation module, a first division module, a first fitting module, an analysis module, a second division module, a second fitting module, a third fitting module, a first determination module and a second determination module; wherein, The segmentation module is used to process the crack image of the civil engineering structure through a visual segmentation model to generate a binary mask of the crack; The first segmentation module is used to automatically segment the binary mask using a connected domain labeling function to identify the connected domain of each crack; The first fitting module is used to calculate the inclination angle of the crack by using linear fitting based on the pixel coordinates of the crack in each connected domain; The analysis module is used to generate a circumscribed rectangular frame of the crack region consistent with the inclination angle in combination with a connected domain analysis method; The second division module is used to divide the circumscribed rectangular frame of each crack area into a plurality of local units along the length direction; The second fitting module is used to extract the crack pixel coordinates in each local unit, calculate the center point coordinates of all crack pixels, and perform linear fitting on all crack pixels in each local unit based on the crack pixel coordinates to obtain a center line fitting straight line and the slope of the center line fitting straight line; The third fitting module is used to extract the crack edge pixel coordinates and corner point coordinates in each local unit based on edge detection and corner point detection algorithms, and perform linear fitting based on the crack edge pixel coordinates and the corner point coordinates to obtain an edge fitting straight line; The first determination module is used to determine the crack width of each local unit based on the center point coordinates, the center line fitting straight line, the slope of the center line fitting straight line and the edge fitting straight line; The second determination module is used to determine a complete crack width parameter of each crack based on the crack width of each local unit.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Concrete surface crack width calculation method based on infinitesimal method
CN115953451A
Method for realizing crack measurement in 3D printing retaining wall construction process based on AFFormer
CN116777898A
Surface crack detection method based on image processing
CN117974627A
Crack width calculating method
JP2005157513A
Method and device for automatically drawing structural cracks and precisely measuring widths thereof
US20200364849A1
Cited By
Building structure maximum crack width detection method and system based on machine vision
CN120318230A
Method and system for detecting maximum crack width in building structures based on machine vision
CN120318230B
Tunnel crack positioning detection and change monitoring method based on prior knowledge
CN120522198A
Crack feature extraction and quantification method and device based on point cloud big language model
CN121259617A
Crack feature extraction and quantification method and device based on point cloud large language model
CN121259617B