Crack size measurement method based on image processing
Through an image processing-based method, combined with a software and hardware integrated system, automated, real-time crack size measurement is achieved, solving the problems of subjectivity and low efficiency of traditional measurement methods, providing high-precision crack disease detection and monitoring, and providing Infrastructure security assessments provide critical support.
Patent Information
- Application Number
- CN202410669083.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-09-03
AI Technical Summary
Traditional crack measurement methods have problems such as highly subjective detection results, high missed detection rate of diseases, low detection efficiency, high cost, and inability to achieve real-time and uninterrupted monitoring, making it impossible to effectively monitor crack diseases in infrastructure.
Using an image processing-based method, by acquiring target point images around the crack, binary processing, morphological operations, orthographic transformation and contour detection are performed to achieve high-precision crack length and width measurement, combined with a software and hardware integrated system , to achieve automated, real-time crack size measurement.
It achieves high-efficiency, low-cost, real-time, non-contact, and high-precision crack size measurement, provides intelligent crack disease detection and monitoring technology, and provides important support for infrastructure safety status assessment.
Smart Images

Figure CN118583052A
Abstract
Description
Technical Field
[0001] The invention relates to the field of image vision measurement and deformation monitoring, and in particular to a crack size measurement method based on image processing. Background Art
[0002] Under long-term use and environmental influences, infrastructure structures will suffer various damages and degradations, such as deformation, tilting, cracking, etc., which will affect their safety performance and service life. In recent years, many urban infrastructure structure safety accidents have occurred at home and abroad, causing a large number of casualties and property losses. Therefore, effective safety monitoring and early warning of urban infrastructure structures is an important measure to ensure urban safety and sustainable development.
[0003] Cracks are important parameters that characterize the state of concrete structures during load-bearing. As one of the most common forms of infrastructure structural defects, the appearance and expansion of cracks on components will seriously threaten the durability and overall structural performance of infrastructure. For example, when cracks occur on the road surface, the vehicle load will cause further damage to both sides of the cracks, causing large-scale damage to the road surface and increasing road maintenance costs; when cracks occur on bridges, the bridge's anti-penetration ability will be reduced, causing problems such as steel corrosion and concrete carbonization, leading to the degradation of the bridge's bearing capacity and even causing accidents such as bridge collapse; when cracks occur in tunnels, the safe operation of the tunnel will be affected.
[0004] Therefore, it is of great significance to quickly and accurately find the location of cracks and obtain the crack size in time. Traditional crack measurement mainly relies on manual visual methods, using instruments such as crack rulers, crack microscopes, vernier calipers, strain gauges, displacement meters, etc. However, the above methods are greatly affected by the inspection personnel and supporting facilities, and there are problems such as strong subjectivity in the inspection results, high rate of missed detection of defects, low inspection efficiency, and high cost. Moreover, they can only reflect the measurement information of a single point, and cannot monitor crack defects in real time and continuously, which has considerable limitations.
[0005] With the rapid development of information technology, digital image processing technology has been widely used in various types of detection. The present invention obtains digital images and other information through machine vision elements, and uses relevant algorithms for automatic data processing. It can identify multiple cracks at one time and achieve high-precision sub-millimeter crack length and width measurement, which plays a role in replacing manual eye operations. Therefore, providing a method for high-efficiency, low-cost, real-time, non-contact, high-precision, and automated ground crack size measurement provides a promising intelligent technology route for crack disease detection and monitoring, and provides important technical support for infrastructure safety status assessment. It is a problem that technicians in this field urgently need to solve. Summary of the invention
[0006] In view of this, the present invention provides a crack size measurement method based on image processing, which can achieve the effect of high efficiency, low cost, real-time, non-contact, high precision and automatic ground crack size measurement.
[0007] In order to achieve the above object, the present invention adopts the following technical solution:
[0008] A crack size measurement method based on image processing comprises the following steps:
[0009] S1, acquiring a crack image with target points set around the crack;
[0010] S2, performing binarization processing on the crack image in S1 to obtain a binary crack image;
[0011] S3, removing noise points and connected areas smaller than a preset threshold in the binary crack image through multiple morphological dilation and erosion operations to obtain a processed crack image;
[0012] S4, calculating the conversion relationship between the pixel coordinate system and the actual coordinate system based on the target point, and performing ortho transformation and reduction transformation on the processed crack image;
[0013] S5, performing contour detection on the crack image, obtaining all contour lines in the crack image, sorting and counting all contour lines based on a length threshold set by the user, setting contour lines exceeding the threshold as cracks to be identified and measured, filling the contour area with a preset color, and filling the area outside the contour with another preset color;
[0014] S6. measuring the maximum width and length of each crack area;
[0015] S7. Multiply the crack position, crack length, and maximum crack width by the scaling parameter to obtain the actual size of the crack in the actual coordinate system.
[0016] In the above method, optionally, the specific content of S4 is:
[0017] Firstly, the target points in the processed crack image are matched by the template matching method to obtain the pixel coordinates of the target points in the processed crack image. The actual coordinates of the target points are assumed based on the known actual distance between the target points. Based on the pixel coordinates of the target points, the actual coordinates and the scaling parameters set by the user, the processed crack image is ortho-transformed and reduced.
[0018] The above method optionally fills the inside of the outline area with white and the outside with black.
[0019] In the above method, optionally, the maximum width measurement in S6 specifically includes the following contents:
[0020] The crack contour area is white, that is, non-zero value pixels, and the outside is black, that is, zero value pixels. The non-zero value pixels in the image are looped, and the distance between them and the nearest zero value pixels is calculated. The pixel coordinates and distance information of each pixel are recorded, and finally the point with the largest distance is found, which is the position of the maximum width and the maximum width value.
[0021] The above method can be optionally performed by measuring the length in S6, obtaining a skeleton line image for the crack contour area, and performing a burr-removing process on the skeleton line, which specifically includes the following steps:
[0022] 1) Obtain all endpoints and branch points in the skeleton line graph based on the eight-neighborhood method;
[0023] 2) If the number of endpoints is greater than 2, find the maximum convex hull for all endpoints, obtain the two points with the farthest distance on the convex hull, and exclude these two points from all endpoint sets;
[0024] 3) Loop the new endpoint set, and start from each endpoint to perform the connected area disappearance processing based on the eight-neighborhood method. If an L-shaped endpoint is encountered, the point is set to zero, and then return to step 1) and stop if a branch point is encountered;
[0025] 4) performing step 1) again on the skeleton line processed in step 3) until the number of endpoints is less than or equal to 2;
[0026] 5) Count the total number of all non-zero pixel points in the skeleton line graph, which is the length of the crack in the transformed pixel coordinate system.
[0027] It can be seen from the above technical solution that compared with the prior art, the present invention provides a crack size measurement method based on image processing, which has the following beneficial effects: the patent of the present invention realizes the identification, extraction and size measurement of infrastructure structure cracks based on the image processing method. By developing an integrated hardware and software system, the application of the patent of the present invention can realize high-efficiency, low-cost, real-time, non-contact, high-precision and automatic ground crack size measurement, which provides a promising intelligent technology route for crack disease detection and monitoring, and provides important technical support for infrastructure safety status assessment. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0029] Figure 1A flow chart of a crack size measurement method based on image processing disclosed in the present invention;
[0030] Figure 2 A specific flow chart of a crack size measurement method based on image processing disclosed in the present invention;
[0031] Figure 3 A schematic diagram of an image processing process for measuring crack size using the present invention disclosed in an embodiment of the present invention;
[0032] Figure 4 Schematic diagram of target points in an embodiment of the present invention;
[0033] Figure 5 Schematic diagram for explaining point types in an embodiment of the present invention. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, the elements defined by the sentence "comprise one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0036] Reference Figure 1-Figure 2 As shown, the present invention discloses a crack size measurement method based on image processing, comprising the following steps:
[0037] S1, acquiring a crack image with target points set around the crack;
[0038] S2, performing binarization processing on the crack image in S1 to obtain a binary crack image;
[0039] S3, removing noise points and connected areas smaller than a preset threshold in the binary crack image through multiple morphological dilation and erosion operations to obtain a processed crack image;
[0040] S4, calculating the conversion relationship between the pixel coordinate system and the actual coordinate system based on the target point, and performing ortho transformation and reduction transformation on the processed crack image;
[0041] S5, performing contour detection on the crack image, obtaining all contour lines in the crack image, sorting and counting all contour lines based on a length threshold set by the user, setting contour lines exceeding the threshold as cracks to be identified and measured, filling the contour area with a preset color, and filling the area outside the contour with another preset color;
[0042] S6. measuring the maximum width and length of each crack area;
[0043] S7. Multiply the crack position, crack length, and maximum crack width by the scaling parameter to obtain the actual size of the crack in the actual coordinate system.
[0044] Furthermore, the specific content of S4 is:
[0045] Firstly, the target points in the processed crack image are matched by the template matching method to obtain the pixel coordinates of the target points in the processed crack image. The actual coordinates of the target points are assumed based on the known actual distance between the target points. Based on the pixel coordinates of the target points, the actual coordinates and the scaling parameters set by the user, the processed crack image is ortho-transformed and reduced.
[0046] Furthermore, the inside of the outline area is filled with white and the outside is filled with black.
[0047] Furthermore, the maximum width measurement in S6 specifically includes the following:
[0048] The crack contour area is white, that is, non-zero value pixels, and the outside is black, that is, zero value pixels. The non-zero value pixels in the image are looped, and the distance between them and the nearest zero value pixels is calculated. The pixel coordinates and distance information of each pixel are recorded, and finally the point with the largest distance is found, which is the position of the maximum width and the maximum width value.
[0049] Furthermore, the length measurement in S6 obtains a skeleton line image of the crack contour area, and performs a burr-removing process on the skeleton line, which specifically includes the following steps:
[0050] 1) Obtain all endpoints and branch points in the skeleton line graph based on the eight-neighborhood method;
[0051] 2) If the number of endpoints is greater than 2, find the maximum convex hull for all endpoints, obtain the two points with the farthest distance on the convex hull, and exclude these two points from all endpoint sets;
[0052] 3) Loop the new endpoint set, and start from each endpoint to perform the connected area disappearance processing based on the eight-neighborhood method. If an L-shaped endpoint is encountered, the point is set to zero, and then return to step 1) and stop if a branch point is encountered;
[0053] 4) performing step 1) again on the skeleton line processed in step 3) until the number of endpoints is less than or equal to 2;
[0054] 5) Count the total number of all non-zero pixel points in the skeleton line graph, which is the length value of the crack in the transformed pixel coordinate system.
[0055] In a specific embodiment, see Figure 3 As shown, a crack size measurement method based on image processing is provided, including the following specific steps:
[0056] 1. Install four target points arranged in a clockwise direction in the crack image area. The target points are located at the four corner points of a square with a known actual side length of D, namely P1, P2, P3, and P4; see Figure 4 Shown is a schematic diagram of the target point.
[0057] 2. Take pictures to obtain the crack image in the area and perform binarization processing on the image.
[0058] 3. Use template matching to find the target points in the image and obtain the pixel coordinates of the center of the target points, which are P′1(x1, y1), P′2(x2, y2), P′3(x3, y3), and P′4(x4, y4).
[0059] 4. In the image obtained in step 1, the pixel value of the target point area is set to zero, and then the noise points and small connected areas in the image are removed by performing morphological dilation and erosion operations repeatedly.
[0060] 5. Based on the actual distances between the target points, the actual coordinates of the target points are assumed to be P1 (0, 0), P2 (D, 0), P3 (D, D), and P4 (0, D).
[0061] 6. Calculate the transformation matrix parameter Mat from the perspective transformation of the original image to the target image based on the pixel coordinates and actual coordinates of the target point.
[0062] In order to improve the efficiency of image processing, the scaling parameter S is set. Reducing the image size before processing will greatly improve the processing efficiency and shorten the processing time. According to the transformation matrix parameter Mat and the scaling parameter S, the image in step 4 is perspective transformed and scaled.
[0063] 7. Perform contour detection on the image in step 6 to obtain a contour set, set a contour line length threshold L, and retain contours with a length greater than L in the contour line set, which is the crack set to be measured.
[0064] 8. Measure and process each crack in the crack set in step 7. The steps are as follows:
[0065] First, measure the maximum width of the crack:
[0066] a. Loop through the non-zero value pixels in the crack area. For each pixel, assume that the initial radius R = 1, and search for zero-value pixels in a circle with the pixel coordinates as the center and a radius of R. If no zero-value pixels are found, then R = R + 1, and continue searching in a new circle until at least one zero-value pixel is found in the current circle. Then stop and add the current radius value R to the set Rlist. b. After the loop in a is completed, find the maximum value in the set Rlist, which is the maximum width W of the crack in the pixel coordinate system. pixel .
[0067] Secondly, the length of the crack is measured: see Figure 5 , which is a schematic diagram for explaining the point types in this embodiment;
[0068] a. Obtain the skeleton line image of the crack area based on the skeleton line algorithm. Due to the irregular shape of the crack contour area and various small branches, there are small branch skeleton lines on the skeleton line image. If the number of non-zero value pixels on the skeleton line image is directly counted as the length of the crack in the pixel coordinate system, the value is inaccurate and the result is not the maximum length of the entire crack. It is necessary to first remove the burr branches from the skeleton line.
[0069] b. Assume that the set of all endpoints of the pixels on the skeleton line is EndPoints = [], and the set of all branch points is BranchPoints = [].
[0070] c. Loop through the points on the skeleton line obtained in a. First, calculate the 8-neighborhood value val_8 for each pixel.
[0071] If val_8=0, it means that the current pixel type is an isolated point, and the pixel value of the current point in the skeleton line graph is set to 0;
[0072] If val_8=1, it means the current pixel type is endpoint, and the current pixel is added to EndPoints;
[0073] If val_8 = 2, it means that the current pixel type is an intermediate point or an L-shaped three-way point. Next, further confirm the point type and obtain the pixel values v of the eight pixels around the current pixel in pairs. left and v right, if v left ≠0 and v right ≠0, indicating that the current pixel point type is an L-type three-way point, the pixel value of the current point in the skeleton line graph is set to 0, and step b is repeated for the current skeleton line graph; otherwise, it indicates that the current pixel point type is an intermediate point;
[0074] If val_8=3, it means the current pixel type is a branch point, and the current pixel is added to BranchPoints;
[0075] d. If the number of EndPoints obtained in b is greater than 2, obtain the convex hull of the EndPoints point set, calculate the distance between all the points that constitute the convex hull, obtain the two points with the farthest distance, and remove the two points from EndPoints;
[0076] e. If the number of EndPoints is greater than 0, it means that there are branch lines on the skeleton line and the branch lines need to be cleared. Execute steps f and g. Otherwise, it means that the branch lines on the skeleton line have been cleared and there are no branch lines. Execute step h.
[0077] f, loop through the points in EndPoints, assuming i = 1, and CurrentPoint = P i ;
[0078] g. In the skeleton line graph, count the pixel values of the 8 points around the current pixel CurrentPoint, then set the pixel value at CurrentPoint to 0, and add the non-zero pixel coordinates to the set PTS to determine whether PTS and BranchPoints have an intersection. If so, it means that the current pixel is adjacent to the branch point, i = i + 1. If i ≤ length (EndPoints) - 1, CurrentPoint = PTS. i , continue with step g, otherwise execute step c again; if not, it means that the current pixel point and the branch point are not in close proximity. If the number of points in PTS is greater than 0, then set the first point in PTS as the current pixel point, CurrentPoint=PTS[0], continue with step g, if the number of points in PTS is 0, then i=i+1, if i≤length(EndPoints)-1, CurrentPoint=P i , continue to step g, otherwise
[0079] Execute step c again;
[0080] h, the total number of non-zero pixel points in the skeleton line graph is the length of the crack in the pixel coordinate system L pixel ;
[0081] 9. Use W pixel and L pixel Multiply by the scaling parameter S to get the true size of the crack in the actual coordinate system, that is, the maximum width of the crack W = W pixel ×S, crack length value L = L pixel ×S.
[0082] In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to function. 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 beyond the scope of the present invention.
[0083] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A crack size measurement method based on image processing, characterized in that: The following steps are involved: S1, acquiring a crack image with target points set around the crack; S2, performing binarization processing on the crack image in S1 to obtain a binary crack image; S3, removing noise points and connected areas smaller than a preset threshold in the binary crack image through multiple morphological dilation and erosion operations to obtain a processed crack image; S4, calculating the conversion relationship between the pixel coordinate system and the actual coordinate system based on the target point, and performing ortho transformation and reduction transformation on the processed crack image; S5, performing contour detection on the crack image, obtaining all contour lines in the crack image, sorting and counting all contour lines based on a length threshold set by the user, setting contour lines exceeding the threshold as cracks to be identified and measured, filling the contour area with a preset color, and filling the area outside the contour with another preset color; S6. measuring the maximum width and length of each crack area; S7. Multiply the crack position, crack length, and maximum crack width by the scaling parameter to obtain the actual size of the crack in the actual coordinate system.
2. The crack size measurement method based on image processing according to claim 1, characterized in that: The specific contents of S4 are: Firstly, the target points in the processed crack image are matched by the template matching method to obtain the pixel coordinates of the target points in the processed crack image. The actual coordinates of the target points are assumed based on the known actual distance between the target points. Based on the pixel coordinates of the target points, the actual coordinates and the scaling parameters set by the user, the processed crack image is ortho-transformed and reduced.
3. The crack size measurement method based on image processing according to claim 1 is characterized in that: Fill the inside of the outline area with white and the outside with black.
4. The crack size measurement method based on image processing according to claim 3 is characterized in that: The maximum width measurement in S6 includes the following: The crack contour area is white, that is, non-zero value pixels, and the outside is black, that is, zero value pixels. The non-zero value pixels in the image are looped, and the distance between them and the nearest zero value pixels is calculated. The pixel coordinates and distance information of each pixel are recorded, and finally the point with the largest distance is found, which is the position of the maximum width and the maximum width value.
5. The crack size measurement method based on image processing according to claim 4 is characterized in that: In S6, the length measurement is performed, a skeleton line image is obtained for the crack contour area, and the skeleton line is processed to remove burrs and branches, which specifically includes the following steps: 1) Obtain all endpoints and branch points in the skeleton line graph based on the eight-neighborhood method; 2) If the number of endpoints is greater than 2, find the maximum convex hull for all endpoints, obtain the two points with the farthest distance on the convex hull, and exclude these two points from all endpoint sets; 3) Loop the new endpoint set, and start from each endpoint to perform the connected area disappearance processing based on the eight-neighborhood method. If an L-shaped endpoint is encountered, the point is set to zero, and then return to step 1) and stop if a branch point is encountered; 4) performing step 1) again on the skeleton line processed in step 3) until the number of endpoints is less than or equal to 2; 5) Count the total number of all non-zero pixel points in the skeleton line graph, which is the length of the crack in the transformed pixel coordinate system.
Citation Information
Patent Citations
Pavement crack digital image extraction, crack repair and crack parameter calculation method
CN112419250A
Hilly pond dam displacement monitoring method based on image recognition
CN112508982A
Crack size measurement method based on image connectivity and skeleton analysis
CN115578343A
Fishway crack intelligent detection method based on depth and gray scale information
CN115690040A
Crack monitoring method
CN116626061A
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
