Image monitoring system for traditional village heritage risk assessment

By performing geometric correction and brightness equalization on the surface images of traditional village heritage buildings, combined with grayscale gradient direction field data, and enhancing crack feature analysis, the assessment adaptability problem of multi-material structures in traditional village heritage risk assessment is solved, and high-quality risk assessment and adaptive grading are achieved.

CN120495877APending Publication Date: 2025-08-15NANJING FORESTRY UNIV
View PDF 0 Cites 10 Cited by

Patent Information

Application Number
CN202510561913.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The existing technology lacks the ability to track the crack topology, and it is difficult to eliminate isolated pore interference through path connection strength analysis, making it difficult to adapt to the evaluation results of traditional village heritage risk assessment in the multi-material hybrid structure scenario.

Method used

The heritage image acquisition module is used to perform geometric correction and brightness equalization. Combined with the grayscale gradient direction field data to quantify the consistency of crack textures in the neighborhood range, the grayscale contrast of continuous crack edges is enhanced through a dynamic threshold adjustment mechanism, and a path connection intensity evaluation method for extreme point pairs is introduced to construct an adaptive risk discrimination strategy.

Benefits of technology

The image distortion caused by different shooting angles and uneven lighting is eliminated, and the input data quality of feature analysis is improved, real cracks and isolated pore noise are distinguished, and risk assessment results are achieved across materials.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120495877A_ABST
    Figure CN120495877A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image recognition, in particular to an image monitoring system for traditional village heritage risk assessment, and the system comprises a heritage image collection module which is used for obtaining an image data stream of a target traditional village building surface, carrying out the geometric correction of original heritage image data, carrying out the image brightness equalization processing, and obtaining an image data stream of the target traditional village building surface; and establishing a calibrated image set. According to the method, image distortion and local overexposure caused by shooting angle difference or uneven illumination on the surface of a traditional village building are eliminated through geometric correction and brightness equalization processing, and the input data quality of subsequent feature analysis is improved. The consistency degree of crack textures in a neighborhood range is quantified based on gray gradient direction field data, the gray contrast of continuous crack edges is enhanced in combination with a dynamic threshold adjustment mechanism, non-structural texture interference is inhibited, and separability of micro cracks and background materials is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and in particular to an image monitoring system for traditional village heritage risk assessment. Background Art

[0002] The field of image recognition technology mainly studies how to automatically detect, locate, classify and analyze the features of target objects in images or videos through algorithms and computational models.

[0003] Existing technologies lack the ability to dynamically track crack topology, making it difficult to eliminate interference from isolated pores through path connectivity analysis, resulting in limitations in assessing structural continuity risks. Furthermore, a dynamic discrimination mechanism associated with the characteristics of different building materials has not been established, making assessment results difficult to adapt to complex scenarios involving mixed-material structures. Therefore, improvements are needed. Summary of the Invention

[0004] The purpose of the present invention is to solve the shortcomings of the existing technology and propose an image monitoring system for traditional village heritage risk assessment.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: An image monitoring system for traditional village heritage risk assessment includes:

[0006] The heritage image acquisition module acquires the image data stream of the target traditional village building surface, performs geometric correction on the original heritage image data, and performs image brightness equalization processing to establish a calibrated image set;

[0007] A structural texture enhancement module calculates the image grayscale gradient amplitude and image grayscale gradient direction of each pixel based on the calibrated image set, obtains gradient direction field data, analyzes the degree of gradient direction consistency within a preset neighborhood range in the gradient direction field data, and enhances the grayscale value according to the gradient direction consistency to obtain an enhanced crack feature map;

[0008] A microevolution analysis module, based on the enhanced crack feature map, identifies connected components in the image that represent potential structural cracks, calculates local minimum and local maximum points of the image grayscale value within the connected components, obtains a set of grayscale extreme points, evaluates the grayscale differences and spatial connection paths between extreme point pairs in the grayscale extreme point set, screens extreme point pairs whose grayscale differences exceed a target threshold, and establishes a significant topological structure identifier;

[0009] The risk status identification module counts the number of identified structural cracks based on the significant topological structure identification, generates a structural quantitative measurement value, compares the structural quantitative measurement value with the risk identification threshold value set for different materials of traditional village buildings, and obtains the heritage structure risk classification.

[0010] Preferably, the steps of obtaining the calibrated image set are:

[0011] A continuous image data stream of the target traditional village building surface is captured by a camera at a rate of 30 frames per second. Geometric deviations caused by shooting angle tilt or lens distortion in the continuous image data stream are mapped to a preset standard orthogonal coordinate system with the center point of the building facade as the origin. This eliminates trapezoidal distortion and barrel distortion, generating geometrically corrected image data.

[0012] Based on the geometrically corrected image data, the image is segmented into non-overlapping sub-regions using a 50×50 pixel sliding window, the grayscale histogram distribution of each sub-region is calculated, the grayscale value dynamic range of each sub-region histogram is stretched, the contrast enhancement amplitude is constrained to not exceed a preset upper limit of 2.0, and the equalization results of all sub-regions are fused to generate brightness-balanced image data;

[0013] The geometrically corrected image data and the brightness-balanced image data are aligned according to pixel positions. The local texture complexity of each pixel point is used as a weighting factor. The pixel grayscale value of the geometrically corrected image data is assigned a weight of 0.6, and the pixel grayscale value of the brightness-balanced image data is assigned a weight of 0.4. Weighted superposition fusion is performed, and Gaussian filtering is performed on the edge areas of the fused images to output the calibrated image set.

[0014] Preferably, the steps of obtaining the gradient direction field data are:

[0015] Based on the calibrated image set, a 3×3 Sobel horizontal convolution kernel is used to perform a horizontal convolution operation on each pixel to calculate the horizontal gradient component. At the same time, a 3×3 Sobel vertical convolution kernel is used to perform a vertical convolution operation to calculate the vertical gradient component. The image boundary area is expanded by a mirror filling method and then convolved to generate a horizontal gradient component matrix and a vertical gradient component matrix;

[0016] Based on the horizontal gradient component matrix and the vertical gradient component matrix, the horizontal gradient component and the vertical gradient component of each pixel are squared and summed, and the square root of the square sum result is taken to obtain the gradient amplitude of the corresponding pixel. At the same time, the horizontal gradient component and the vertical gradient component of each pixel are operated by the inverse tangent function, and the calculation results are converted into angle values to generate the gradient direction angle matrix;

[0017] Integrate the gradient magnitude and gradient direction angle matrix, store the gradient magnitude and gradient direction angle of each pixel in a one-to-one correspondence according to the pixel coordinate position, and construct the gradient direction field data.

[0018] Preferably, the steps for obtaining the enhanced crack characteristic map are:

[0019] Based on the gradient direction field data, a neighborhood window is defined with the current pixel as the center, the gradient direction angles of all pixels in the neighborhood are traversed, the absolute value of the angle difference between the gradient direction of each pixel and the direction of the center pixel is calculated, and the proportion of pixels with an absolute difference value less than 15° to the total number of neighborhood pixels is counted to generate a direction consistency matrix;

[0020] Calculating the grayscale enhancement coefficient of each pixel based on the direction consistency matrix;

[0021] According to the grayscale enhancement coefficient, the grayscale value is modified to generate an enhanced crack feature map.

[0022] Preferably, the step of obtaining the grayscale extreme value point set is:

[0023] Based on the enhanced crack feature map, a morphological closing operation is used to eliminate isolated noise points, and an 8-neighborhood connectivity criterion is used to traverse all pixels, merge adjacent pixels with a grayscale value difference of less than 20, mark all closed area contours, and generate a connected component area set;

[0024] Based on the connected component area set, calculate the extreme value density of each connected component;

[0025] Connected components are screened based on the extreme value density, and a neighborhood scan is performed on the pixels within each connected component to detect coordinates that meet the local minimum, that is, the grayscale value of the center point is less than that of all neighboring points, or the local maximum, that is, the grayscale value of the center point is greater than that of all neighboring points. All coordinate points that meet the conditions are extracted to form a set of grayscale extreme value points.

[0026] Preferably, the steps of obtaining the significant topological structure identifier are:

[0027] Based on the grayscale extreme value point set, generating a connection path along the path with the highest gradient amplitude in the gradient direction field data for each pair of extreme value points, extracting the gradient amplitude set of all pixel points on the path, and generating a data set of connection paths of extreme value point pairs;

[0028] Calculating a connection strength score for each pair of extreme point pairs based on the extreme point pair connection path dataset;

[0029] Based on the connection strength score, extreme point pairs with connection strength scores greater than a target threshold are screened, spatial paths are merged to form a topological structure, and a significant topological structure identifier is generated.

[0030] Preferably, the steps for obtaining the structural quantization measurement value are:

[0031] Based on the significant topological structure identification, all identified connected areas are traversed, and the minimum circumscribed rectangle aspect ratio and area of each connected area are calculated. Areas with an aspect ratio greater than 5 and an area greater than 10 pixels are screened and determined to be structural cracks. The total number of connected areas that meet the conditions is counted to generate a statistical result of the number of structural cracks;

[0032] Based on the connected area set corresponding to the statistical result of the number of structural cracks, skeletonize each structural crack area, extract the pixel coordinates of the skeleton centerline, calculate the cumulative Euclidean distance between the centerline pixels, and multiply it by the preset actual length conversion coefficient corresponding to the unit pixel to generate the total length value of the structural crack;

[0033] Based on the remaining connected areas in the significant topological structure identification that have not been determined to be structural cracks, the number of pixel coverage of each pore area is calculated, multiplied by the actual area conversion coefficient per unit pixel, and the area calculation results of all pore areas are accumulated to generate a total material pore area value. The statistical results of the number of structural cracks, the total length of structural cracks and the total material pore area are integrated to form a structural quantitative measurement value.

[0034] Preferably, the steps for obtaining the heritage structure risk classification are:

[0035] Based on the total pore area value of the material in the structural quantitative measurement value, the material type database of the corresponding components of traditional village buildings is matched, and the preset risk discrimination threshold parameter group of each material type is extracted, including the crack number threshold, the total crack length threshold and the pore area threshold, to generate a material risk discrimination threshold set;

[0036] Based on the material risk discrimination threshold set, the crack number statistics, total crack length values, and total pore area values in the structural quantitative measurement values are compared one by one with the crack number threshold, total crack length threshold, and pore area threshold of the corresponding material, and the number of times each parameter exceeds the threshold is recorded to generate parameter violation statistics;

[0037] Based on the statistical results of the number of parameter violations, risk level classification rules are set, the number of violations is mapped to a preset risk level label, and the heritage structure risk classification is generated.

[0038] Compared with the prior art, the advantages and positive effects of the present invention are:

[0039] In the present invention, geometric correction and brightness equalization are used to eliminate image distortion and local overexposure on the surface of traditional village buildings caused by differences in shooting angles or uneven lighting, thereby improving the input data quality for subsequent feature analysis. The consistency of crack textures within the neighborhood is quantified based on grayscale gradient directional field data, and the dynamic threshold adjustment mechanism is combined to enhance the grayscale contrast of continuous crack edges, suppress non-structural texture interference, and enhance the separability of tiny cracks from background materials. A path connection strength assessment method for extreme point pairs is introduced, and by fusing grayscale differences, spatial distances, and path gradient consistency parameters, real cracks and isolated pore noise are distinguished. The structural quantification measurement value is dynamically matched with the multi-material risk discrimination threshold, and an adaptive grading strategy based on engineering specifications and historical data is constructed, so that the risk assessment results have cross-material comparability and practical maintenance guidance value. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 It is a system flow chart of the present invention. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0042] See also Figure 1 The present invention provides a technical solution: an image monitoring system for traditional village heritage risk assessment, comprising:

[0043] The heritage image acquisition module acquires the image data stream of the target traditional village building surface, performs geometric correction on the original heritage image data, and performs image brightness equalization processing to establish a calibrated image set;

[0044] The structural texture enhancement module calculates the image grayscale gradient amplitude and image grayscale gradient direction of each pixel based on the calibrated image set, obtains the gradient direction field data, analyzes the degree of gradient direction consistency within a preset neighborhood range in the gradient direction field data, and enhances the grayscale value according to the gradient direction consistency to obtain an enhanced crack feature map;

[0045] The microevolution analysis module, based on the enhanced crack feature map, identifies connected components in the image that represent potential structural cracks, calculates the local minimum and local maximum points of the image grayscale value within the connected components, obtains a set of grayscale extreme points, evaluates the grayscale difference and spatial connection paths between extreme point pairs in the grayscale extreme point set, screens extreme point pairs whose grayscale difference exceeds the target threshold, and establishes a significant topological structure marker;

[0046] The risk status identification module counts the number of identified structural cracks based on significant topological structure identification, generates structural quantitative measurement values, and compares the structural quantitative measurement values with the risk discrimination thresholds set for different materials of traditional village buildings to obtain the heritage structure risk classification.

[0047] The steps to obtain the calibrated image set are:

[0048] A continuous image data stream of the target traditional village building surface is captured by a camera at a rate of 30 frames per second. Geometric deviations caused by shooting angle tilt or lens distortion in the continuous image data stream are mapped to a preset standard orthogonal coordinate system with the center point of the building facade as the origin. This eliminates trapezoidal distortion and barrel distortion, generating geometrically corrected image data.

[0049] Based on the geometrically corrected image data, the image is segmented into non-overlapping sub-regions using a 50×50 pixel sliding window. The grayscale histogram distribution of each sub-region is calculated separately. The grayscale value dynamic range of each sub-region histogram is stretched, and the contrast enhancement amplitude is constrained to not exceed a preset upper limit of 2.0. The equalization results of all sub-regions are fused to generate brightness-balanced image data.

[0050] The geometrically corrected image data and the brightness-balanced image data are aligned according to pixel positions. The local texture complexity of each pixel is used as the weight factor. The pixel grayscale value of the geometrically corrected image data is assigned a weight of 0.6, and the pixel grayscale value of the brightness-balanced image data is assigned a weight of 0.4. Weighted superposition fusion is performed, and the edge area of the fused image is smoothed by Gaussian filtering to output the calibrated image set.

[0051] Specifically, by installing a camera device at a fixed position or on a controllable mobile platform (such as a drone) to ensure a stable shooting distance and angle, the acquisition frame rate is set to 30 frames per second, and images of the surface of the target traditional village building are continuously acquired to form an image data stream containing time series information. For each frame of the image data stream, the geometric deformation caused by the failure of the camera device to be completely perpendicular to the building facade or the physical characteristics of the lens itself is first detected. Specifically, by identifying the known parallel or vertical lines of the building in the image (such as wall corners, window frame edges), the intersection or inclination angle of these lines in the image is calculated, and compared with their state (parallel or vertical) in the ideal front view, the degree of keystone distortion is quantified. At the same time, the lens distortion parameters (mainly radial distortion coefficients k1, k2, k3 and tangential distortion coefficients p1, p2) measured in advance by the checkerboard calibration method are used to evaluate the influence of barrel or pincushion distortion. Then, a method is established from the perspective of the image data stream. The mapping relationship between the current image pixel coordinates (u, v) and the preset standard orthogonal coordinate system (X, Y) is established. This standard coordinate system takes the geometric center point of the building facade (which can be determined through building design drawings or on-site mapping) as the origin, and the horizontal and vertical axes are parallel to the horizon and the direction of gravity, respectively. The mapping process applies an inverse distortion model. For example, for a pixel (u, v), its ideal undistorted coordinates (u′, v′) are first corrected according to the lens distortion model and then converted to the (X, Y) coordinate system using the perspective transformation matrix (calculated based on the identified building lines and the ideal state). Using this mapping relationship, the corresponding position of each point on the standard coordinate system grid in the original image (which may be non-integer coordinates) is inversely calculated. The grayscale value of each point is calculated based on the grayscale values of the neighboring pixels in the original image using bilinear or bicubic interpolation methods. The grayscale value is then filled into the new image matrix to eliminate the trapezoidal and barrel distortion in the original image and generate geometrically corrected image data.

[0052] Based on the geometrically corrected image data obtained in the previous step, the local brightness and contrast of the image are adjusted. First, a sliding window of size 50 pixels by 50 pixels is set. The size selection is based on the empirical evaluation of the scale of common textures on the surface of traditional village buildings (such as brick joints, wood grain, and peeling areas). The purpose is to ensure that the window can contain enough local information without being too large to lose locality. The window is moved horizontally and vertically with a step size of 50 pixels to divide the entire geometrically corrected image into a series of non-overlapping sub-regions (for areas that cannot be completely covered by the image edge, you can choose to ignore or use a filling strategy such as mirror filling post-processing). For each independent 50×50 pixel sub-region, the grayscale value distribution of all pixels within it is calculated to generate the grayscale histogram of the region. Subsequently, the histogram equalization operation is performed independently on the grayscale histogram of each sub-region, that is, its cumulative distribution function (CDF) is calculated, and this CDF is used as a lookup table to map the grayscale levels of the original pixels in the sub-region to the new grayscale levels to achieve dynamic range stretching of the grayscale value. In this process, a The upper limit of the contrast enhancement amplitude is 2.0, which was determined experimentally to enhance details such as cracks while avoiding excessive amplification of image noise. Specifically, before calculating the CDF of each subregion, its histogram is clipped. The clipping threshold is calculated as (total number of subregion pixels × contrast upper limit) / total number of grayscale levels, that is, (50 × 50 × 2.0) / 256 ≈ 19.5, rounded to 19 or 20. The portion of the histogram where the number of grayscale levels exceeds this threshold is truncated, and the total number of truncated pixels is evenly redistributed across all grayscale levels. The CDF is then calculated based on the clipped and redistributed histogram for mapping. After completing local equalization of all subregions, bilinear interpolation is used to fuse the processing results of all subregions to avoid blocking artifacts. For any pixel in the image, its final grayscale value is determined by the equalization mapping functions corresponding to the centers of the four adjacent subregions surrounding its location. A weighted average is taken based on the distance from the pixel to these four subregion centers to generate an overall smooth transition of brightness-balanced image data.

[0053] The geometrically corrected image data generated in the first step is fused with the brightness-balanced image data generated in the second step. The two data are naturally aligned in pixel position because the latter is obtained based on the former. The goal of the fusion is to combine the structural fidelity of the geometrically corrected image data with the detail enhancement of the brightness-balanced image data. The pixel-level fusion is performed using a weighted superposition method, and the pixel grayscale value of the geometrically corrected image data is given a fixed weight coefficient of 0.6, which is denoted as W. corrected =0.6, a fixed weight coefficient of 0.4 is assigned to the pixel grayscale value of the brightness balanced image data, recorded as W equalized=0.4. The two weight values are set based on the following principles: the geometrically corrected image retains more realistic macro-structural information and should dominate, while the brightness-balanced image mainly contributes to the contrast of local details. As a supplement, multiple experiments were conducted to compare the effects of different weight combinations (such as 0.5 / 0.5, 0.7 / 0.3, etc.) on the subsequent crack detection effect. Finally, 0.6 and 0.4 were selected as the best empirical combination for balancing macro-structure and local details, ensuring that the sum of the two weights is 1.0. For each pixel position (i, j) in the image, the fused grayscale value is Fused. i,j Calculated by the following formula: Fused i,j =W corrected Corrected i,j +W equalized Equalized i,j , where Corrected i,j and Equalized i,j are the grayscale values of the geometrically corrected image and the brightness-balanced image at (i, j), respectively. After completing the pixel-by-pixel weighted fusion, the edge area of the fused image (for example, defined as the area within 10 pixels from the image boundary) is smoothed by applying Gaussian filtering. A Gaussian kernel with a standard deviation of σ = 1.0 and a window size of 3 × 3 is selected. This operation is intended to mitigate mutations or artifacts that may be introduced by the boundary effect of image processing, while avoiding blurring the main content of the central area of the image. Finally, the processed calibrated image set is output.

[0054] The steps to obtain gradient direction field data are:

[0055] Based on the calibrated image set, a 3×3 Sobel horizontal convolution kernel is used to perform horizontal convolution operation on each pixel to calculate the horizontal gradient component. At the same time, a 3×3 Sobel vertical convolution kernel is used to perform vertical convolution operation to calculate the vertical gradient component. The image boundary area is expanded by mirror filling and then convolution is performed to generate the horizontal gradient component matrix and the vertical gradient component matrix.

[0056] Based on the horizontal gradient component matrix and the vertical gradient component matrix, the horizontal gradient component and the vertical gradient component of each pixel are squared and summed, and the square root of the square sum result is taken to obtain the gradient amplitude of the corresponding pixel. At the same time, the horizontal gradient component and the vertical gradient component of each pixel are operated by the inverse tangent function, and the calculation results are converted into angle values to generate the gradient direction angle matrix;

[0057] Integrate the gradient magnitude and gradient direction angle matrix, store the gradient magnitude and gradient direction angle of each pixel in a one-to-one correspondence according to the pixel coordinate position, and construct the gradient direction field data.

[0058] Specifically, based on the calibrated image set obtained in the previous stage, the image set has been geometrically corrected and brightness balanced. The gradient calculation is performed to extract edge and texture information. The 3×3 Sobel operator is selected for operation. First, the Sobel horizontal convolution kernel is defined, which is in the form of The convolution kernel is used to detect the grayscale change rate of the image in the horizontal direction, and the Sobel vertical convolution kernel is defined at the same time, which is in the form of The convolution kernel is used to detect the grayscale change rate of the image in the vertical direction. Before performing the convolution operation, the boundary of the calibrated image set is processed by using a mirror filling method. Specifically, the grayscale value of the virtual pixel outside the image boundary is set to the grayscale value of the internal pixel at its mirror symmetric position. For example, the grayscale value of the virtual pixel (-1, j) outside the leftmost column pixel (0, j) of the image is set to the grayscale value of (1, j). The required pixels outside all boundaries are filled in this way (for a 3x3 kernel, one circle needs to be filled). Then, the horizontal convolution kernel G x Applied to the filled image, for each pixel point (i, j) inside, the grayscale value of the pixel in its 3×3 neighborhood is compared with G x The coefficients of the corresponding positions are multiplied and summed to obtain the horizontal gradient component value G of the point x (i, j), perform this operation on all pixels, and similarly, add the vertical convolution kernel G y Applied to the filled image, the vertical gradient component value G of each pixel is calculated y (i, j), and finally generate the horizontal gradient component matrix and vertical gradient component matrix with the same size as the original calibrated image set.

[0059] Based on the horizontal gradient component matrix generated in the previous step (denoted as G x ) and the vertical gradient component matrix (denoted as G y ), further calculate the gradient magnitude and gradient direction of each pixel, for any pixel position (i, j) in the image, from G x Get its horizontal gradient component G from the matrix x (i,j), from G y Get its vertical gradient component G from the matrix y (i, j), calculate the gradient amplitude of the pixel point, using the Euclidean distance formula, that is, square the horizontal gradient component and the vertical gradient component, sum them, and then take the square root of the result. The specific calculation is: The amplitude reflects the intensity of the grayscale change at that point. The gradient amplitudes calculated for all pixel points are stored at the corresponding (i, j) position to form a gradient amplitude matrix. At the same time, the gradient direction angle of the pixel point is calculated using the inverse tangent function. To ensure the accuracy of the angle calculation and cover all quadrants (0 to 360 degrees or -180 to +180 degrees), the two-parameter inverse tangent function atan2 is used. The input is the vertical gradient component and the horizontal gradient component, namely Angle rad (i,j)=atan2(G y (i,j),G x (i, j)), the angle value returned by this function is in radians, which usually ranges from -π to π. Subsequently, the calculated radian value is converted to an angle value by multiplying it by the conversion factor 180 / π and adjusting the result to the standard range of 0 to 360 degrees, for example, by using Angle deg (i,j)=(Angle rad The calculation of (i, j) × 180 / π + 360) mod 360 is implemented. This angle represents the direction in which the grayscale changes fastest. The gradient direction angle values (in degrees) calculated for all pixel points are stored in the corresponding (i, j) position to generate the gradient direction angle matrix.

[0060] Integrate the gradient magnitude matrix and gradient direction angle matrix calculated in the previous step, both of which have the same pixel dimensions as the original calibrated image set. The goal is to build a structured dataset in which each pixel is associated with its two key attributes, gradient magnitude and gradient direction. The specific operation is to create a new data structure that logically or physically associates each pixel coordinate (i, j) with its corresponding gradient magnitude Magnitude (i, j) and gradient direction angle Angle deg (i, j) binding storage, for example, you can construct a two-dimensional array of the same size as the original image, where each array element is a record or object containing two values, the first value is the gradient magnitude, the second value is the gradient direction angle, traverse all pixel coordinates (i, j), extract Magnitude (i, j) from the gradient magnitude matrix, extract Angle from the gradient direction angle matrix deg (i,j), and the pair of values (Magnitude(i,j),Angle deg (i, j)) is stored in the corresponding position (i, j) in the new data structure. After the integration and storage of all pixels are completed, the gradient direction field data is constructed. This dataset provides the basic input for subsequent processing steps such as analyzing the consistency of gradient direction, making it easy to query the gradient strength and direction information of any pixel position.

[0061] The steps for obtaining the enhanced crack feature map are:

[0062] Based on the gradient direction field data, a neighborhood window is defined with the current pixel as the center. The gradient direction angles of all pixels in the neighborhood are traversed. The absolute value of the angle difference between the gradient direction of each pixel and the direction of the center pixel is calculated. The proportion of pixels with an absolute difference value less than 15° to the total number of neighborhood pixels is counted to generate a direction consistency matrix.

[0063] Based on the directional consistency matrix, the grayscale enhancement coefficient of each pixel is calculated using the following formula:

[0064]

[0065] Among them, E i,j is the grayscale enhancement coefficient, G i,j is the gradient amplitude of the coordinate (i, j) in the gradient direction field data, C i,j is the directional consistency ratio value of the coordinate (i, j) in the directional consistency matrix, and T is the preset directional consistency threshold (set to 0.7);

[0066] According to the grayscale enhancement coefficient, the grayscale value is modified to generate an enhanced crack feature map.

[0067] Specifically, based on the gradient direction field data obtained in the previous stage, which contains the gradient amplitude and gradient direction angle of each pixel, a directional consistency analysis is performed. First, a square neighborhood window is defined for each pixel point (i, j) in the image, and the window size is selected as 5×5 pixels. This size is an empirical value determined based on the typical crack width and image resolution. It aims to capture local directional trends while being insensitive to small noise. With the current pixel point (i, j) as the center, all 24 adjacent pixels in its 5×5 neighborhood (excluding the center pixel itself) are traversed. For each pixel (k, l) in the neighborhood, its gradient direction angle Angle is read from the gradient direction field data. neighbor And the gradient direction angle Angle of the center pixel center , calculate the absolute value of the angle difference between the two, that is, |ΔAngle|=|Angle neighbor -Angle center|, pay special attention to the periodicity of the angle. For example, the difference between 355 degrees and 5 degrees is 10 degrees, not 350 degrees. When calculating, use min(|ΔAngle|,360°-|ΔAngle|) to obtain the minimum angle difference. Compare the absolute value of the calculated angle difference with the preset angle consistency judgment threshold of 15 degrees. This 15-degree threshold is an empirical value obtained based on a large number of traditional village building image samples containing various surface textures and cracks. It is found that under this threshold, it is possible to better distinguish between real crack areas (gradient directions tend to be consistent) and complex texture or noise areas (gradient directions vary greatly). Count the number of pixels in the 5×5 neighborhood of the current pixel (i, j) whose absolute angle difference is less than 15 degrees, recorded as Count. consistent Then, calculate the ratio of this number to the total number of pixels in the neighborhood (24) and get the directional consistency ratio value C i,j =Count consistent / 24, store the directional consistency ratio value calculated for each pixel in the corresponding position to generate a directional consistency matrix.

[0068] formula: The formula is beneficial in that it combines the pixel gradient magnitude G i,j (indicates edge strength) and the consistency ratio value C of its neighborhood gradient direction i,j (indicates the linearity of the feature) to achieve adaptive enhancement of potential crack features. The inverse tangent function provides a smooth nonlinear conversion, so that when the directional consistency is significantly higher than the threshold T, the enhancement effect is obvious, while the change is relatively gentle near the threshold, which helps to distinguish subtle cracks from noise. The coefficient 5 adjusts the steepness of the conversion, and π / 2 is used to normalize the output of the inverse tangent function. The final grayscale enhancement coefficient E i,j It can more effectively highlight crack structures while suppressing areas of texture with inconsistent orientation;

[0069] Parameter G i,j The steps for obtaining G are: directly extract the gradient amplitude corresponding to the pixel with coordinates (i, j) from the gradient direction field data generated in the previous step. This value is calculated by the Sobel operator and reflects the intensity of the grayscale change of the pixel. For example, for the pixel (100, 150), the gradient amplitude is 85.3 from the gradient direction field data, then G 100,150 =85.3;

[0070] Parameter C i,jThe steps to obtain C are: directly extract the directional consistency ratio value corresponding to the pixel with coordinates (i, j) from the directional consistency matrix generated in the previous section. This value represents the ratio of pixels in the neighborhood of the pixel whose gradient direction is consistent with its center direction, ranging from 0 to 1. For example, for the pixel (100, 150), its directional consistency ratio value is 0.85, then C 100,150 =0.85;

[0071] The steps for obtaining the parameter T are as follows: the preset directional consistency threshold T is set to 0.7. This value is an empirical threshold determined by experiments on a large number of (for example, more than 200) traditional village building surface image samples containing known cracks and different background textures. In the experiment, different T values (such as 0.5, 0.6, 0.7, 0.8, and 0.9) were tried, the corresponding grayscale enhancement coefficients were calculated, and enhanced crack feature maps were generated. Three image processing experts evaluated the clarity, continuity, and background noise suppression effects of the cracks under different T values. The statistical evaluation results showed that when T = 0.7, the system achieved the best balance between identifying real cracks and suppressing interfering textures, so T = 0.7 was set;

[0072] The steps to obtain parameter 5 are as follows: This is the scaling factor inside the arctan function, which is set to 5. This value is also determined by experimental methods. The purpose is to adjust the sensitivity of the enhancement effect to the change of directional consistency. After determining T = 0.7, different scaling factor values (such as 1, 3, 5, 8, 10) are tested to observe when C i,j When the value fluctuates around T, the grayscale enhancement coefficient E i,j The factor 5 is chosen because it can i,j When the factor is just over 0.7, it provides a faster enhancement response while avoiding the problem of excessive sensitivity to noise that may be caused by an excessively large factor, providing better discrimination;

[0073] Calculation process: Take the pixel point (100,150) as an example, and substitute the obtained parameter values for calculation: G 100,150 =85.3C 100,150 = 0.85, T = 0.7, calculate the direction consistency difference and scaling: 5·(C 100,150 -T) = 5 (0.85-0.7) = 5 0.15 = 0.75, calculate the inverse tangent value (radians): arctan (0.75) ≈ 0.6435, normalize the inverse tangent value: Calculate the value in the brackets of the enhancement factor: 1 + 0.4097 = 1.4097, and calculate the final grayscale enhancement coefficient: E 100,150 =G 100,150·1.4097=85.3·1.4097≈120.25. The result shows that the grayscale enhancement coefficient of the pixel (100,150) is 120.25. This value combines the original gradient strength of the point (85.3) and the high consistency of the gradient direction of its neighborhood (0.85, exceeding the threshold of 0.7), resulting in a higher enhancement coefficient value. This value will be used to adjust the grayscale value of the original image in subsequent steps. The higher the value, the greater the possibility that the point is a potential crack feature point, and its brightness in the final feature map will be more significantly improved. Different E i,j The value indicates different degrees of enhancement or suppression, which directly affects the final enhanced crack feature map.

[0074] According to the gray enhancement coefficient E of each pixel calculated in the previous step i,j (For example, for the pixel (100,150), E is calculated 100,150 ≈120.25), this coefficient value comprehensively reflects the gradient strength of the corresponding pixel position and the consistency of the neighborhood gradient direction. Now we need to use this coefficient value to adjust the grayscale information of the original image to generate the final enhanced crack feature map. The specific operation is as follows: traverse each pixel point (i, j) in the image and obtain its corresponding grayscale enhancement coefficient E i,j , the coefficient value is directly used as the basis for the new gray value of the corresponding pixel (i, j) in the target enhanced crack feature map, namely PotentialNewGray i,j =E i,j , since the calculated E i,j The value may exceed the representation range of the standard grayscale image (for example, for an 8-bit grayscale image, the range is 0 to 255), and range constraint processing is required. Clipping is used to constrain the calculated value to the valid grayscale range. Specifically, if PotentialNewGray i,j Less than 0, set it to 0; if PotentialNewGray i,j If the value is greater than 255, it is set to 255; if the value is between 0 and 255, it remains unchanged, that is, the final new grayscale value NewGray i,j =max(0,min(PotentialNewGray i,j ,255)), taking the pixel point (100,150) in the example as an example, its E 100,150 ≈120.25. Since the value is between 0 and 255, after the constraint, the new gray value of the point in the enhanced crack feature map is 120.25 (rounded to 120 if an integer gray value is required). i,j New gray value NewGray after value calculation and constrainti,j The corresponding positions in the new image matrix are stored, and finally an enhanced crack feature map is formed. In this map, pixels with high gradient amplitude and high directional consistency (corresponding to higher E i,j values) will appear with higher grayscale values (brighter), making the potential crack structure more visually prominent.

[0075] The steps to obtain the grayscale extreme point set are:

[0076] Based on the enhanced crack feature map, morphological closing operation is used to eliminate isolated noise points. The 8-neighborhood connectivity criterion is used to traverse all pixels, merge adjacent pixels with grayscale value differences less than 20, mark the contours of all closed areas, and generate a set of connected component areas.

[0077] Based on the connected component area set, the extreme value density of each connected component is calculated using the following formula:

[0078]

[0079] Among them, D k is the extreme value density of the kth connected component, N k is the total number of local maximum and minimum points in the connected component, A k is the area of the connected component region;

[0080] Connected components are screened based on extreme value density, and the neighborhood scan is performed on the pixels in each connected component to detect the coordinates that meet the local minimum, that is, the grayscale value of the center point is less than that of all neighboring points, or the local maximum, that is, the grayscale value of the center point is greater than that of all neighboring points. All coordinate points that meet the conditions are extracted to form a set of grayscale extreme value points.

[0081] Specifically, based on the enhanced crack feature map generated in the previous stage, the morphological closing operation is first applied to process the image. A 3×3 square structural element is selected. This size is generally suitable for filling small fractures or holes inside small cracks, and can effectively connect adjacent crack fragments. At the same time, isolated noise highlights (dark areas smaller than the size of the structural element) are removed. The specific operation of the closing operation is to first perform an expansion operation on the image, and then perform an erosion operation on the expansion result. The same 3×3 structural element is used. After completing the closing operation, the connected component analysis is performed. The 8-neighborhood connectivity criterion is set to be used, that is, a pixel is considered to be connected to its horizontal, vertical and diagonal adjacent pixels. Each pixel in the image is traversed. When an unlabeled pixel is encountered, the connected area search is started, the pixel is added to the current area, and its 8 neighboring pixels are checked. If the neighboring pixels are If a pixel is also unmarked and the absolute value of the difference between its grayscale value and the grayscale value of the current pixel is less than the preset grayscale difference threshold of 20, then the neighboring pixel is also added to the current area, and its neighborhood is checked recursively or iteratively. The grayscale difference threshold of 20 is an empirical value set in the grayscale range of 0-255. By testing sample images containing cracks with different contrasts and observing the segmentation effects under different thresholds (for example, 10, 20, 30, and 40), the selection of 20 can effectively prevent pseudo-connections caused by uneven lighting or material differences while ensuring the connectivity of the crack body. All pixels that meet the connectivity and grayscale difference conditions are classified as a connected component and given a unique identifier. This process is repeated until all pixels in the image have been visited, and finally a set of all identified connected components is obtained. Each connected component contains a set of pixel coordinates, forming a connected component area set.

[0082] formula: The benefit of the formula is that it aims to quantify the internal texture complexity or detail richness of the k-th connected component by calculating the number N of local extreme points (including maximum and minimum values) in the region. k , and combined with the area A k Perform nonlinear normalization to obtain the extreme value density D k , this density value can reflect the activeness of grayscale changes in the region. Compared with considering only simple features such as area or grayscale mean, extreme value density can better distinguish regions with internal structural details (such as fine cracks, bumps caused by material peeling) from smooth regions. In the formula structure, the numerator combines the number of extreme points and their relative size to the region (measured in the cube root of the area). The relative density of the area is measured and scaled by a logarithmic function, and the denominator is normalized mainly based on the square root of the area. This design makes D k It is more sensitive to the presence of many extreme points in a small area, which helps to identify and screen potential risk areas with complex structures;

[0083] Parameter N k The acquisition steps are as follows: for the k-th connected component, traverse all the pixel points (i, j) it contains, read the gray value Gray (i, j) of the point in the enhanced crack feature map, and check the gray values of its 8 neighboring pixels (make sure the neighboring pixels are also within the image range). If Gray (i, j) is strictly greater than the gray values of all its 8 neighboring pixels, it is recorded as a local maximum point. If Gray (i, j) is strictly less than the gray values of all its 8 neighboring pixels, it is recorded as a local minimum point. The total number of local maximum points and local minimum points found in the k-th connected component is counted, which is N k For example, if we check the connected component numbered 5 and find that 12 pixels inside it meet the local maximum condition and 10 pixels meet the local minimum condition, then N5 of this connected component is 12+10=22.

[0084] Parameter A k The steps for obtaining are: in the process of connected component analysis in the previous section, each connected component is given a unique identifier and the coordinates of all pixels it contains are recorded. The area A of the kth connected component k That is, the total number of pixels it contains, which can be directly obtained by counting. For example, the connected component numbered 5 is determined to contain a total of 150 pixels during the labeling process, so A5 of this connected component is 150 (unit: pixel);

[0085] Calculation process: Take the fifth connected component as an example, and enter the obtained parameter values for calculation: N5 = 22A5 = 150, and calculate the cube root of the area: Compute the ratio of the number of extreme points to the cube root of the area: Compute the internal value of the logarithmic term: Calculate the natural logarithm value: ln(5.141)≈1.637, the numerator of the calculation formula is: Compute the square root of an area: Calculate the value inside the square root of the denominator: Calculation formula denominator: Compute the final extreme value density: The results show that the calculated value of the extreme value density D5 of the fifth connected component is 2.827. This value quantifies the density of local grayscale changes within the region. Combining the number of extreme points and the size of the region, the higher the density value, the more local brightness peaks and valleys contained in the unit area, suggesting that the region may have a more complex internal structure or texture.

[0086] Based on the extreme value density D of each connected component calculated in the previous step kFirst, these connected components are screened and an extreme density threshold is set, such as D threshold =1.5. The threshold is determined based on the empirical value obtained by analyzing a large number of sample images containing known cracks and background areas. The D k Value distribution, found D k Regions with values greater than 1.5 usually correspond to cracks or spalling areas with significant internal details, while regions with values less than 1.5 are mostly flat backgrounds or uniform noise blocks. Therefore, 1.5 is selected as the distinction criterion, and all connected components are traversed to retain those with extreme density D. k Connected components greater than or equal to 1.5, discard D k For connected components with a value less than 1.5, for each connected component that is screened and retained, the local extreme points are further accurately located within it. The specific method is: traverse all pixel points (i, j) in the connected component, read its grayscale value Gray(i, j) in the enhanced crack feature map, and then check the grayscale values of the 8 surrounding neighboring pixels (these neighboring pixels are also required to be within the image range). If the grayscale value of pixel (i, j) is strictly less than the grayscale values of all its 8 neighboring pixels, the coordinates of the pixel (i, j) are marked as a local minimum point. If the grayscale value of pixel (i, j) is strictly greater than the grayscale values of all its 8 neighboring pixels, the coordinates of the pixel (i, j) are marked as a local maximum point. The coordinates of all local minimum points and local maximum points detected within the screened connected components are collected and integrated to form the final set of grayscale extreme points.

[0087] The steps to obtain the significant topological structure identification are:

[0088] Based on the grayscale extreme point set, a connection path along the path with the highest gradient amplitude in the gradient direction field data is generated for each pair of extreme points. The gradient amplitude set of all pixels on the path is extracted to generate a dataset of extreme point pair connection paths.

[0089] Based on the extreme point pair connection path dataset, the connection strength score of each pair of extreme points is calculated using the following formula:

[0090]

[0091] Among them, S pq Score the connection strength, ΔG pq is the absolute value of the grayscale difference between extreme points (p,q), G avg,Γ is the average value of the gradient amplitude of all pixels on the connection path, L pq is the actual pixel length of the path;

[0092] Based on the connection strength score, extreme point pairs with connection strength scores greater than the target threshold are screened, spatial paths are merged to form a topological structure, and a significant topological structure identifier is generated.

[0093] Specifically, based on the grayscale extreme point set obtained in the previous stage, which contains the coordinates of the local maximum and minimum points inside the screened connected components, and the previously calculated gradient direction field data containing the gradient amplitude and direction of each pixel, the path between the extreme point pairs is constructed. Considering each pair of extreme points (p, q) in the grayscale extreme point set, the connection path between them is calculated. The generation of the path follows the "highest gradient amplitude" principle, that is, to find a pixel sequence from point p to point q so that the sum of the gradient amplitudes of each pixel on the path is as large as possible (or some kind of amplitude-based cost function is optimal). This can be achieved through a graph search algorithm. For example, the image pixels are regarded as graph nodes, and there are edges between adjacent pixels (using 8-neighborhood connections). The weight of the edge is set to a value related to the gradient amplitude of the pixels at both ends. For example, the weight of the edge can be 1 / (G(p1)+

[0094] G(p2)+∈), where G is the gradient magnitude and ∈ is a small positive number to prevent division by zero. Then use Dijkstra's algorithm to find the path from p to q with the lowest total weight (corresponding to a higher cumulative gradient magnitude), and for each pair successfully find the connecting path Γ pq The extreme point (p, q) of the path is extracted and recorded. The coordinate sequence of all pixel points constituting the path is extracted and recorded. At the same time, the gradient magnitude of each pixel point on the path is queried from the gradient direction field data. These gradient magnitude sets are stored together with the corresponding path information. After processing all extreme point pairs, an extreme point pair connection path dataset is generated, which contains each pair of connection points, the pixel coordinate sequence of the connection path, and the gradient magnitude sequence on the path.

[0095] formula: The usefulness of the formula is that it is used to evaluate the path Γ connecting the extreme points p and q pq The significance of the two extreme points is considered comprehensively, with three key factors: the grayscale difference ΔG at both ends pq , the strength of the path itself (measured by the average gradient amplitude G avg,Γ Reflection) and the length of the path L pq Large grayscale differences indicate that the connection may be a significant light-dark variation structure, a high average gradient amplitude indicates that the path follows a clear edge or ridge, and the inverse square term of the path length strongly tends to select more spatially compact connections. This combination can effectively distinguish short and strong connections with significant grayscale jumps (more likely to correspond to real cracks) and suppress long and weak paths or paths connecting extreme points with little grayscale difference, thereby improving the reliability of structure recognition;

[0096] Parameter ΔGpq The steps to obtain ΔG are as follows: This parameter represents the absolute value of the grayscale difference between the extreme point pair (p, q). First, according to the coordinates of the extreme points p and q, their corresponding grayscale values are found in the previously generated enhanced crack feature map, which are recorded as Gray(p) and Gray(q) respectively. Then, the absolute value of the difference between the two grayscale values is calculated, that is, ΔG pq = |Gray(p)-Gray(q)|, for example, if the gray value at the extreme point p is 180, and the gray value at the extreme point q is 50 (gray value range 0-255), then ΔG pq =|180-50|=130;

[0097] Parameter G avg,Γ The steps to obtain are: This parameter represents the connection path Γ pq The arithmetic mean of the gradient amplitudes of all pixels on the graph is obtained. First, the path Γ connecting the extreme points p and q is extracted from the extreme point pair connection path dataset generated in the previous section. pq All the pixels contained in it, and obtain the gradient amplitude sequence corresponding to these pixels, let the path Γ pq Contains N pixels, whose gradient amplitudes are G1, G2, ..., G N , then calculate the average of these amplitudes, for example, if the path Γ pq Contains 25 pixels, the sum of its gradient magnitude is 2150, then G avg,Γ =2150 / 25=86.0;

[0098] Parameter L pq The steps to obtain are: This parameter represents the connection path Γ pq The actual pixel length is the number of pixels that make up the path. When the path is generated and the gradient amplitude sequence is extracted in the previous section, the number of pixels N on the path is the path length L. pq , can be obtained directly, for example, if the path Γ pq It is composed of 25 pixels, so L pq =25;

[0099] Calculation process: Take the path connecting the extreme points p and q as an example, and enter the obtained parameter values for calculation: ΔG pq =130, G avg,Γ =86.0, L pq =25, calculation formula numerator: ΔG pq ·G avg,Γ =130×86.0=11180, calculation formula denominator: Calculate the final connection strength score: The results show that the strength score of the path connecting the extreme points p and q is 17.888. This score comprehensively reflects the significance of the grayscale difference between the extreme points (130), the average edge strength of the connection path (86.0), and the spatial distance between them (length 25, squared to 625). The higher the score, the more likely the connection between the extreme points is structurally important and reliable. In subsequent steps, this score will be compared with a preset threshold. Connections with scores exceeding the threshold will be considered significant and used to construct the final topological structure identification. For example, if the threshold is set to 15, the connection will be retained because 17.888>15.

[0100] The connection strength score S for each pair of extreme points (p, q) calculated in the previous step pq , screen to identify significant connections, set a target threshold for the connection strength score, such as S threshold =15, the threshold value is set based on the S calculated from the known crack paths and non-crack paths in a large number of sample images. pq The empirical value obtained by statistical analysis of the score distribution is to select a value that can effectively distinguish strong connections (usually corresponding to cracks) from weak connections (possibly caused by noise or texture). Choosing 15 means that the connection path is required to show strong characteristics in terms of grayscale difference, average gradient and path length constraints. All extreme point pairs (p, q) with calculated scores are traversed. If their connection strength score S pq If the extreme point pair and its corresponding spatial connection path Γ are greater than the target threshold 15, pq Mark as significant connection. For extreme point pairs whose scores do not meet this condition, they are regarded as non-significant connections and discarded. Collect all paths marked as significant connections. These paths represent local structural fragments with high confidence in the image. Subsequently, merge these significant connection paths to construct a more macroscopic topological structure. The graph theory method can be used to regard each extreme point as a node of the graph and each significant connection path as an edge connecting the corresponding node. Then find all connected subgraphs in the graph. Each connected subgraph represents a topological structure connected by multiple significant paths. Merge the pixel sets on all paths that constitute these connected subgraphs to generate the final significant topological structure identifier, which represents the main crack network or other important linear structures identified in the image in the form of a pixel set.

[0101] The steps to obtain the structural quantitative measurement value are:

[0102] Based on the significant topological structure identification, all the identified connected areas are traversed. The minimum circumscribed rectangle aspect ratio and area of each connected area are calculated. Areas with an aspect ratio greater than 5 and an area greater than 10 pixels are screened and identified as structural cracks. The total number of connected areas that meet the conditions is counted to generate the statistical results of the number of structural cracks.

[0103] Based on the connected area set corresponding to the statistical results of the number of structural cracks, each structural crack area is skeletonized, the pixel coordinates of the skeleton centerline are extracted, the cumulative Euclidean distance between the centerline pixels is calculated, and the accumulated value is multiplied by the preset actual length conversion coefficient corresponding to the unit pixel to generate the total length value of the structural crack;

[0104] Based on the remaining connected areas that have not been judged as structural cracks in the significant topological structure identification, the number of pixel coverage of each pore area is calculated, multiplied by the actual area conversion coefficient per unit pixel, and the area calculation results of all pore areas are accumulated to generate the total pore area value of the material. The statistical results of the number of structural cracks, the total length of structural cracks and the total pore area of the material are integrated to form a structural quantitative measurement value.

[0105] Specifically, based on the significant topological structure markers obtained in the previous stage, which represent a set of connected regions consisting of strongly connected paths screened out in the image, it is necessary to perform geometric feature analysis on these regions to distinguish structural cracks from other possible forms (such as pores, spalling, etc.). Each independent connected region in the set is traversed, and the following calculations are performed on each region: First, the minimum area bounding box (MABB) of the connected region is calculated, that is, the rectangle with the smallest area that can enclose all pixels in the region. The rectangle may be rotated relative to the image coordinate axis. This rectangle can be effectively found by using, for example, the rotating caliper algorithm, and its long side length L and short side length W are obtained. Second, the actual area of the connected region, Area, is calculated, that is, the total number of pixels contained in the region. Then, based on the obtained L and W, the aspect ratio of the minimum bounding box is calculated. Next, the calculated aspect ratio (AspectRatio) and area (Area) are compared with preset screening criteria, which are set as: aspect ratio greater than 5 and area greater than 10 pixels. The aspect ratio threshold of 5 is an empirical value derived from observations of a large number of actual crack morphologies. Cracks are typically elongated, and setting a value greater than 5 effectively filters out such shapes while excluding nearly circular or square areas (such as pores). The area threshold of 10 pixels is intended to filter out small areas caused by noise or image processing residues. This value is set empirically based on image resolution and the minimum defect size of interest. For example, when analyzing an image with a pixel size of approximately 0.5 mm, areas smaller than 10 pixels correspond to actual sizes that are too small and are generally not considered structural cracks. If a connected region meets both the AspectRatio > 5 and Area > 10 conditions, it is determined to be a structural crack. The number of connected regions determined to be structural cracks is counted to generate a statistical result of the number of structural cracks.

[0106] Based on the statistical results of the number of structural cracks determined in the previous paragraph and the corresponding connected area set determined to be structural cracks, the total length of these cracks needs to be calculated. For each structural crack area in the set (the area is defined by a set of pixel coordinates), skeleton processing is first performed. Using the Zhang fast parallel thinning algorithm, the two-dimensional crack area is reduced to a one-pixel wide center line (skeleton). This skeleton retains the topological structure and basic direction of the original area. After thinning, a series of pixel coordinates (x i ,y i ), then calculate the length of the skeleton by accumulating the Euclidean distance between adjacent pixels on the skeleton, that is, traverse the skeleton pixel sequence, for each pair of consecutive pixels (x i ,y i ) and (x i+1 ,yi+1 ), calculate the straight-line distance between them The distance d between all these tiny line segments i Add up the total length of the crack skeleton (in pixels), which is recorded as Length pixels Finally, to convert the pixel length into the actual physical length, you need to use the preset unit pixel corresponding to the actual length conversion factor ConversionFactor length , which is determined by camera calibration or on-site measurement. For example, if the calibration shows that 1 pixel represents 0.5 mm, then ConversionFactor length = 0.5 mm / pixel, the calculated pixel length Length pixels Multiply by this coefficient to get the actual length of the structural crack ActualLength = Length pixels ×ConversionFactor length , repeat this process for all areas determined to be structural cracks, and accumulate the actual length of each crack calculated to obtain the total length of the structural cracks.

[0107] Based on the initial significant topological structure identification (including all the screened connected areas) and the set of areas judged to be structural cracks, the remaining connected areas that are not judged to be structural cracks are first identified. These areas are within the significant topological structure identification, but do not meet the conditions of aspect ratio greater than 5 or area greater than 10 pixels. Therefore, they are regarded as material pores or other non-crack type defect areas. For each such remaining connected area (pore area), its area is calculated, that is, the number of pixels covered by the area, which is recorded as Area pore,pixels , this number of pixels has been obtained when calculating the geometric features. Then, to convert the pixel area into the actual physical area, it is necessary to use the unit pixel actual area conversion factor ConversionFactor area , this coefficient is the unit pixel length conversion factor ConversionFactor length The square of ConversionFactor area =(ConversionFactor length ) 2 , if ConversionFactor length = 0.5 mm / pixel, then ConversionFactor area =(0.5) 2 = 0.25 square millimeters / pixel, and the pixel area of each pore area Δrea pore,pixels Multiply by the area conversion coefficient to get the actual area of the pore ActualAreapore =Area pore,pixels ×ConversionFactor area , the actual areas calculated from all identified pore regions are accumulated to obtain the total pore area value of the material. Finally, the three indicators of the statistical results of the number of structural cracks, the total length of structural cracks and the total pore area of the material calculated in this section are integrated to form a structural quantitative measurement value for subsequent risk assessment.

[0108] The steps to obtain the risk classification of heritage structures are:

[0109] Based on the total pore area value of the material in the structural quantitative measurement value, the material type database of the corresponding components of traditional village buildings is matched, and the preset risk discrimination threshold parameter group of each material type is extracted, including the crack number threshold, the total crack length threshold, and the pore area threshold, to generate a set of material risk discrimination thresholds;

[0110] Based on the material risk discrimination threshold set, the crack number statistics, total crack length values, and total pore area values in the structural quantitative measurement values are compared one by one with the crack number threshold, total crack length threshold, and pore area threshold of the corresponding material, and the number of times each parameter exceeds the threshold is recorded to generate the parameter violation statistics.

[0111] Based on the statistical results of parameter violations, risk level classification rules are set, the number of violations is mapped to preset risk level labels, and the risk classification of heritage structures is generated.

[0112] Specifically, based on the structural quantitative measurement value obtained by the integration in the previous stage, the measurement value includes the statistical results of the number of structural cracks calculated for the current analysis area, the total length value of the structural cracks, and the total area value of the material pores. First, it is necessary to determine the specific material type of the building components to which the analysis area belongs. This information needs to be provided as input. For example, when the system is initialized or the analysis area is selected, the operator specifies it according to the actual situation or building archive data, or the system can automatically identify it in combination with pre-labeled image information or building information model (BIM) data. For example, the current analysis area is determined to be "rammed earth wall". Next, based on the determined material type "rammed earth wall", the pre-built "traditional village building component material type database" is accessed. This database brings together the research results of engineering properties and degradation patterns of different traditional building materials (such as rammed earth, blue bricks, wood, stone, mortar, etc.). Based on the results, cultural relics protection engineers and structural experts set a set of risk judgment thresholds for each material according to relevant specifications, long-term monitoring data, and experience. For "rammed earth walls", the corresponding risk judgment threshold parameter group was extracted from the database. This parameter group contains three values: crack number threshold (for example, for rammed earth walls, the allowable number of independent cracks may be set to 5), total crack length threshold (for example, the upper limit of total crack length is set to 300 mm), and pore area threshold (for example, the upper limit of total pore area is set to 1500 square millimeters). These thresholds reflect the material's tolerance to specific types of defects. Exceeding these thresholds usually means an increase in structural risk. The extracted set of specific thresholds {crack number threshold = 5, total crack length threshold = 300, pore area threshold = 1500} constitutes the material risk judgment threshold set based on subsequent comparative analysis.

[0113] According to the material risk discrimination threshold set {crack number threshold = 5, total crack length threshold = 300 mm, pore area threshold = 1500 square millimeters} extracted and generated for a specific material (such as "rammed earth wall") in the previous paragraph, and the structural quantitative measurement value {structural crack number = 8, total length of structural cracks = 420 mm, total material pore area = 1200 square millimeters} containing the detection results of the current analysis area, a comparison is performed item by item. First, the "structural crack number statistics" (8) in the structural quantitative measurement value is compared with the "crack number threshold" (5) in the material risk discrimination threshold set. Because 8 is greater than 5, it means that the number of cracks exceeds the threshold, a violation is recorded, and the number of violations is initialized to 1. Secondly, the "structural crack total length value" ( The value of "420 mm" in the structural quantitative measurement value is compared with the "total crack length threshold" (300 mm) in the material risk discrimination threshold set. Since 420 is greater than 300, it means that the total crack length also exceeds the threshold. The number of violations is accumulated by 1, and the current total number of violations is 2. Finally, the "total material pore area value" (1200 square millimeters) in the structural quantitative measurement value is compared with the "pore area threshold" (1500 square millimeters) in the material risk discrimination threshold set. Since 1200 is not greater than 1500, it means that the total material pore area does not exceed the threshold. The number of violations does not increase and remains at 2. After completing all comparisons of the three parameters of the number of structural cracks, the total length of structural cracks, and the total material pore area with their corresponding material thresholds, the final parameter violation statistics are obtained. In this example, the result is 2 times.

[0114] Based on the statistical results of the number of parameter violations obtained in the previous paragraph (for example, the number of violations is 2 times), it is necessary to map this statistical number to a specific risk level according to the preset risk level classification rules. These classification rules are based on risk assessment theory and practical experience in cultural relics protection. Risks are usually divided into several levels, such as "low risk", "medium risk", "high risk", and "extremely high risk", and the range of parameter violations corresponding to each level is clearly defined. The formulation of the rules takes into account the positive correlation between the number of parameters exceeding the threshold and the degree of risk, that is, the more violations, the higher the potential risk of the structure. For example, The following rules are set: 0 violations correspond to "low risk"; 1 violation corresponds to "medium risk"; 2 violations correspond to "high risk"; and 3 violations (i.e., all three parameters exceed the limit) correspond to "extremely high risk." The calculated number of parameter violations (2 in this example) is substituted into these preset rules for matching. Based on the rule "2 violations correspond to 'high risk'," the risk level of the currently assessed building component (e.g., rammed earth wall) is determined to be "high risk." This risk level label is ultimately output, resulting in a "high risk" heritage structure risk classification for the component.

Claims

1. An image monitoring system for traditional village heritage risk assessment, characterized by: The system comprises: The heritage image acquisition module acquires the image data stream of the target traditional village building surface, performs geometric correction on the original heritage image data, and performs image brightness equalization processing to establish a calibrated image set; A structural texture enhancement module calculates the image grayscale gradient amplitude and image grayscale gradient direction of each pixel based on the calibrated image set, obtains gradient direction field data, analyzes the degree of gradient direction consistency within a preset neighborhood range in the gradient direction field data, and enhances the grayscale value according to the gradient direction consistency to obtain an enhanced crack feature map; A microevolution analysis module, based on the enhanced crack feature map, identifies connected components in the image that represent potential structural cracks, calculates local minimum and local maximum points of the image grayscale value within the connected components, obtains a set of grayscale extreme points, evaluates the grayscale differences and spatial connection paths between extreme point pairs in the grayscale extreme point set, screens extreme point pairs whose grayscale differences exceed a target threshold, and establishes a significant topological structure identifier; The risk status identification module counts the number of identified structural cracks based on the significant topological structure identification, generates a structural quantitative measurement value, compares the structural quantitative measurement value with the risk identification threshold value set for different materials of traditional village buildings, and obtains the heritage structure risk classification.

2. The image monitoring system for traditional village heritage risk assessment according to claim 1 is characterized in that: The steps for obtaining the calibrated image set are: A continuous image data stream of the target traditional village building surface is captured by a camera at a rate of 30 frames per second. Geometric deviations caused by shooting angle tilt or lens distortion in the continuous image data stream are mapped to a preset standard orthogonal coordinate system with the center point of the building facade as the origin. This eliminates trapezoidal distortion and barrel distortion, generating geometrically corrected image data. Based on the geometrically corrected image data, the image is segmented into non-overlapping sub-regions using a 50×50 pixel sliding window, the grayscale histogram distribution of each sub-region is calculated, the grayscale value dynamic range of each sub-region histogram is stretched, the contrast enhancement amplitude is constrained to not exceed a preset upper limit of 2.0, and the equalization results of all sub-regions are fused to generate brightness-balanced image data; The geometrically corrected image data and the brightness-balanced image data are aligned according to pixel positions. The local texture complexity of each pixel point is used as a weighting factor. The pixel grayscale value of the geometrically corrected image data is assigned a weight of 0.6, and the pixel grayscale value of the brightness-balanced image data is assigned a weight of 0.

4. Weighted superposition fusion is performed, and Gaussian filtering is performed on the edge areas of the fused images to output the calibrated image set.

3. The image monitoring system for traditional village heritage risk assessment according to claim 1, characterized in that: The steps for obtaining the gradient direction field data are: Based on the calibrated image set, a 3×3 Sobel horizontal convolution kernel is used to perform a horizontal convolution operation on each pixel to calculate the horizontal gradient component. At the same time, a 3×3 Sobel vertical convolution kernel is used to perform a vertical convolution operation to calculate the vertical gradient component. The image boundary area is expanded by a mirror filling method and then convolved to generate a horizontal gradient component matrix and a vertical gradient component matrix; Based on the horizontal gradient component matrix and the vertical gradient component matrix, the horizontal gradient component and the vertical gradient component of each pixel are squared and summed, and the square root of the square sum result is taken to obtain the gradient amplitude of the corresponding pixel. At the same time, the horizontal gradient component and the vertical gradient component of each pixel are operated by the inverse tangent function, and the calculation results are converted into angle values to generate the gradient direction angle matrix; Integrate the gradient magnitude and gradient direction angle matrix, store the gradient magnitude and gradient direction angle of each pixel in a one-to-one correspondence according to the pixel coordinate position, and construct the gradient direction field data.

4. The image monitoring system for traditional village heritage risk assessment according to claim 1, characterized in that: The steps for obtaining the enhanced crack characteristic map are: Based on the gradient direction field data, a neighborhood window is defined with the current pixel as the center, the gradient direction angles of all pixels in the neighborhood are traversed, the absolute value of the angle difference between the gradient direction of each pixel and the direction of the center pixel is calculated, and the proportion of pixels with an absolute difference value less than 15° to the total number of neighborhood pixels is counted to generate a direction consistency matrix; Calculating the grayscale enhancement coefficient of each pixel based on the direction consistency matrix; According to the grayscale enhancement coefficient, the grayscale value is modified to generate an enhanced crack feature map.

5. The image monitoring system for traditional village heritage risk assessment according to claim 1 is characterized in that: The steps for obtaining the grayscale extreme value point set are: Based on the enhanced crack feature map, a morphological closing operation is used to eliminate isolated noise points, and an 8-neighborhood connectivity criterion is used to traverse all pixels, merge adjacent pixels with a grayscale value difference of less than 20, mark all closed area contours, and generate a connected component area set; Based on the connected component area set, calculate the extreme value density of each connected component; Connected components are screened based on the extreme value density, and a neighborhood scan is performed on the pixels within each connected component to detect coordinates that meet the local minimum, that is, the grayscale value of the center point is less than that of all neighboring points, or the local maximum, that is, the grayscale value of the center point is greater than that of all neighboring points. All coordinate points that meet the conditions are extracted to form a set of grayscale extreme value points.

6. The image monitoring system for risk assessment of traditional village heritage according to claim 1, characterized in that: The steps for obtaining the significant topological structure identifier are: Based on the grayscale extreme value point set, generating a connection path along the path with the highest gradient amplitude in the gradient direction field data for each pair of extreme value points, extracting the gradient amplitude set of all pixel points on the path, and generating a data set of connection paths of extreme value point pairs; Calculating a connection strength score for each pair of extreme point pairs based on the extreme point pair connection path dataset; Based on the connection strength score, extreme point pairs with connection strength scores greater than a target threshold are screened, spatial paths are merged to form a topological structure, and a significant topological structure identifier is generated.

7. The image monitoring system for risk assessment of traditional village heritage according to claim 1, characterized in that: The steps for obtaining the structural quantitative measurement value are: Based on the significant topological structure identification, all identified connected areas are traversed, and the minimum circumscribed rectangle aspect ratio and area of each connected area are calculated. Areas with an aspect ratio greater than 5 and an area greater than 10 pixels are screened and determined to be structural cracks. The total number of connected areas that meet the conditions is counted to generate a statistical result of the number of structural cracks; Based on the connected area set corresponding to the statistical result of the number of structural cracks, skeletonize each structural crack area, extract the pixel coordinates of the skeleton centerline, calculate the cumulative Euclidean distance between the centerline pixels, and multiply it by the preset actual length conversion coefficient corresponding to the unit pixel to generate the total length value of the structural crack; Based on the remaining connected areas in the significant topological structure identification that have not been determined to be structural cracks, the number of pixel coverage of each pore area is calculated, multiplied by the actual area conversion coefficient per unit pixel, and the area calculation results of all pore areas are accumulated to generate a total material pore area value. The statistical results of the number of structural cracks, the total length of structural cracks and the total material pore area are integrated to form a structural quantitative measurement value.

8. The image monitoring system for risk assessment of traditional village heritage according to claim 1, characterized in that: The steps for obtaining the risk classification of the heritage structure are as follows: Based on the total pore area value of the material in the structural quantitative measurement value, the material type database of the corresponding components of traditional village buildings is matched, and the preset risk discrimination threshold parameter group of each material type is extracted, including the crack number threshold, the total crack length threshold and the pore area threshold, to generate a material risk discrimination threshold set; Based on the material risk discrimination threshold set, the crack number statistics, total crack length values, and total pore area values in the structural quantitative measurement values are compared one by one with the crack number threshold, total crack length threshold, and pore area threshold of the corresponding material, and the number of times each parameter exceeds the threshold is recorded to generate parameter violation statistics; Based on the statistical results of the number of parameter violations, risk level classification rules are set, the number of violations is mapped to a preset risk level label, and the heritage structure risk classification is generated.

Citation Information

Cited By

  • Oil and gas engineering supporting facility intelligent detection method based on machine vision

    CN120833329A

  • An intelligent detection method for oil and gas engineering supporting facilities based on machine vision

    CN120833329B

  • Real-time laser glass defect detection method

    CN121053087A

  • Building crack detection system based on image recognition

    CN121213509A

  • Highway surface crack rapid detection method and system based on high-resolution image recognition

    CN121305350A