Concrete crack image recognition method, system, equipment, medium and program
By pre-processing and image segmentation of concrete crack images, combining image processing and machine learning technology to extract feature information, and inputting recognition models for identification, the problem of difficulty in extracting digital image features of concrete cracks in the prior art is solved, and high-precision recognition results are achieved.
Patent Information
- Application Number
- CN202411674562.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-04-25
AI Technical Summary
In the prior art, it is difficult to extract feature of digital images of concrete cracks, resulting in insufficient accuracy of recognition results and difficult to meet the needs of practical applications.
By acquiring concrete crack images and pre-processing, including denoising and contrast enhancement, the image is then subdivided into sub-regions by using advanced image segmentation technology; finally, combining multiple image processing techniques and machine learning algorithms, multiple key feature information of the cracks are extracted and input into specially trained recognition models for identification.
It reduces the difficulty of feature extraction, improves the accuracy of the final identification results, meets the needs of practical applications, and realizes accurate identification of concrete cracks.
Smart Images

Figure CN119887618A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to a method, system, equipment, medium and program for concrete crack image recognition. Background Art
[0002] Concrete crack detection plays a vital role in the safety assessment and maintenance management of concrete structures. The presence of cracks not only affects the overall stability and durability of the structure, but may also become a channel for potential problems such as water penetration and steel corrosion, thereby accelerating the deterioration of the structure. However, traditional concrete crack detection methods mainly rely on manual visual inspection, which is not only time-consuming and labor-intensive, but also inefficient, and is limited by the experience and subjective judgment of the inspectors, making it difficult to ensure the accuracy and consistency of the test results. Especially for tiny cracks or hidden cracks in complex structures, manual detection is often unable to achieve full coverage, which undoubtedly increases the difficulty and cost of detection.
[0003] In addition, manual inspection also faces challenges such as harsh working environment and high labor intensity. Inspectors need to work in high altitude, narrow or dangerous environments, which not only has low work efficiency but also poses high safety risks. With the widespread application of concrete structures and the increase in service life, the demand for crack detection is increasing. Traditional inspection methods can no longer meet the requirements of large-scale, high-efficiency and high-precision inspection.
[0004] With the rapid development of computer technology and image processing technology, digital, automated and intelligent concrete crack detection technology has emerged, providing a new way to solve the limitations of traditional detection methods. Image processing technology can automatically identify and extract crack features through the analysis and processing of digital images of concrete cracks, and realize quantitative evaluation of cracks. However, although the application of image processing technology in concrete crack detection has made certain progress, there are still many problems that need to be improved and perfected.
[0005] In the feature extraction and analysis stage of concrete crack digital images, how to accurately and efficiently extract the boundary feature information and regional feature information of cracks, such as crack length, width, area, etc., is crucial for quantitative evaluation and damage diagnosis of cracks. However, existing feature extraction methods often have problems such as large amount of calculation and insufficient accuracy, which makes it difficult to meet the needs of practical applications. Summary of the invention
[0006] In view of the problem in the prior art that it is difficult to extract features of digital images of concrete cracks, resulting in insufficient accuracy of the final recognition results and difficulty in meeting the needs of practical applications, the present invention provides a method for recognizing digital images of concrete cracks, which reduces the difficulty of feature extraction, improves the accuracy of the final recognition results and meets the needs of practical applications.
[0007] In order to achieve the above object, the present invention provides the following technical solutions.
[0008] In a first aspect, the present invention provides a method for recognizing concrete crack images, comprising: Acquire a concrete crack image, and preprocess the image to obtain a preprocessed concrete crack image; Performing image segmentation processing on the pre-processed concrete crack image to obtain a segmented concrete crack image; Perform feature extraction on the segmented concrete crack image to obtain feature information of the concrete crack image; The concrete crack image feature information is input into the concrete crack recognition model to obtain the concrete crack image recognition result.
[0009] As a further improvement of the present invention, the step of acquiring a concrete crack image and preprocessing the image to obtain a preprocessed concrete crack image includes: Collect concrete crack images; The grayscale linear transformation and histogram equalization in the spatial domain image enhancement algorithm are selected to increase the contrast of the concrete crack image in the digital image, the adaptive median filter is used to perform digital image smoothing and noise reduction on the concrete crack image, and the second-order differential operator Laplace operator is used to perform crack sharpening and enhancement processing on the concrete crack image to obtain the preprocessed concrete crack image.
[0010] As a further improvement of the present invention, the image segmentation processing is performed on the pre-processed concrete crack image to obtain the segmented processed concrete crack image, including: Perform edge detection on the pre-processed concrete crack image and divide the image into several regions; Afterwards, the K-means clustering segmentation algorithm is used to segment the concrete crack digital image to obtain a segmented concrete crack image.
[0011] As a further improvement of the present invention, the pre-processed concrete crack image is subjected to edge detection using a Canny operator to divide the image into several regions, including: The concept of pre-processed concrete crack image segmentation is expressed in the form of a set. I is taken to represent the spatial area of the entire digital image. The pre-processed concrete crack image segmentation process is regarded as dividing the image I into n sub-areas: I1, I2, I3, ···, In; the n sub-areas obtained after segmentation satisfy: ,In the preprocessed concrete crack image, each pixel must be segmented into a certain sub-region; All sub-regions in Ii (i=1, 2, ···, n) come from the digital image I and have a predetermined connectivity form; i≠j (i and j are both 1, 2, ···, n), And Ii and Ij are not empty sets; Define Q(Rk) as a certain logical predicate on the set Rk, corresponding to the predetermined segmentation detection criteria in the pre-processed concrete crack image segmentation process, Q(Ri)=TRUE represents that the pixels in each of the n sub-regions obtained after the pre-processed concrete crack image segmentation satisfy certain predetermined characteristics, Q(Ri∪Ri+1)=FALSE represents that the related characteristics of adjacent sub-regions after the pre-processed concrete crack image segmentation on the logical Q must be different; this condition is that after the pre-processed concrete crack image segmentation process, the pixels in each sub-region must have similar features, and there must be difference features between adjacent sub-regions that can be significantly distinguished according to the segmentation criteria.
[0012] As a further improvement of the present invention, the step of extracting features from the segmented concrete crack image to obtain feature information of the concrete crack image includes: Boundary feature extraction and regional feature extraction are performed on the segmented concrete crack image to obtain feature information of the concrete crack image; The boundary feature extraction comprises: A morphological closing operation is performed on the concrete crack image to obtain a binary image of the concrete crack after the morphological closing operation, and the contour line is extracted. The chain code is used to calculate the length of the contour line and perform boundary feature extraction.
[0013] As a further improvement of the present invention, the step of inputting the concrete crack image feature information into the concrete crack recognition model to obtain the concrete crack image recognition result includes: The concrete crack image feature information is divided into a training set and a validation set; The concrete crack recognition model is trained using a training set in the concrete crack image feature information to obtain a trained concrete crack recognition model; The verification set in the concrete crack image feature information is input into the trained concrete crack recognition model for verification and recognition to obtain the image recognition result.
[0014] In a second aspect, the present invention provides a concrete crack image recognition system, comprising: Preprocessing module: used to obtain concrete crack images and preprocess the images to obtain preprocessed concrete crack images; Segmentation image module: used to perform image segmentation processing on the pre-processed concrete crack image to obtain a segmented processed concrete crack image; Feature extraction module: used to extract features from the segmented concrete crack image and obtain feature information of the concrete crack image; Recognition result module: used to input the concrete crack image feature information into the concrete crack recognition model to obtain the concrete crack image recognition result.
[0015] In a third aspect, the present invention 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 steps of the method for identifying concrete crack images when executing the computer program.
[0016] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the concrete crack image recognition method are implemented.
[0017] In a fifth aspect, the present invention provides a computer program product, characterized in that it includes computer instructions, which, when executed by a processor, implement the steps of the concrete crack image recognition method.
[0018] Compared with the prior art, the present invention has the following beneficial effects: The method first obtains the original image containing concrete cracks by image acquisition means, and immediately performs preprocessing to effectively remove noise in the image and enhance the contrast between cracks and background, laying a solid foundation for subsequent processing. The preprocessed image is clearer and the crack features are more prominent, which reduces the processing difficulty for subsequent steps. In addition, the method adopts advanced image segmentation technology to finely segment the preprocessed image. The crack area is accurately distinguished from the background and other interferences to obtain the concrete crack image after segmentation. This fine segmentation not only improves the pertinence of feature extraction, but also reduces the interference of useless information, further improving the efficiency and accuracy of subsequent processing. In the feature extraction stage, the present invention combines a variety of image processing technologies and machine learning algorithms to conduct in-depth analysis of the segmented crack image, and extracts a variety of key feature information including crack length, width, direction, morphology, etc. These feature information comprehensively and accurately reflects the actual condition of the crack, providing a reliable basis for subsequent identification. Finally, the extracted feature information is input into a specially trained concrete crack recognition model to accurately identify the type, degree and other information of the crack, and output a high-precision recognition result. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are for illustrative purposes only and are not intended to limit the scope of the present disclosure in any way. In the drawings: Figure 1A schematic diagram of a flow chart of a concrete crack image recognition method of the present invention; Figure 2 It is a structural schematic diagram of a concrete crack image recognition system of the present invention; Figure 3 Schematic diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. The described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present invention.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0022] Aiming at the problem that it is difficult to extract the features of digital images of concrete cracks in the prior art, resulting in insufficient accuracy of the final recognition result and difficulty in meeting the needs of practical applications, the present invention provides a method for recognizing digital images of concrete cracks, such as Figure 1 As shown, the method includes: S1: Acquire a concrete crack image, and preprocess the image to obtain a preprocessed concrete crack image; S2: performing image segmentation processing on the pre-processed concrete crack image to obtain a segmented concrete crack image; S3: extracting features from the segmented concrete crack image to obtain feature information of the concrete crack image; S4: Inputting the concrete crack image feature information into the concrete crack recognition model to obtain the concrete crack image recognition result.
[0023] The present invention reduces the difficulty of feature extraction, improves the accuracy of the final recognition result, and meets the needs of practical applications.
[0024] The present invention is further explained below.
[0025] The present invention provides a method for digital image recognition of concrete cracks, comprising: S1: collecting images of concrete cracks to obtain concrete crack images, and preprocessing the obtained concrete crack images; For the preprocessing of concrete crack images, the grayscale linear transformation and histogram equalization in the spatial domain image enhancement algorithm are used to increase the contrast of concrete cracks in the digital image. The adaptive median filter is used to smooth and reduce the noise of the concrete crack image. The second-order differential operator Laplacian operator is used to perform crack sharpening and enhancement processing on the concrete crack image.
[0026] Specifically, the concrete crack image adopts the RGB model, and the concrete crack RGB digital image is converted into a grayscale image according to the needs to reduce the amount of calculation of digital image processing. The component method of graying the RGB digital image does not require calculation, and directly selects the component corresponding to one of the three channels of R, G, and B as the grayscale value according to actual needs.
[0027] The weighted average method is used as the grayscale calculation for digital images.
[0028] The conversion formula is: Gray=(Red*0.30+Green*0.59+Blue*0.11).
[0029] When the weighted average method is used to obtain the grayscale image of concrete cracks, the importance of color to the concrete cracks of the research object is relatively low, which effectively reduces the amount of calculation and improves the calculation efficiency of image grayscale processing.
[0030] The grayscale distribution histogram of the grayscale image obtained by the weighted average method shows a large difference in the frequency of occurrence of adjacent grayscale levels. This is based on the inconsistent weight distribution of the human eye's sensitivity to the colors corresponding to the three channel components of R, G, and B. Therefore, the system function rgb2gray in MATLAB can be selected to grayscale the image to obtain the grayscale image of concrete cracks.
[0031] Digital image noise is regarded as a multidimensional random process, and the probability density function (PDF) in the random process can be used to reduce image noise.
[0032] The image data of concrete cracks containing the target object are enhanced using spatial domain and frequency domain methods respectively.
[0033] Based on the grayscale image obtained by histogram equalization after grayscale linear transformation of the digital image of concrete cracks, image smoothing processing is carried out. Mean filtering, median filtering, and the improved adaptive mean filtering, adaptive median filtering, and modified adaptive mean filtering are used for image smoothing processing. At the same time, the smoothing effects of template filters of different sizes are compared and analyzed.
[0034] S2: performing image segmentation processing on the pre-processed concrete crack image to obtain a segmented concrete crack image; In the crack edge detection in the digital image of concrete cracks, the Canny operator is used for preprocessing the edge detection of the digital image of concrete cracks compared with the serial boundary segmentation; in the crack segmentation field analysis of the digital image of concrete cracks, the K-means clustering segmentation algorithm is used to segment the digital image of concrete cracks.
[0035] Specifically, the pretreatment of concrete crack image processing is an essential preparation for digital image recognition and analysis. The quality of pretreatment concrete crack image segmentation is directly related to subsequent image feature recognition, parameter analysis and other image processing links.
[0036] The digital image is divided into several regions according to the characteristic information of the pre-processed concrete crack image, such as grayscale change, color distribution, shape contour and texture interval.
[0037] The concept of pre-processed concrete crack image segmentation is expressed in the form of a set. I is taken to represent the spatial area of the entire digital image. The pre-processed concrete crack image segmentation process is regarded as dividing the image I into n sub-areas: I1, I2, I3, ···, In. The n sub-areas obtained after segmentation meet the following conditions: (1) ,The whole pre-processed concrete crack image is completely segmented, and each pixel point must be segmented into a certain sub-region; (2) Ii (i=1, 2, ···, n) forms a connected set, which proves that all sub-regions come from the digital image I and have the predetermined connectivity form; (3) For all i≠j (i and j are 1, 2, ···, n), And Ii and Ij are not empty sets. Although the sub-regions are interconnected, they are completely independent and do not intersect with each other. The sub-region to which each pixel of the digital image belongs is unique. (4) Define Q(Rk) as a certain logical predicate on the set Rk, corresponding to the predetermined segmentation detection criteria in the pre-processed concrete crack image segmentation process, Q(Ri) = TRUE means that the pixels in each of the n sub-regions obtained after the pre-processed concrete crack image segmentation satisfy certain predetermined characteristics, and Q(Ri∪Ri+1) = FALSE means that the related characteristics of adjacent sub-regions after the pre-processed concrete crack image segmentation on the logical Q must be different. This condition can be summarized as the pixels in each sub-region after the pre-processed concrete crack image segmentation process must have similar features, and there must be different features between adjacent sub-regions that can be significantly distinguished according to the segmentation criteria.
[0038] The image segmentation of concrete crack images uses grayscale images as the segmentation object. The Canny operator can more accurately detect the edge boundaries of concrete cracks and effectively reduce the influence of interference factors such as local details and noise in the uncracked concrete area.
[0039] In the pre-processing concrete crack image segmentation process, K-means clustering algorithm is usually used to enhance the segmentation effect: The principle of K-means clustering algorithm is to divide the data samples in the research object into k independent data sub-samples, randomly generate k initial cluster centers, calculate the distance from each data sample to the cluster center, and select absolute value distance, Euclidean distance, Manhattan distance and Chebyshev distance according to the needs of actual application, and use the calculated distance as the data similarity judgment standard. The smaller the distance between data samples, the higher the similarity and the smaller the difference. Conversely, the larger the distance, the lower the similarity and the greater the difference. The distance calculation method is Euclidean distance:
[0040] According to the calculated distances from each data sample to different cluster centers, the data samples are assigned to the cluster centers with the smallest distance and the highest similarity, forming k cluster segmented data sub-sample groups. Then the data average of the newly formed k cluster segmented data sub-samples is calculated as the new cluster center, and the above operation is repeated until the cluster centers calculated twice are basically the same, and the segmentation calculation is terminated.
[0041] The termination condition of the iterative calculation of the cluster center is that the cluster center remains basically stable, each data sample is only assigned to the class where the unique cluster center is located, there is no duplicate data sample, and the error square sum criterion function meets the given maximum error requirement. The error square sum criterion function is a function for evaluating clustering performance, and the appropriate maximum error can be selected according to the needs. For the digital image of concrete cracks, the maximum error selected is 0.001, which can basically meet the segmentation requirements. The structure of the error square sum criterion function is as follows:
[0042] The K-means clustering segmentation algorithm is used to segment the original grayscale image of the concrete crack digital image. The highlighting effect of the concrete cracks increases with the increase in the number of classifications, but at the same time, the weakening effect on the local details of the uncracked concrete area is weakened. The K-means clustering segmentation algorithm has limited changes in the grayscale values of the overall pixels of the image in the segmentation of the concrete crack image preprocessing. Therefore, the overall information of the concrete crack digital image is still retained to a great extent after segmentation, and the highlighting effect of the concrete cracks is also limited.
[0043] After preprocessing, the grayscale values of pixels in the uncracked concrete area in the digital image of concrete cracks are mostly close to the grayscale level 255. Therefore, the weakening effect of the K-means clustering segmentation algorithm on the local details of the uncracked concrete area is negligible when using different numbers of classifications. According to the segmentation effect of the original grayscale image, the number of classifications is tried to be 5 for segmentation. The K-means clustering segmentation algorithm has a certain weakening effect on the larger local details in the uncracked concrete area in the digital image of concrete cracks, and can reduce other prominent detail information other than concrete cracks to a certain extent.
[0044] After preprocessing, segmentation and concrete crack screening and extraction, the concrete crack digital image has only the concrete crack area highlighted, and the local attack and noise in the uncracked concrete area have been completely eliminated. However, there is still local edge information loss in the concrete crack. Therefore, the morphological method is used to fill the local edge loss information of the concrete crack in the binary image, and the final processing result of the concrete crack digital image is obtained. The edge detail information of the concrete crack is basically completely retained, and the continuity of the concrete crack is good. Based on this processing result, subsequent work such as concrete crack feature extraction and analysis can be carried out.
[0045] S3: extracting features from the segmented concrete crack image to obtain extracted concrete crack image information; In terms of boundary feature extraction, the main focus is on extracting the contour of concrete cracks and calculating their length. The contour of concrete cracks is extracted based on the images before and after morphological closing operation on the binary image of concrete cracks. After comparing and analyzing the two, the binary image of concrete cracks after morphological closing operation is used to extract the contour, and the chain code is used to calculate the length of the contour.
[0046] In terms of regional feature extraction, important indicators such as concrete crack area, area ratio, length and width are the main extracted crack feature information. First, the area of the concrete crack area is used. The Area property of the Regionprops function and the Bwarea function in MATLAB are used to calculate the area of the crack connected area in the concrete crack binary image. The former uses the sum of the number of pixels contained in the crack area to represent the area, and the latter calculates the area of the crack connected area in the entire binary image after assigning weights to the 2×2 neighborhood of the pixel point. In terms of the accuracy of the concrete crack area value, the calculation result of the Bwarea function is more accurate; and when the concrete crack binary image contains multiple connected areas representing cracks, the Area property calculation of the Regionprops function is simpler and can directly calculate the area of each crack connected area. The area ratio is expressed as the ratio of the area of the concrete crack area to the area of the entire concrete crack digital image. In the calculation of concrete crack length, the approximate length of the crack can be calculated based on the skeleton curve extracted by the iterative deletion method. It has a wide range of applications and limited calculation accuracy, but it can ensure that the approximate length of the crack is slightly higher than the actual length. It still has certain practical significance. At the same time, the crack area ratio can be used to assist in measuring concrete cracks. Another method is to directly calculate the crack length based on the pixel coordinate points in the crack area in the binary image of the concrete crack. This method has high calculation accuracy, but it is only applicable to simple cracks. The calculation of concrete crack width is based on all pixel points on the binary image, selects an appropriate step size and radius, selects the area that meets the conditions for analysis, calculates and marks the crack width, and obtains the maximum width of the crack.
[0047] Specifically, boundary features analyze and identify objects based on the boundaries of different regions, and can accurately identify information such as the boundaries and shapes of regions. The most basic feature description of boundary features is the boundary length, that is, the length of the boundary line corresponding to the contours of regions of different shapes. The boundary perimeter of a two-dimensional digital image can be divided into 4-connected boundaries and 8-connected boundaries according to the connectivity form. In addition to the boundary perimeter, the basic description of boundary features also includes boundary diameter, boundary major axis and minor axis, and boundary curvature. The contour line and length of the crack in the digital image of concrete cracks are the main boundary features of concern.
[0048] Regional features are usually more intuitive in practical applications. The most commonly used simple regional features are regional area, regional location, and direction. Regional area is the most basic information of regional images and can directly reflect the size of the region. For the target region R in a digital image, the area A of the region R can be directly calculated by the following formula:
[0049] In the formula, (x, y) represents the pixel point R in the target area. It can be seen from the formula that the area of the region is the total number of pixels contained in the region. The main crack area features studied in concrete crack images include the area, area ratio, length and width of the crack.
[0050] Through the boundary recognition criteria, the pixel points on the region boundary line are output as a series of ordered point matrices in clockwise or counterclockwise directions. The boundary tracing algorithm focuses on the contour features of the connected region. In the binary image, the region composed of target points with a pixel value of 1 is called a connected region. The boundary tracing algorithm calculates the boundary line of the contour of the region.
[0051] In digital images, the pixel size is fixed, and the adjacent directions of pixels include left-right adjacent, top-bottom adjacent, and diagonal adjacent. The distance between adjacent pixels is also fixed, and the contour boundary of the digital image is composed of these three types of adjacent pixel combinations. Therefore, in the direction representation and length solution of the boundary line, a chain code representing a fixed length and direction line segment is introduced to represent the boundary.
[0052] Chain codes use codes to represent fixed line segments in different directions. Different code numbers represent different directions, and they correspond one to one. Based on 4-connectivity (or 8-connectivity) to represent 4 (or 8) fixed line segments in different directions, chain codes that represent line segments in 4-connectivity and 8-connectivity directions are collectively called Freeman chain codes. Freeman proposed a method for representing line patterns in 1961. Today, it is widely used in digital image recognition processing to represent line segment unit types. When using Freeman chain codes, a grid can be defined based on the center of the pixel points, and pixel points on the boundary line are allocated according to the grid, and then a series of direction numbers are used to represent the boundary line.
[0053] In concrete cracks, the number of pixels of the obtained digital image of concrete cracks is relatively high, and the size of a single pixel is basically negligible compared to the size of the concrete cracks. The boundary of the concrete crack area represented by the 8-connected Freeman chain code has met the accuracy requirements. After comprehensive consideration, the 8-direction connected chain code is used to describe and represent the extracted concrete crack boundary features and subsequent calculations.
[0054] Contour lines are extracted from crack segmentation results without morphological closing operations. The contour lines are relatively complex. After being marked on the initial grayscale image of concrete cracks, it can be found that the contour lines of the cracks are highly consistent with the details of the concrete cracks. However, the local details of the concrete cracks reflected by the contour lines are of little significance for analyzing the properties of the cracks themselves. The calculated length value of the concrete crack contour line lacks practical guiding significance. Therefore, the contour lines are extracted after the morphological closing operation is performed on the crack segmentation image.
[0055] After the concrete crack image is segmented and morphologically closed, the contour line is simplified by reducing the invalid details of the concrete crack. The entire area of the concrete crack is still included in the extracted contour line, which can accurately reflect the regional range of the concrete crack to a large extent and is not affected by the interference of invalid local details in the concrete area. Moreover, the contour line length calculated by the concrete crack contour map has more practical guiding significance. Therefore, the result image after the morphological closing operation of the concrete crack segmentation image is used for subsequent feature extraction including contour line extraction calculation.
[0056] Through MATLAB software, each connected area of the concrete crack can be numbered and labeled and the contour length can be calculated respectively. The length of the connected area contour is calculated using the chain code. Through statistical calculation, it is found that there are two connected areas. The number of pixels contained in the contour line of connected area 1 is 3077, and the contour line length is 3423.111. The contour line of connected area 2 is composed of 838 pixels, and the contour line length reaches 912.801. The length unit of the contour line is pixel, that is, the size of each pixel is the unit length.
[0057] Regional features are the main features of concern in digital image analysis of concrete cracks. The area, length and width of the connected region corresponding to concrete cracks are important indicators reflecting cracks. The area extraction of crack regions can be expressed by counting the total number of pixels contained in the region. Usually, a single pixel represents a unit area. For the preprocessed and segmented binary image of concrete cracks, the area of the connected region of cracks is expressed as the sum of the number of pixels in the connected region with a pixel value of 1 according to this method. The system function Regionprops in MATLAB can classify according to the number of connected regions, obtain various indicator attribute values such as the area of each connected region in turn, obtain the sum of the actual number of pixels in each connected region by calculating the attribute parameter Area, and give the result in the form of a scalar. In this statistical calculation, the weight of each pixel contained in the connected region is consistent and 1. In MATLAB, there is also a Bwarea function that specifically calculates the area of the target region of a binary image. When calculating the area of the target region, this function assigns different weights to the pixels in the region according to the 2×2 neighborhood mode. The Bwarea function area statistics algorithm divides each 2×2 neighborhood pixel of the entire binary image into six modes, each mode has its own corresponding weight value, the area of each pixel depends on the 2×2 neighborhood it constitutes, and each 2×2 neighborhood is calculated only once in the statistics. By performing statistical calculations on the pixel areas of all 2×2 neighborhoods, the total area of the connected regions in the entire digital image is obtained.
[0058] In practical application selection, the actual size of the pixel points of the digital image to be processed can be used for screening. When the actual size of the individual pixel points is not negligible compared to the crack size, the Bwarea function can be used to obtain a more accurate area measurement value. When the size of the independent pixel points is negligible compared to the crack size, the system function Regionprops can be used to more conveniently obtain the area calculation value of each connected region in the binary image. When calculating the area of each connected region through the Bwarea function, the connected regions can be extracted separately and then the area statistics of each connected region can be obtained.
[0059] The Regionprops function in MATLAB is used to calculate the area of the crack connected region for the binary image of concrete cracks. The crack area represented by connected region 1 is 11107, and the area of connected region 2 representing the crack is 1641. The Area attribute of the connected region calculated by the Regionprops function is essentially the number of pixels, so the values are all integers. The Bwarea function calculates the area of the connected region by assigning weights based on the 2×2 domain of the pixels. The areas of the crack connected regions 1 and 2 are 11211.75 and 1663.875, respectively. By comparing the areas of the connected regions calculated by the two methods, it can be analyzed that the area value calculated by the weighted method of the Bwarea function is significantly larger than the area value calculated by the Regionprops function using the attribute Area. The area results calculated by the two methods are shown in Table 5.1. At the same time, the difference and difference rate of the results are calculated. The difference rate is expressed as the ratio between the difference of the calculated results and the number of pixels. The difference rate is mainly affected by the 2×2 neighborhood distribution of the pixels in the connected region of the binary image.
[0060] In actual situations, the accuracy of the area value represented by the number of pixels calculated by the Area property of the Regionprops function directly depends on the contrast of the size of the pixel relative to the crack. The area value calculated by the Bwarea function weakens the influence of the pixel size to a certain extent by assigning weights, which is more practical. However, in terms of computational convenience, the Regionprops function is more advantageous, and can directly calculate the area of each connected region of the concrete crack binary image and can be presented in a matrix form. The Bwarea function directly counts the area values of all connected regions in the concrete crack binary image, and each connected region needs to be extracted separately when calculating the area value. Therefore, when obtaining the area of each connected region of the concrete crack binary image, the Regionprops function is superior to the Bwarea function in terms of computational efficiency and ease of operation. When the area of each connected region is not considered and the sum of the areas of all crack regions in the concrete crack binary image is the main focus, it is easier to use the Bwarea function. When the Regionprops function is used, it is necessary to add the step of counting the sum of the areas of each connected region of the crack.
[0061] In the binary image of concrete cracks, the length of concrete cracks is mainly extracted and calculated based on the shape of the corresponding connected region. As the key feature of the region shape, the skeleton is more suitable and accurate to represent the length of the connected region by the length of the connected region skeleton. The classic models for defining the skeleton are the maximum inscribed disk method and the fire model. Both of these model methods can obtain a more suitable skeleton. The regional skeleton is calculated based on the regional boundary and can be simplified to be represented by a set of points that are equidistant from the regional boundary, that is, the central axis of the region.
[0062] The length of complex cracks cannot usually be directly and accurately calculated, so the number of pixels of the skeleton curve or the approximate length of the skeleton curve calculated by the Bwarea function is used as the length of the complex crack. According to the calculation of the simple crack length, the length of the crack area is usually greater than the sum of the number of pixels in the skeleton curve of the connected area. Therefore, in order to avoid the calculated crack length being less than the actual crack length, the approximate length of the crack skeleton curve calculated by the Bwarea function is used as the crack length. The complex crack length of the crack connected area 1 is calculated by the Bwarea function, which is approximately 1688.375. The sum of the number of pixels contained in the skeleton curve of the connected area 1 is 1613. In order to determine the accuracy of the approximate length of the crack skeleton curve calculated by the Bwarea function, for the binary image of concrete cracks, the pixel values of the pixels at the intersection of the complex cracks are changed to realize the conversion of complex cracks into simple cracks. For complex cracks, in addition to the length indicator, the area ratio of the crack is usually considered as a test indicator. Therefore, for concrete crack images containing complex cracks, the approximate length and the crack area ratio can be used to measure. The crack area ratio indicator is also applicable to simple cracks. The crack complexity in the binary image of concrete cracks used for testing is relatively low. The concrete crack area contained in the binary image contains only one simple crack and one complex crack that crosses each other. The area of all crack areas in the entire binary image accounts for only 1.4734%.
[0063] In addition to the concrete crack length calculation index, crack width is also an important index to measure the characteristics of concrete cracks. The calculation of concrete crack width does not need to distinguish between simple cracks and complex cracks. Consider calculating the crack width based on the skeleton curve extracted by the iterative deletion method of the concrete crack binary image, and obtain the crack width by calculating the distance between the intersection of the normal and the contour line of each pixel on the skeleton curve. In actual calculations, it is found that the concrete crack contour line is usually more complex, and the concrete crack skeleton curve will inevitably produce burrs, which will interfere with the calculation of concrete crack width. Screening for these uncertain interference factors often results in half the effort and twice the result, and there is a great difficulty in achieving universality. Therefore, an attempt is made to directly analyze the target pixel points in the crack area in the concrete crack binary image, set the radius and step size of the analysis area, set the screening conditions for the analysis area, and finally calculate the crack width.
[0064] When the crack width is calculated based on the pixel points of the binary image of concrete cracks, the moving length of the extraction area is determined according to the step size, and the radius determines the size of the analysis area. By traversing the binary image of concrete cracks, the extraction and analysis are performed to screen out the areas that meet the conditions for analysis. The screening conditions are that the crack area within the extraction area only passes through the two boundaries of the extraction range, and these two boundaries meet the conditions of non-adjacent boundaries, and the crack area passes through the center of the extraction area. The above screening conditions are set to avoid the confusion of crack width marking, and to achieve a certain degree of screening effect for crack areas with poor extraction effects. After the extraction area meets all the above requirements, the curve is fitted according to the coordinates of all pixel points in the crack area within the extraction analysis range, and the slope of the curve is calculated. The slope of the normal line is obtained from the slope of the curve, and the pixel points in the crack area whose distance to the normal line is less than 1 are marked. These marked points constitute the normal line, and the distance is calculated from the marked points, that is, the width value of the crack at the marked position.
[0065] The step size of concrete crack width calculation determines the amount of analysis and calculation, while the radius is directly related to the accuracy of calculation. The radius cannot be too small. When the radius is significantly smaller than the crack width, the practical significance of analyzing and calculating the crack width is lost. The radius size should satisfy the fact that the crack area in the analysis area can truly reflect the inclination angle of the crack, and ensure the accuracy of the curve fitting based on the pixel points in the crack area in the analysis area. At the same time, for the indicator of concrete crack width, the minimum width usually does not have practical application guidance significance. Therefore, in order to reduce the amount of analysis and calculation and the number of markings, the requirement that the crack area ratio is greater than 0.2 is added to the screening conditions of the extraction area. When the crack area ratio exceeds half, the curve obtained by fitting according to the pixel coordinates in the crack area will lack reliability. Therefore, the screening condition that the crack area ratio is less than 0.6 is also set, which can further ensure that a more accurate crack width calculation result is obtained when a suitable radius is used. Adding the crack area ratio to the extraction area screening conditions can adjust the radius of the extraction area according to the results of crack width calculation and marking, and then obtain a more suitable extraction area radius, which is conducive to the analysis, calculation and marking of concrete crack width. MATLAB software can be used to extract and analyze the crack boundary characteristic contour line and its length, crack area characteristic area, area ratio, length and width in the binary image of concrete cracks.
[0066] In terms of boundary feature extraction, the main focus is on extracting the contour of concrete cracks and calculating their length. The contour of concrete cracks is extracted based on the images before and after morphological closing operation on the binary image of concrete cracks. After comparing and analyzing the two, the binary image of concrete cracks after morphological closing operation is used to extract the contour, and the chain code is used to calculate the length of the contour.
[0067] In terms of regional feature extraction, important indicators such as concrete crack area, area ratio, length and width are the main extracted crack feature information. First, the area of the concrete crack area is used. The Area property of the Regionprops function and the Bwarea function in MATLAB are used to calculate the area of the crack connected area in the concrete crack binary image. The former uses the sum of the number of pixels contained in the crack area to represent the area, and the latter calculates the area of the crack connected area in the entire binary image after assigning weights to the 2×2 neighborhood of the pixel point. In terms of the accuracy of the concrete crack area value, the calculation result of the Bwarea function is more accurate; and when the concrete crack binary image contains multiple connected areas representing cracks, the Area property calculation of the Regionprops function is simpler and can directly calculate the area of each crack connected area. The area ratio is expressed as the ratio of the area of the concrete crack area to the area of the entire concrete crack digital image. In the calculation of concrete crack length, the approximate length of the crack can be calculated based on the skeleton curve extracted by the iterative deletion method. It has a wide range of applications and limited calculation accuracy, but it can ensure that the approximate length of the crack is slightly higher than the actual length. It still has certain practical significance. At the same time, the crack area ratio can be used to assist in measuring concrete cracks. Another method is to directly calculate the crack length based on the pixel coordinate points in the crack area in the binary image of the concrete crack. This method has high calculation accuracy, but it is only applicable to simple cracks. The calculation of concrete crack width is based on all pixel points on the binary image, selects an appropriate step size and radius, selects the area that meets the conditions for analysis, calculates and marks the crack width, and obtains the maximum width of the crack.
[0068] S4: Inputting the concrete crack image feature information into the concrete crack recognition model to obtain the concrete crack image recognition result, including: The concrete crack image feature information is divided into a training set and a validation set, with a ratio of 80% training set and 20% validation set; The concrete crack recognition model is trained using the training set in the concrete crack image feature information, and the model parameters are gradually adjusted through repeated iterations until the model converges, thereby obtaining a trained concrete crack recognition model; The verification set in the concrete crack image feature information is input into the trained concrete crack recognition model for verification and recognition to obtain the image recognition result.
[0069] In summary, the present invention effectively improves the image quality by obtaining high-quality concrete crack images and performing preprocessing, including denoising, contrast enhancement, grayscale and other operations, and lays a solid foundation for subsequent processing. The key to this step is that it can automatically adjust the image parameters through the algorithm to maximize the contrast between the crack and the background, thereby reducing the feature extraction error caused by poor image quality. Next, the present invention uses advanced image segmentation technology to further subdivide the preprocessed image into sub-regions containing crack information. The importance of this step is that it can separate the cracks from the complex background, reduce the interference of useless information, and provide a clearer and more direct target for subsequent feature extraction. The selection and application of image segmentation technology fully considers the morphological characteristics and distribution laws of the cracks, ensuring the accuracy and integrity of the segmentation results. In the feature extraction stage, the present invention uses modern machine learning algorithms such as deep learning to conduct in-depth analysis of the segmented images and extract key feature information such as the length, width, direction, and shape of the cracks. These features not only reflect the physical properties of the cracks, but are also an important basis for the subsequent recognition model to judge the type and severity of the cracks. Through the training and optimization of the deep learning model, the present invention can realize the accurate capture and efficient expression of complex crack features, and significantly improve the accuracy and robustness of feature extraction. Finally, the extracted feature information is input into a specially designed concrete crack recognition model, which is constructed based on a large amount of crack image data and advanced machine learning algorithms, and can accurately identify key information such as the type, location, and size of cracks. Compared with traditional recognition methods, the model adopted by the present invention has higher recognition accuracy and stronger generalization ability, and can maintain stable recognition performance under different lighting conditions and different crack morphologies. Therefore, the concrete crack digital image recognition method of the present invention realizes accurate recognition of concrete cracks by optimizing preprocessing, accurate segmentation, efficient feature extraction and advanced recognition models, and greatly improves the accuracy and reliability of recognition. This innovation not only solves the problems in the prior art, but also provides strong technical support for structural monitoring and safety assessment in the field of civil engineering, which helps to timely discover and deal with potential safety hazards and ensure the stability and safety of building structures. In addition, the method also has a high degree of automation and a low demand for human intervention, which can significantly improve work efficiency and reduce detection costs.
[0070] The second object of the present invention is to provide a concrete crack image recognition system. Figure 2 As shown, including: Preprocessing module 21: used to obtain concrete crack images and preprocess the images to obtain preprocessed concrete crack images; The image segmentation module 22 is used to perform image segmentation processing on the pre-processed concrete crack image to obtain a segmented concrete crack image; Feature extraction module 23: used to extract features from the segmented concrete crack image to obtain feature information of the concrete crack image; The recognition result module 24 is used to input the concrete crack image feature information into the concrete crack recognition model to obtain the concrete crack image recognition result.
[0071] like Figure 3 As shown, the third object of the present invention is to provide an electronic device, the electronic device comprising: a processor 301, a memory 302 and a display screen 303. Among them, the memory 302 and the display screen 303 are connected to the processor 301, such as through a bus 304. Optionally, the electronic device may also include a transceiver 305. It should be noted that in actual applications, the transceiver 305 is not limited to one, and the structure of the electronic device does not constitute a limitation on the embodiments of the present application.
[0072] The processor 301 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor 301 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0073] The bus 304 may include a path to transmit information between the above components. The bus 304 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 304 may be divided into an address bus, a data bus, a control bus, etc.
[0074] The memory 302 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0075] The memory 302 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 301. The processor 301 is used to execute the application code stored in the memory 302 to implement the contents shown in the above method embodiment.
[0076] Figure 3 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0077] The fourth object of the present invention is to provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program is stored thereon, and when the program is executed by a processor, the aforementioned Figure 1 The various processes of the method embodiment shown in the figure include, for example, a memory including instructions, and the instructions can be executed by a processor of an electronic device to complete the method.
[0078] A computer-readable storage medium may be a tangible device that holds and stores instructions used by an instruction execution device. A computer-readable storage medium may be, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any combination thereof. Specifically, a computer-readable storage medium may be a portable computer disk, a hard disk, a USB flash drive, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a lectern random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, an optical disk, a magnetic disk, a mechanical encoding device, and any combination thereof.
[0079] A fifth object of the present invention is to provide a computer program product, comprising computer instructions, which, when executed by a processor, implement the above Figure 1 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.
[0080] Many embodiments and many applications beyond the examples provided will be apparent to those skilled in the art upon reading the above description. Therefore, the scope of the present teachings should not be determined with reference to the above description, but rather with reference to the preceding claims and the full scope of equivalents to which such claims are entitled. For the purpose of comprehensiveness, all articles and references, including disclosures of patent applications and publications, are incorporated herein by reference. The omission of any aspect of the subject matter disclosed herein in the preceding claims is not intended to be a disclaimer of such subject matter, nor should it be considered that the applicants did not consider such subject matter to be part of the disclosed inventive subject matter.
[0081] The above content is a further detailed description of the present invention. It cannot be determined that the specific implementation methods of the present invention are limited to these. For ordinary technicians in the technical field to which the present invention belongs, without departing from the concept of the present invention, they can also make several simple deductions or substitutions, which should be regarded as belonging to the protection scope of the present invention determined by the submitted claims.
Claims
1. A concrete crack image recognition method, characterized in that: include: Acquire a concrete crack image, and preprocess the image to obtain a preprocessed concrete crack image; Performing image segmentation processing on the pre-processed concrete crack image to obtain a segmented concrete crack image; Perform feature extraction on the segmented concrete crack image to obtain feature information of the concrete crack image; The concrete crack image feature information is input into the concrete crack recognition model to obtain the concrete crack image recognition result.
2. A concrete crack image recognition method according to claim 1, characterized in that: The step of acquiring a concrete crack image and preprocessing the image to obtain a preprocessed concrete crack image includes: Collect concrete crack images; The grayscale linear transformation and histogram equalization in the spatial domain image enhancement algorithm are selected to increase the contrast of the concrete crack image in the digital image, the adaptive median filter is used to perform digital image smoothing and noise reduction on the concrete crack image, and the second-order differential operator Laplace operator is used to perform crack sharpening and enhancement processing on the concrete crack image to obtain the preprocessed concrete crack image.
3. A concrete crack image recognition method according to claim 1, characterized in that: The step of performing image segmentation processing on the pre-processed concrete crack image to obtain a segmented concrete crack image includes: Perform edge detection on the pre-processed concrete crack image and divide the image into several regions; Afterwards, the K-means clustering segmentation algorithm is used to segment the concrete crack digital image to obtain a segmented concrete crack image.
4. A concrete crack image recognition method according to claim 3, characterized in that: The pre-processed concrete crack image is subjected to edge detection using the Canny operator, and the image is divided into several regions, including: The concept of pre-processed concrete crack image segmentation is expressed in the form of a set. I is taken to represent the spatial area of the entire digital image. The pre-processed concrete crack image segmentation process is regarded as dividing the image I into n sub-areas: I1, I2, I3, ···, In; the n sub-areas obtained after segmentation satisfy: ,In the preprocessed concrete crack image, each pixel must be segmented into a certain sub-region; All sub-regions in Ii (i=1, 2, ···, n) come from the digital image I and have a predetermined connectivity form; i≠j (i and j are both 1, 2, ···, n), And Ii and Ij are not empty sets; Define Q(Rk) as a certain logical predicate on the set Rk, corresponding to the predetermined segmentation detection criteria in the pre-processed concrete crack image segmentation process, Q(Ri)=TRUE represents that the pixels in each of the n sub-regions obtained after the pre-processed concrete crack image segmentation satisfy certain predetermined characteristics, Q(Ri∪Ri+1)=FALSE represents that the related characteristics of adjacent sub-regions after the pre-processed concrete crack image segmentation on the logical Q must be different; this condition is that after the pre-processed concrete crack image segmentation process, the pixels in each sub-region must have similar features, and there must be difference features between adjacent sub-regions that can be significantly distinguished according to the segmentation criteria.
5. A concrete crack image recognition method according to claim 1, characterized in that: The step of extracting features from the segmented concrete crack image to obtain feature information of the concrete crack image includes: Perform boundary feature extraction and regional feature extraction on the segmented concrete crack image to obtain feature information of the concrete crack image; The boundary feature extraction comprises: A morphological closing operation is performed on the concrete crack image to obtain a binary image of the concrete crack after the morphological closing operation, and the contour line is extracted. The chain code is used to calculate the length of the contour line and perform boundary feature extraction.
6. A concrete crack image recognition method according to claim 1, characterized in that: The step of inputting the concrete crack image feature information into the concrete crack recognition model to obtain the concrete crack image recognition result includes: The concrete crack image feature information is divided into a training set and a validation set; The concrete crack recognition model is trained using a training set in the concrete crack image feature information to obtain a trained concrete crack recognition model; The verification set in the concrete crack image feature information is input into the trained concrete crack recognition model for verification and recognition to obtain the image recognition result.
7. A concrete crack image recognition system, characterized in that: include: Preprocessing module: used to obtain concrete crack images and preprocess the images to obtain preprocessed concrete crack images; Segmentation image module: used to perform image segmentation processing on the pre-processed concrete crack image to obtain a segmented processed concrete crack image; Feature extraction module: used to extract features from the segmented concrete crack image and obtain feature information of the concrete crack image; Recognition result module: used to input the concrete crack image feature information into the concrete crack recognition model to obtain the concrete crack image recognition result.
8. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of a method for recognizing concrete crack images as described in any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the concrete crack image recognition method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of a concrete crack image recognition method as described in any one of claims 1 to 6.
Citation Information
Cited By
Test system based on concrete coagulation
CN120427619A
Water plant coagulation stirring experiment device and control method thereof
CN120736648A