A municipal civil engineering quality detection method and system based on image processing

CN122657148BActive Publication Date: 2026-10-23BEIJING LIANJIAN CONSTRUCTION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611149628.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-10-23
Estimated Expiration
2046-07-31

AI Technical Summary

Technical Problem

[0003]现有技术在实际运作中,单纯依赖基础边缘梯度算子对采集图像进行特征提取,导致在面对市政土建结构表面存在复杂水渍污垢覆盖或野外环境光照强弱分布不均干扰时,无法依据像素的拓扑连续性有效区分真实结构裂缝与随机环境噪声,且缺乏对微小病害纹理特征的自适应动态增强机制,造成最终质量检测结果的误报率与漏报率较高,难以满足复杂工况下对土建工程进行高精度质量评估的实际业务需求

Benefits of technology

[0015]与现有技术相比,本发明的优点和积极效果在于:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122657148B_ABST
    Figure CN122657148B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of image defect detection, in particular to a municipal civil engineering quality detection method and system based on image processing, which comprises the following steps: collecting a surface image and generating an illumination equalization enhanced image, constructing a Gaussian difference pyramid and calculating a Hessian matrix second-order derivative, generating a tubular structure probability response graph according to structural tensor eigenvalues, performing adaptive threshold segmentation to obtain a binary disease mask, constructing a crack topological skeleton, determining a maximum crack width value according to skeleton edge pixel gradients and outputting a final evaluation grade. In the application, a multi-scale texture topological response matrix and an adaptive illumination model are constructed, the anisotropy of Hessian matrix eigenvalues is accurately calculated to obtain a tubular structure probability, environmental noise interference such as water stains and dirt is effectively inhibited, a small crack is dynamically tracked based on a geometric skeleton growth logic, high signal-to-noise ratio extraction of disease characteristics in a complex background is realized, and the problem of distinguishing defects and textures is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image defect detection technology, and in particular to a method and system for quality inspection of municipal civil engineering based on image processing. Background Technology

[0002] The field of image defect detection technology involves the digital analysis and evaluation of the surface morphology of objects using computer vision algorithms. Traditional image processing-based methods for municipal civil engineering quality inspection involve acquiring surface images of civil engineering structures using standard industrial cameras, identifying high-frequency grayscale abrupt change regions in the images using basic edge detection operators such as Sobel or Canny, and calculating the pixel physical size of these abrupt change regions based on the camera's geometric calibration parameters. This is then used to determine the degree of cracking or damage to the civil engineering structure.

[0003] In practical operation, existing technologies rely solely on basic edge gradient operators to extract features from acquired images. This makes it difficult to effectively distinguish between real structural cracks and random environmental noise based on pixel topological continuity when faced with complex water stains and dirt covering the surface of municipal civil engineering structures or uneven distribution of outdoor lighting. Furthermore, the lack of an adaptive dynamic enhancement mechanism for the texture features of minor defects results in a high false alarm rate and a high false negative rate in the final quality inspection results, making it difficult to meet the actual business needs of high-precision quality assessment of civil engineering projects under complex working conditions. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of existing technologies and propose a municipal civil engineering quality inspection method and system based on image processing.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: a municipal civil engineering quality inspection method based on image processing, comprising the following steps: S1: Collect the original image of the municipal civil engineering surface, map it to the basic gray-level distribution matrix, use the adaptive histogram equalization algorithm to calculate the local brightness statistics, perform illumination correction on the basic gray-level distribution matrix based on the local brightness statistics, and generate an illumination equalization enhanced image. S2: Construct a multi-scale Gaussian difference pyramid based on the illumination equalization enhancement image, calculate the second derivative of the Hessian matrix at each level, construct the structural tensor eigenvalues ​​using the second derivative of the Hessian matrix, measure the tubular geometric similarity based on the ratio of principal eigenvalues, and generate a tubular structure probability response map through weighted fusion. S3: Perform maximum inter-class variance threshold segmentation on the probability response map of the tubular structure to obtain a binarized disease mask, connect the fractured disease areas using morphological closing operation, refine the connected domains using the applied axial transformation algorithm, and construct the crack topological skeleton. S4: Search for the pixel gradient of the skeleton edge along the normal direction of the crack topology skeleton, calculate the local crack width based on the difference in the coordinates of the gradient extreme points, statistically analyze the global extreme values ​​to generate the maximum crack width value, match the safety standard level library based on the maximum crack width value, and output the municipal civil engineering quality assessment level.

[0006] As a further aspect of the present invention, step S1 specifically comprises: S11: Acquire the original image of the municipal civil engineering surface captured by a high-resolution industrial camera, and use the weighted average method to convert the red, green and blue three-channel pixel values ​​of the original surface image into single-channel brightness values ​​to construct a basic grayscale distribution matrix. S12: Divide the basic gray-level distribution matrix into non-overlapping rectangular sub-blocks, count the gray-level histogram in each rectangular sub-block and calculate the cumulative distribution function, and crop and redistribute the histogram peaks according to the preset contrast-limited threshold to generate a mapping lookup table. S13: Traverse each pixel in the basic grayscale distribution matrix, and calculate the new grayscale value of the pixel based on its position coordinates in the adjacent rectangular sub-blocks using a bilinear interpolation algorithm combined with the mapping lookup table, thereby eliminating block artifacts and outputting an illumination equalization enhanced image.

[0007] As a further aspect of the present invention, step S2 specifically includes: S21: Convolve the illumination equalization enhancement image using a set of Gaussian kernel functions with different standard deviations to generate multiple sets of blurred images with different resolutions. Perform difference processing on the blurred images at adjacent scales to construct a multi-scale Gaussian difference pyramid. S22: For each level of the image in the multi-scale Gaussian difference pyramid, the second derivative of each pixel in the horizontal, vertical and diagonal directions is calculated using the second-order partial differential operator to construct the second derivative of the Hessian matrix. S23: Perform eigenvalue decomposition on the second derivative of the Hessian matrix, extract the first and second eigenvalues ​​representing the directionality of the local geometric structure, construct the structural tensor eigenvalues ​​using the magnitude relationship and positive / negative sign attribute of the eigenvalues, and calculate the single-level tubular geometric similarity using a preset tubular metric function; S24: Calculate the scale weighting coefficient based on the noise response intensity of each level of image, and use the scale weighting coefficient to linearly weight and superimpose the tubular geometric similarity of each level to suppress non-crack texture noise and highlight the crack centerline response, thereby generating a tubular structure probability response map.

[0008] As a further aspect of the present invention, step S3 specifically comprises: S31: Statistically analyze the gray-level histogram of the probability response map of the tubular structure, use the maximum inter-class variance method to traverse all possible segmentation thresholds, select the value that maximizes the sum of the variances of the background class and the target class as the optimal segmentation threshold, and convert the response map into a binary disease mask. S32: Construct a circular structural element with a preset radius, and use the circular structural element to first perform an expansion operation on the binarized disease mask to fill the tiny holes, and then perform an erosion operation to restore the original boundary, connect the suspected disease areas that are broken due to noise interference, and generate a connected domain with enhanced connectivity. S33: Apply an iterative refinement algorithm to the connected domain, peeling away boundary pixels layer by layer while maintaining connectivity, until all diseased areas are reduced to the centerline of a single pixel width, eliminating short redundant branches and retaining the main structure, and constructing the crack topology skeleton.

[0009] As a further aspect of the present invention, step S4 specifically comprises: S41: Traverse each skeleton pixel on the crack topology skeleton, calculate the tangent direction according to the connection relationship between the pixel and its eight neighboring pixels, and rotate the tangent direction by 90 degrees to obtain the normal direction. S42: Using the skeleton pixel as the center, perform a bidirectional search on the original grayscale image along the normal direction, calculate the gradient change curve of the pixel grayscale value on the search path, mark the maximum gradient magnitude point as the crack edge point, calculate the Euclidean distance between the two edge points, and generate the local crack width. S43: Calculate the local crack width corresponding to all skeleton points of the entire crack, remove outliers and filter out the width data with the largest value, and define it as the maximum crack width value. S44: Obtain a safety standard level library containing multiple preset width ranges and corresponding quality levels, compare the maximum crack width value with the threshold range in the safety standard level library, determine the severity category of the current crack, and output the municipal civil engineering quality assessment level.

[0010] As a further aspect of the present invention, the specific calculation process for the tubular geometric similarity in S23 includes: Obtain the first principal eigenvalue from the eigenvalues ​​of the structure tensor. With the second principal eigenvalue And satisfy A tubular metric model for suppressing sheet-like structures and enhancing linear structures is constructed using Gaussian membership functions. The tubular geometric similarity of each pixel is calculated based on the tubular metric model. The calculation formula is as follows: ; when hour ,in, The ratio representing the speckled structure is calculated as follows: , The Frobenius norm, representing the structure tensor, is used to measure the overall contrast intensity of local structures in an image. Its calculation formula is: , This represents a preset constant that controls the sensitivity of the spot. This represents a preset constant that controls the intensity of noise suppression.

[0011] As a further aspect of the present invention, the calculation process of the contrast-limited threshold in S12 specifically includes: Obtain the total number of pixels of the rectangular sub-block and the dynamic range of the preset basic gray-level distribution matrix, calculate the adaptive cropping coefficient based on the information entropy of the image, and use the adaptive cropping coefficient to determine the contrast-limited threshold. During histogram equalization, the frequency of pixels exceeding the contrast-limited threshold is truncated, and the truncated pixel frequencies are evenly distributed to other gray levels of the histogram to prevent background noise from being excessively amplified during local contrast enhancement.

[0012] As a further aspect of the present invention, the process of constructing the crack topology skeleton in S33 specifically includes: Perform distance transformation on the connected components, calculate the Euclidean distance from each foreground pixel to the nearest background pixel, generate a distance transformation map, and extract local maxima points in the distance transformation map as candidate skeleton points; The candidate skeleton points are connected using a fast traversal algorithm, and the skeleton branches are pruned by calculating the saliency metric of the branch points. The burr branches with a length less than a preset threshold are removed, and the main skeleton that can reflect the extension trend of the crack body is retained to generate the crack topology skeleton.

[0013] As a further aspect of the present invention, the process of matching the security specification level library in S44 specifically includes: The maximum crack width value, crack length, area, and fractal dimension features are obtained to construct a multidimensional disease feature vector; The multidimensional defect feature vector is input into a support vector machine classifier that has been pre-trained based on historical municipal civil engineering inspection data. Under the constraints defined by the safety standard level library, the probability that the current defect feature vector belongs to each safety level is calculated, and the level with the highest probability is selected as the output municipal civil engineering quality assessment level.

[0014] A municipal civil engineering quality inspection system based on image processing, the system being used to implement the aforementioned municipal civil engineering quality inspection method based on image processing, the system comprising: The image acquisition and enhancement module is used to acquire the original image of the surface of municipal civil engineering, map it to the basic gray-level distribution matrix, calculate the local brightness statistics using the adaptive histogram equalization algorithm, perform illumination correction on the basic gray-level distribution matrix based on the local brightness statistics, and generate an illumination equalization enhanced image. The multi-scale feature extraction module is used to construct a multi-scale Gaussian difference pyramid based on the illumination equalization enhancement image, calculate the second derivative of the Hessian matrix at each level, construct the structural tensor eigenvalues ​​using the second derivative of the Hessian matrix, measure the tubular geometric similarity based on the ratio of principal eigenvalues, and generate a tubular structure probability response map through weighted fusion. The disease segmentation and skeletonization module is used to perform maximum inter-class variance threshold segmentation on the probability response map of the tubular structure, obtain a binary disease mask, connect the fractured disease regions using morphological closing operation, refine the connected domains using the applied axial transformation algorithm, and construct the crack topological skeleton. The quality assessment and grading module is used to search for the pixel gradient of the skeleton edge along the normal direction of the crack topology skeleton, calculate the local crack width based on the difference in the coordinates of the gradient extreme points, generate the maximum crack width value by statistically analyzing the global extreme values, match the maximum crack width value with the safety standard level library, and output the municipal civil engineering quality assessment level.

[0015] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by constructing a multi-scale texture topology response matrix and an adaptive illumination equalization model, the anisotropic differences of the Hessian matrix eigenvalues ​​are used to accurately calculate the probability of tubular structures in pixels, effectively suppressing the interference of nonlinear environmental noise such as water stains and dirt. Furthermore, based on the geometric skeleton growth logic of the maximum connected domain, micro-cracks are dynamically tracked and their integrity is repaired. This achieves high signal-to-noise ratio extraction of surface defects in municipal civil engineering under complex outdoor lighting conditions, solving the problem that traditional methods cannot distinguish between structural defects and environmental textures. As a result, the accuracy, anti-interference ability, and automated evaluation efficiency of municipal civil engineering quality inspection are greatly improved. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating the overall process of municipal civil engineering quality inspection in this invention. Figure 2 This is a flowchart of the image acquisition and illumination equalization processing of the present invention; Figure 3 This is a flowchart of the process for generating the probabilistic response diagram of the tubular structure of the present invention; Figure 4 This is a flowchart of the crack topology skeleton extraction process of the present invention; Figure 5 This is a flowchart of the crack width measurement and quality assessment process of the present invention. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the software-based technical solution is described in detail below with reference to system architecture diagrams and embodiments. It should be understood that the specific embodiments described herein are only for explaining the technical solutions of this invention and do not constitute a limitation on the scope of protection.

[0018] In the description of this invention, the system architecture relationships or data processing flows indicated by terms such as "layer," "module," "interface," "data flow," "client," and "server" are all defined based on the architecture diagram or flowchart corresponding to the embodiments. This way of describing is only used to clearly illustrate the logical relationships between the elements in the technical solution, and not to limit the physical deployment form. The term "multiple" includes two or more technical units, including but not limited to multiple data nodes, processing threads, service instances, or functional components and other scalable elements. The specific number is determined according to the actual business scenario and needs to be specifically specified.

[0019] Please see Figure 1 and Figure 2 This invention provides a technical solution: a method for quality inspection of municipal civil engineering based on image processing, comprising the following steps: S1: Collect the original image of the municipal civil engineering surface, map it to the basic gray-level distribution matrix, use the adaptive histogram equalization algorithm to calculate the local brightness statistics, perform illumination correction on the basic gray-level distribution matrix based on the local brightness statistics, and generate an illumination equalization enhanced image. The specific steps of S1 are as follows: S11: Acquire the original image of the municipal civil engineering surface captured by a high-resolution industrial camera, and use the weighted average method to convert the red, green and blue three-channel pixel values ​​of the original surface image into single-channel brightness values ​​to construct a basic grayscale distribution matrix. S12: Divide the basic gray-level distribution matrix into non-overlapping rectangular sub-blocks, count the gray-level histogram in each rectangular sub-block and calculate the cumulative distribution function, and crop and redistribute the histogram peaks according to the preset contrast-limited threshold to generate a mapping lookup table. The calculation process for the contrast-limited threshold in S12 specifically includes: Obtain the total number of pixels in the rectangular sub-block and the dynamic range of the preset basic gray-level distribution matrix. Calculate the adaptive cropping coefficient based on the information entropy of the image and use the adaptive cropping coefficient to determine the contrast-limited threshold. During histogram equalization, the frequency of pixels exceeding the contrast-limited threshold is truncated, and the truncated pixel frequencies are evenly distributed to other gray levels of the histogram to prevent background noise from being excessively amplified during local contrast enhancement. S13: Traverse each pixel in the basic grayscale distribution matrix, and calculate the new grayscale value of the pixel based on its position coordinates in the adjacent rectangular sub-blocks using a bilinear interpolation algorithm combined with a mapping lookup table. Eliminate block artifacts and output an enhanced image with illumination equalization.

[0020] Using a CMOS industrial area array camera mounted on an inspection vehicle or drone platform, fixed-point imaging is performed at a vertical distance of 500 mm to 1000 mm from the concrete surface. Camera parameters are set to an exposure time of 2000 microseconds, a gain of 0, and a resolution of 4096 x 3000 pixels to ensure the acquired raw images of municipal civil engineering surfaces have sufficient clarity to capture micro-cracks as small as 0.1 mm. After acquiring the raw RGB image, instead of performing full-image processing directly, the red, green, and blue color channel components are first extracted from the image memory. A weighted average algorithm, consistent with human visual perception, is used for grayscale reduction based on the concrete surface texture characteristics. Specifically, each pixel coordinate in the image is traversed, and the corresponding red, green, and blue channel component values ​​are extracted, then weighted using a formula. For example, for a pixel with RGB values ​​of 120, 130, and 125, the calculated grayscale value is 126. After traversal, a basic grayscale distribution matrix for a single channel is constructed. This matrix fully preserves the brightness topology of the building surface while removing the interference of color noise.

[0021] The constructed basic gray-level distribution matrix is ​​logically divided into a grid with a fixed number of rows and columns, with each grid consisting of non-overlapping rectangular sub-blocks of 64 x 64 pixels. For each rectangular sub-block, the gray-level distribution of its 4096 internal pixels is independently statistically analyzed, generating a local gray-level histogram. To determine the contrast-limited threshold, the information entropy of the sub-block image is first calculated, involving logarithmic operations on the probabilities of each gray level. Assuming the information entropy of a certain sub-block is 5.8 and the preset dynamic range coefficient is 0.02, the adaptive cropping coefficient is set as the product of the information entropy and the dynamic range coefficient, resulting in a calculated value of 0.116. Based on this coefficient, the contrast-limited threshold is determined, which is the product of the adaptive cropping coefficient and the total number of pixels in the sub-block, resulting in a calculated truncation threshold of 475. The algorithm iterates through the 256 gray levels of the sub-block's histogram, clipping pixels with frequencies exceeding 475. The total number of clipped pixels is then counted and evenly distributed across all gray levels of the histogram, raising the overall baseline. The histogram is reconstructed, and the cumulative distribution function is calculated to generate a dedicated gray-level lookup table for this sub-block. Experimental data shows that setting the clipping threshold between 1.5% and 3% of the total number of pixels in the sub-block most effectively suppresses the salt-and-pepper noise amplification effect caused by rough aggregates on the concrete surface.

[0022] To eliminate blocky boundary artifacts caused by independent equalization between sub-blocks, bilinear interpolation is performed. Each pixel in the base grayscale distribution matrix is ​​traversed to determine its grid affiliation. For pixels in non-boundary regions, the four nearest sub-block center points are selected as reference points. The mapping results of the lookup tables corresponding to these four center points under the current pixel grayscale value are obtained, and a weighted average is performed based on the spatial distance weights of the current pixel relative to the four center points. Specifically, if the normalized distances of a pixel to the top-left, top-right, bottom-left, and bottom-right center points are respectively... , , , The corresponding mapping value is , , , Then the new grayscale value equals and and and The sum of these values. Through this process, the transition of pixel values ​​remains smooth and continuous at the boundaries of sub-blocks, ultimately outputting an enhanced, light-equalized image that significantly improves the contrast of areas with shadow occlusion or uneven lighting while preserving crack details.

[0023] The aforementioned weighted average algorithm is a grayscale method that assigns different coefficients based on the different contributions of different color channels of a pixel to the visual sensitivity of the human eye. Its calculation formula is that the grayscale value is equal to 0.299 multiplied by the red channel component plus 0.587 multiplied by the green channel component plus 0.114 multiplied by the blue channel component.

[0024] The bilinear interpolation operation mentioned above refers to an image processing method that performs linear interpolation in two directions and calculates the new gray value of the target pixel by weighting the gray values ​​of the four surrounding neighboring points.

[0025] Please see Figure 1 and Figure 3 S2: Construct a multi-scale Gaussian difference pyramid based on the illumination equalization enhanced image, calculate the second derivative of the Hessian matrix at each level, construct the structural tensor eigenvalues ​​using the second derivative of the Hessian matrix, measure the tubular geometric similarity based on the ratio of principal eigenvalues, and generate a tubular structure probability response map through weighted fusion. The specific steps of S2 are as follows: S21: Using a set of Gaussian kernel functions with different standard deviations, convolution operations are performed on the illumination equalization enhancement image to generate multiple sets of blurred images with different resolutions. The blurred images at adjacent scales are then differentially processed to construct a multi-scale Gaussian difference pyramid. S22: For each level of the multi-scale Gaussian difference pyramid image, the second derivative of each pixel in the horizontal, vertical and diagonal directions is calculated using the second-order partial differential operator to construct the second derivative of the Hessian matrix. S23: Perform eigenvalue decomposition on the second derivative of the Hessian matrix, extract the first and second eigenvalues ​​representing the directionality of the local geometric structure, construct the structural tensor eigenvalues ​​using the magnitude relationship and positive / negative sign attribute of the eigenvalues, and calculate the single-level tubular geometric similarity by combining the preset tubular metric function; The specific calculation process for the tubular geometric similarity in S23 includes: Obtain the first principal eigenvalue from the eigenvalues ​​of the structure tensor. With the second principal eigenvalue And satisfy A tubular metric model for suppressing sheet-like structures and enhancing linear structures is constructed using Gaussian membership functions. The tubular geometric similarity of each pixel is calculated based on the tubular metric model. The calculation formula is as follows: ; when hour ,in, The ratio representing the speckled structure is calculated as follows: , The Frobenius norm, representing the structure tensor, is used to measure the overall contrast intensity of local structures in an image. Its calculation formula is: , This represents a preset constant that controls the sensitivity of the spot. A preset constant representing the intensity of noise suppression; S24: Calculate the scale weighting coefficient based on the noise response intensity of each layer of the image, and use the scale weighting coefficient to linearly weight and superimpose the tubular geometric similarity of each layer to suppress non-crack texture noise and highlight the crack centerline response, thereby generating a tubular structure probability response map.

[0026] Multi-scale decomposition is performed on the illumination equalization enhanced image to capture crack features of varying widths. A discrete sequence of Gaussian smoothing scale parameters is defined, containing five scale values: 1.0, 1.6, 2.5, 4.0, and 6.4. The enhanced image is convolved using a Gaussian kernel function, with the kernel size set to six times the scale parameter plus one, generating five sets of images with different levels of blur. Subsequently, pixel-level subtraction is performed between blurred images of adjacent scales, i.e., subtracting the image at scale 1.0 from the image at scale 1.6, and so on, constructing a Gaussian difference pyramid with four levels. The Gaussian difference pyramid effectively simulates a bandpass filter, enhancing edge and texture information at specific scales in the image while suppressing low-frequency background illumination variations and high-frequency sensor noise.

[0027] For each level of the Gaussian difference pyramid image, the Hessian matrix is ​​calculated using a discretized second-order partial differential operator. A 3x3 Sobel operator is selected to calculate the second derivative of each pixel in the horizontal, vertical, and diagonal directions. For any coordinate point in the image, a 2x2 Hessian matrix is ​​constructed. For example, when a vertically oriented crack is detected, its horizontal second derivative will exhibit a drastic change in brightness curvature, such as a value reaching 150, while the vertical change will be gradual, such as a value of 10, and the diagonal direction will be close to 0. This second derivative feature can accurately describe the local geometric curvature information of the image.

[0028] The constructed Hessian matrix is ​​decomposed using eigenvalue decomposition, and the characteristic equation is solved to obtain two eigenvalues. To standardize the evaluation, the eigenvalues ​​are sorted by their absolute values, such that the absolute value of the first eigenvalue is less than or equal to the absolute value of the second eigenvalue. In this case, the second eigenvalue represents the direction with the maximum principal curvature of the local structure, and the first eigenvalue represents the direction with the minimum principal curvature. In crack detection scenarios, an ideal tubular structure should satisfy the condition that the absolute value of the first eigenvalue is approximately 0 and the absolute value of the second eigenvalue is much greater than 0.

[0029] The obtained feature values ​​are substituted into the tubular metric model to calculate the tubular geometric similarity. Set preset constants. A value of 0.5 is used to distinguish between speckled and linear structures; a preset constant is set. The value is 200, used to control the noise suppression intensity. The tubular geometric similarity of each pixel is calculated based on the modified tubular metric model, using the following formula: ; In the above formula, The value represents the ratio of the punctate structure measure, which is the ratio of the absolute value of the first eigenvalue to the absolute value of the second eigenvalue. The Frobenius norm of the structure tensor is the square root of the sum of the squares of the first and second eigenvalues. This represents a preset constant that controls the sensitivity of the spot. This represents a preset constant that controls the intensity of noise suppression.

[0030] A case study is conducted using a pixel at the center of a crack in an image. Assume the first feature value calculated for this point is -2, and the second feature value is 120. First, the speckled structure metric ratio is calculated, which is 2 divided by 120, approximately 0.0167. The Frobenius norm of the structure tensor is calculated, which is the square root of the sum of the squares of -2 and 120, approximately 120.016. Substituting these parameters into the formula: the first term is an exponential function of the natural logarithm base e, with the exponent being the square of -0.0167 divided by 2 multiplied by the square of 0.5, resulting in approximately 0.999; the second term is an exponential function of 1 minus the natural logarithm base e, with the exponent being the square of -120 divided by 2 multiplied by the square of 200, resulting in approximately 0.165. Finally, the tubular geometric similarity of this pixel is calculated to be 0.165. This result indicates that this pixel has a high probability of linear structure features.

[0031] The noise response intensity of each image layer is calculated, and the reciprocal of the variance of the background region is used as the scale weighting coefficient. For example, the coefficient for the first layer is 0.8, and the coefficient for the second layer is 1.2. The tubular geometric similarity of each layer is linearly weighted and superimposed using the scale weighting coefficient to suppress non-crack texture noise and highlight the crack centerline response, generating the final tubular structure probability response map.

[0032] The Hessian matrix mentioned above is a square matrix composed of the second-order partial derivatives of a multivariate function. It describes the local curvature of the function and is used in image processing to detect geometric structures such as edges, corners, and blobs.

[0033] Please see Figure 1 and Figure 4 S3: Perform maximum inter-class variance threshold segmentation on the probability response map of the tubular structure to obtain a binary disease mask, use morphological closing operation to connect the fractured disease areas, apply the axial transformation algorithm to refine the connected domain, and construct the crack topology skeleton. The specific steps for S3 are as follows: S31: The gray-level histogram of the probability response map of the statistical tubular structure is used to traverse all possible segmentation thresholds using the maximum inter-class variance method. The value that maximizes the sum of the variances of the background class and the target class is selected as the optimal segmentation threshold, and the response map is converted into a binary disease mask. S32: Construct a circular structural element with a preset radius. Use the circular structural element to first perform an expansion operation on the binarized disease mask to fill the tiny holes, and then perform an erosion operation to restore the original boundary. Connect the suspected disease areas that are broken due to noise interference to generate a connected domain with enhanced connectivity. S33: Apply an iterative refinement algorithm to the connected domain, peeling away the boundary pixels layer by layer while keeping the connectivity unchanged, until all diseased areas are reduced to the center line of a single pixel width, eliminating short redundant branches and retaining the main structure, and constructing the crack topology skeleton. The process of constructing the crack topology skeleton in S33 specifically includes: Perform distance transformation on the connected components, calculate the Euclidean distance from each foreground pixel to the nearest background pixel, generate a distance transformation map, and extract local maxima points in the distance transformation map as candidate skeleton points; The candidate skeleton points are connected using a fast traversal algorithm, and the skeleton branches are pruned by calculating the significance metric of the branch points. The burr branches with a length less than a preset threshold are removed, and the main skeleton that can reflect the extension trend of the crack body is retained to generate the crack topology skeleton.

[0034] The gray-level histogram of the probability response map of the statistical tubular structure is used, with gray levels ranging from 0 to 255. The optimal segmentation threshold is automatically calculated using the maximum inter-class variance method. Assuming the image pixels are divided into background and foreground classes, the inter-class variance is calculated for all possible thresholds. Table 1 lists the inter-class variance calculation results for some thresholds. Table 1. Threshold Selection Process Data Table ; As shown in Table 1, the inter-class variance reaches its maximum value of 4850 when the threshold is 128. Therefore, 128 is selected as the optimal segmentation threshold. Pixels with gray values ​​greater than 128 in the response image are set to 255, and those less than or equal to 128 are set to 0, thus generating a binarized lesion mask.

[0035] To address the micro-holes and fractures present in the binarized defect mask, a circular structuring element with a radius of 3 pixels is constructed. First, an expansion operation is performed to extend the foreground boundary outwards, filling the non-connected holes within the cracks. Then, an erosion operation is performed to shrink the boundary inwards, restoring the approximate outline of the cracks. This set of closing operations effectively connects suspected defect areas fractured due to aggregate reflection or dust obscuring the surface. Next, a connected component labeling algorithm is applied to identify all independent connected regions with an area greater than 50 pixels as candidate defect regions.

[0036] An iterative refinement algorithm is applied to the connected components, peeling away boundary pixels layer by layer while maintaining connectivity, until all diseased areas are reduced to a single-pixel-width centerline. A distance transformation is performed on the connected components, calculating the Euclidean distance from each foreground pixel to the nearest background pixel to generate a distance transformation map. Local maxima in the distance transformation map are extracted as candidate skeleton points. A fast traversal algorithm is used to connect the candidate skeleton points, and the skeleton branches are pruned by calculating the saliency metric of the branch points, removing burr branches shorter than 15 pixels, retaining the main skeleton that reflects the extension trend of the crack body, thus generating the crack topology skeleton.

[0037] The aforementioned maximum inter-class variance method is an adaptive image segmentation threshold determination method that achieves optimal binarization segmentation of the image by maximizing the inter-class variance between the foreground and background.

[0038] The aforementioned iterative thinning algorithm refers to an image skeleton extraction method that reduces the image region to a single-pixel wide line while maintaining the topological structure by repeatedly deleting the boundary points of the binary image.

[0039] Please see Figure 1 and Figure 5 S4: Search for the pixel gradient of the skeleton edge along the normal direction of the crack topology skeleton, calculate the local crack width based on the difference in the coordinates of the gradient extreme points, count the global extremes to generate the maximum crack width value, match the safety standard level library based on the maximum crack width value, and output the municipal civil engineering quality assessment level. The specific steps for S4 are as follows: S41: Traverse each skeleton pixel on the crack topology skeleton, calculate the tangent direction based on the connection relationship between the pixel and its eight neighboring pixels, and rotate the tangent direction by 90 degrees to obtain the normal direction. S42: Centered on the skeleton pixel, perform a bidirectional search along the normal direction on the original grayscale image, calculate the gradient change curve of the pixel grayscale value on the search path, mark the maximum gradient magnitude point as the crack edge point, calculate the Euclidean distance between the two edge points, and generate the local crack width. S43: Calculate the local crack width corresponding to all skeleton points of the entire crack, remove outliers and filter out the width data with the largest value, and define it as the maximum crack width value. S44: Obtain a safety standard level library containing multiple preset width ranges and corresponding quality levels, compare the maximum crack width value with the threshold range in the safety standard level library, determine the severity category of the current crack, and input the municipal civil engineering quality assessment level. The process of matching the security specification level library in S44 specifically includes: Obtain the maximum crack width value, as well as the crack length, area, and fractal dimension features, and construct a multidimensional disease feature vector; The multidimensional defect feature vector is input into a support vector machine classifier that has been pre-trained based on historical municipal civil engineering inspection data. Under the constraints of the safety standard level library, the probability of the current defect feature vector belonging to each safety level is calculated, and the level with the highest probability is selected as the output municipal civil engineering quality assessment level.

[0040] For each skeleton pixel on the crack topology skeleton, calculate the tangent direction based on the connection relationship between the pixel and its eight neighboring pixels, and rotate the tangent direction by 90 degrees to obtain the normal direction. Using the skeleton pixel as the center, perform a bidirectional search along the normal direction on the original grayscale image, calculating the gradient change curve of the pixel grayscale value along the search path. Mark the points with maximum gradient magnitudes as crack edge points, calculate the Euclidean distance between two edge points, and generate the local crack width.

[0041] Assuming that on the normal search path at a certain point, the coordinates of the left edge point are 100.5 and 200.5, and the coordinates of the right edge point are 105.2 and 204.8, and these coordinate values ​​are obtained through subpixel interpolation. The local width is calculated using the Euclidean distance formula, which is the square root of the sum of the squares of the differences in the horizontal and vertical coordinates. Substituting the aforementioned parameters into the calculation: the difference in the horizontal coordinate is 4.7, the difference in the vertical coordinate is 4.3, and the sum of their squares is 40.58, which gives 6.37 pixels. Considering the camera's imaging resolution of 0.1 mm per pixel, the pixel width is converted to the physical width, resulting in a calculated width of 0.637 mm.

[0042] The local crack widths corresponding to all skeleton points along the entire crack are statistically analyzed. After removing outliers, the width data with the largest value is selected and defined as the maximum crack width. For example, the maximum crack width of a certain crack is 0.85 mm after statistical analysis. Simultaneously, a multidimensional defect feature vector is constructed by obtaining crack lengths of 1500 mm, areas of 1200 square millimeters, and fractal dimensions of 1.25. A safety standard grade library containing multiple preset width ranges and corresponding quality levels is obtained. The multidimensional defect feature vector is then input into a support vector machine classifier pre-trained based on historical municipal civil engineering inspection data.

[0043] Table 2 lists the calculated probabilities of this feature vector belonging to each security level: Table 2. Probability Prediction of Security Level ; As shown in Table 2, the model output results indicate that the probability of this defect belonging to Grade III, i.e., severe defect, is the highest, at 0.78. Therefore, the grade with the highest probability is selected as the output municipal civil engineering quality assessment grade. This result shows that, through joint analysis of multi-dimensional features, compared to relying solely on a single width threshold, the classifier can more accurately classify the crack complexity.

[0044] The aforementioned support vector machine classifier is a supervised learning model that classifies data by finding the optimal hyperplane in a multidimensional feature space, exhibiting good generalization ability and nonlinear mapping capability.

[0045] A municipal civil engineering quality inspection system based on image processing, the system being used to execute the aforementioned municipal civil engineering quality inspection method based on image processing, the system comprising: The image acquisition and enhancement module is used to acquire the original image of the surface of municipal civil engineering, map it to the basic gray-level distribution matrix, calculate the local brightness statistics using the adaptive histogram equalization algorithm, perform illumination correction on the basic gray-level distribution matrix based on the local brightness statistics, and generate an illumination equalization enhanced image. The multi-scale feature extraction module is used to construct a multi-scale Gaussian difference pyramid based on the illumination equalization enhancement image, calculate the second derivative of the Hessian matrix at each level, construct the structural tensor eigenvalues ​​using the second derivative of the Hessian matrix, measure the tubular geometric similarity based on the ratio of principal eigenvalues, and generate a tubular structure probability response map through weighted fusion. The disease segmentation and skeletonization module is used to perform maximum inter-class variance threshold segmentation on the probability response map of tubular structures, obtain a binary disease mask, connect fractured disease regions using morphological closing operation, refine connected regions using the applied axial transformation algorithm, and construct a crack topological skeleton. The quality assessment and grading module is used to search for the pixel gradient of the skeleton edge along the normal direction of the crack topology skeleton, calculate the local crack width based on the difference in the coordinates of the gradient extreme points, generate the maximum crack width value by statistically analyzing the global extreme values, match the maximum crack width value with the safety specification level library, and output the municipal civil engineering quality assessment level.

[0046] The above embodiments illustrate preferred embodiments of the present invention. Any equivalent adjustments to the technical solution based on software engineering methods are within the scope of protection, including but not limited to: implementing algorithm logic using different programming languages, refactoring functional modules into services, adjusting data interaction protocols, and optimizing resource scheduling strategies. Any implementation scheme derived from reasonable modifications to the data processing flow, service call chain, or system architecture layer without departing from the core technology of the present invention should be considered within the protection scope defined by the technical solution of the present invention.

Claims

1. A method for quality inspection of municipal civil engineering projects based on image processing, characterized in that, Includes the following steps: S1: Collect the original image of the municipal civil engineering surface, map it to the basic gray-level distribution matrix, use the adaptive histogram equalization algorithm to calculate the local brightness statistics, perform illumination correction on the basic gray-level distribution matrix based on the local brightness statistics, and generate an illumination equalization enhanced image. S2: Construct a multi-scale Gaussian difference pyramid based on the illumination equalization enhancement image, calculate the second derivative of the Hessian matrix at each level, perform eigenvalue decomposition on the second derivative of the Hessian matrix to obtain the first eigenvalue and the second eigenvalue, calculate the tubular geometric similarity based on the ratio of the absolute values ​​of the first eigenvalue and the second eigenvalue and the norm determined by the first eigenvalue and the second eigenvalue, and generate a tubular structure probability response map through weighted fusion; S3: Perform maximum inter-class variance threshold segmentation on the probability response map of the tubular structure to obtain a binary disease mask, connect the fractured disease areas using morphological closing operation, refine the connected domains using the applied axial transformation algorithm, and construct the crack topological skeleton. S4: Search for the pixel gradient of the skeleton edge along the normal direction of the crack topology skeleton, calculate the local crack width based on the difference in the coordinates of the gradient extreme points, statistically analyze the global extreme values ​​to generate the maximum crack width value, match the safety standard level library based on the maximum crack width value, and output the municipal civil engineering quality assessment level.

2. The municipal civil engineering quality inspection method based on image processing according to claim 1, characterized in that, The specific steps of S1 are as follows: S11: Acquire the original image of the municipal civil engineering surface captured by a high-resolution industrial camera, and use the weighted average method to convert the red, green and blue three-channel pixel values ​​of the original surface image into single-channel brightness values ​​to construct a basic grayscale distribution matrix. S12: Divide the basic gray-level distribution matrix into non-overlapping rectangular sub-blocks, count the gray-level histogram in each rectangular sub-block and calculate the cumulative distribution function, and crop and redistribute the histogram peaks according to the preset contrast-limited threshold to generate a mapping lookup table. S13: Traverse each pixel in the basic grayscale distribution matrix, and calculate the new grayscale value of the pixel based on its position coordinates in the adjacent rectangular sub-blocks using a bilinear interpolation algorithm combined with the mapping lookup table, thereby eliminating block artifacts and outputting an illumination equalization enhanced image.

3. The municipal civil engineering quality inspection method based on image processing according to claim 1, characterized in that, The specific steps of S2 are as follows: S21: Convolve the illumination equalization enhancement image using a set of Gaussian kernel functions with different standard deviations to generate multiple sets of blurred images with different resolutions. Perform difference processing on the blurred images at adjacent scales to construct a multi-scale Gaussian difference pyramid. S22: For each level of the image in the multi-scale Gaussian difference pyramid, the second derivative of each pixel in the horizontal, vertical and diagonal directions is calculated using the second-order partial differential operator to construct the second derivative of the Hessian matrix. S23: Perform eigenvalue decomposition on the second derivative of the Hessian matrix to extract the first and second eigenvalues ​​representing the directionality of the local geometric structure. Use the first and second eigenvalues ​​as the eigenvalues ​​of the second derivative of the Hessian matrix, and calculate the single-level tubular geometric similarity in conjunction with a preset tubular metric function. The preset tubular metric function is a tubular metric model constructed using Gaussian membership functions to suppress sheet-like structures and enhance linear structures. The specific calculation process of the tubular geometric similarity includes: Obtain the first eigenvalue λ1 and the second eigenvalue λ2 from the eigenvalues ​​of the second derivative of the Hessian matrix, and satisfy the following conditions: A tubular metric model for suppressing sheet-like structures and enhancing linear structures is constructed using Gaussian membership functions. The tubular geometric similarity of each pixel is calculated based on the tubular metric model. The calculation formula is as follows: ; when hour ,in, The ratio representing the speckled structure is calculated as follows: , The norm, determined by the first and second eigenvalues, is used to measure the overall contrast intensity of local structures in an image. Its calculation formula is: , This represents a preset constant that controls the sensitivity of the spot. A preset constant representing the intensity of noise suppression; S24: Calculate the scale weighting coefficient based on the noise response intensity of each level of image, and use the scale weighting coefficient to linearly weight and superimpose the tubular geometric similarity of each level to suppress non-crack texture noise and highlight the crack centerline response, thereby generating a tubular structure probability response map.

4. The municipal civil engineering quality inspection method based on image processing according to claim 1, characterized in that, The specific steps in S3 are as follows: S31: Statistically analyze the gray-level histogram of the probability response map of the tubular structure, use the maximum inter-class variance method to traverse all possible segmentation thresholds, select the value that maximizes the inter-class variance between the background class and the target class as the optimal segmentation threshold, and convert the response map into a binary disease mask. S32: Construct a circular structural element with a preset radius, and use the circular structural element to first perform an expansion operation on the binarized disease mask to fill the tiny holes, and then perform an erosion operation to restore the original boundary, connect the suspected disease areas that are broken due to noise interference, and generate a connected domain with enhanced connectivity. S33: Apply an iterative refinement algorithm to the connected domain, peeling away boundary pixels layer by layer while maintaining connectivity, until all diseased areas are reduced to the centerline of a single pixel width, eliminating short redundant branches and retaining the main structure, and constructing the crack topology skeleton.

5. The municipal civil engineering quality inspection method based on image processing according to claim 1, characterized in that, The specific steps of S4 are as follows: S41: Traverse each skeleton pixel on the crack topology skeleton, calculate the tangent direction according to the connection relationship between the pixel and its eight neighboring pixels, and rotate the tangent direction by 90 degrees to obtain the normal direction. S42: Using the skeleton pixel as the center, perform a bidirectional search on the original grayscale image along the normal direction, calculate the gradient change curve of the pixel grayscale value on the search path, mark the maximum gradient magnitude point as the crack edge point, calculate the Euclidean distance between the two edge points, and generate the local crack width. S43: Calculate the local crack width corresponding to all skeleton points of the entire crack, remove outliers and select the width data with the largest value, and define it as the maximum crack width value. S44: Obtain a safety standard level library containing multiple preset width ranges and corresponding quality levels, compare the maximum crack width value with the threshold range in the safety standard level library, determine the severity category of the current crack, and output the municipal civil engineering quality assessment level.

6. The municipal civil engineering quality inspection method based on image processing according to claim 2, characterized in that, The calculation process of the contrast-limited threshold in S12 specifically includes: Obtain the total number of pixels of the rectangular sub-block and the dynamic range of the preset basic gray-level distribution matrix, calculate the adaptive cropping coefficient based on the information entropy of the image, and use the adaptive cropping coefficient to determine the contrast-limited threshold. During histogram equalization, the frequency of pixels exceeding the contrast-limited threshold is truncated, and the truncated pixel frequencies are evenly distributed to other gray levels of the histogram to prevent background noise from being excessively amplified during local contrast enhancement.

7. The municipal civil engineering quality inspection method based on image processing according to claim 4, characterized in that, The process of constructing the crack topology skeleton in S33 specifically includes: Perform distance transformation on the connected components, calculate the Euclidean distance from each foreground pixel to the nearest background pixel, generate a distance transformation map, and extract local maxima points in the distance transformation map as candidate skeleton points; The candidate skeleton points are connected using a fast traversal algorithm, and the skeleton branches are pruned by calculating the saliency metric of the branch points. The burr branches with a length less than a preset threshold are removed, and the main skeleton that can reflect the extension trend of the crack body is retained to generate the crack topology skeleton.

8. The municipal civil engineering quality inspection method based on image processing according to claim 5, characterized in that, The process of matching the security specification level library in S44 specifically includes: The maximum crack width value, crack length, area, and fractal dimension features are obtained to construct a multidimensional disease feature vector; The multidimensional defect feature vector is input into a support vector machine classifier that has been pre-trained based on historical municipal civil engineering inspection data. Under the constraints defined by the safety standard level library, the probability that the current defect feature vector belongs to each safety level is calculated, and the level with the highest probability is selected as the output municipal civil engineering quality assessment level.

9. A municipal civil engineering quality inspection system based on image processing, characterized in that, The system is used to implement the image processing-based municipal civil engineering quality inspection method according to any one of claims 1-8, and the system includes: The image acquisition and enhancement module is used to acquire the original image of the surface of municipal civil engineering, map it to the basic gray-level distribution matrix, calculate the local brightness statistics using the adaptive histogram equalization algorithm, perform illumination correction on the basic gray-level distribution matrix based on the local brightness statistics, and generate an illumination equalization enhanced image. The multi-scale feature extraction module is used to construct a multi-scale Gaussian difference pyramid based on the illumination equalization enhancement image, calculate the second derivative of the Hessian matrix at each level, perform feature decomposition on the second derivative of the Hessian matrix to obtain the first eigenvalue and the second eigenvalue, calculate the tubular geometric similarity based on the ratio of the absolute values ​​of the first eigenvalue and the second eigenvalue and the norm determined by the first eigenvalue and the second eigenvalue, and generate a tubular structure probability response map through weighted fusion. The disease segmentation and skeletonization module is used to perform maximum inter-class variance threshold segmentation on the probability response map of the tubular structure, obtain a binary disease mask, connect the fractured disease regions using morphological closing operation, refine the connected domains using the applied axial transformation algorithm, and construct the crack topological skeleton. The quality assessment and grading module is used to search for the pixel gradient of the skeleton edge along the normal direction of the crack topology skeleton, calculate the local crack width based on the difference in the coordinates of the gradient extreme points, generate the maximum crack width value by statistically analyzing the global extreme values, match the maximum crack width value with the safety standard level library, and output the municipal civil engineering quality assessment level.

Citation Information

Patent Citations

  • Intelligent crack detection and early warning system for bridge safety operation and maintenance

    CN121504885A

  • Slope crack high-resolution image intelligent identification and quantification method and system

    CN122067112A