A method for image monitoring of dam bodies in water conservancy projects
By using an improved clustering algorithm to identify crack areas in the dam body of a water conservancy project, the problems of time-consuming, labor-intensive, and low-accuracy identification methods in traditional monitoring methods have been solved. This has enabled high-precision monitoring of dam cracks and timely anomaly alerts, thereby improving the safety of the dam body.
Patent Information
- Application Number
- CN202511349720.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-22
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2045-09-22
AI Technical Summary
Traditional methods for monitoring dam bodies in water conservancy projects rely on manual inspections, which are time-consuming, labor-intensive, and prone to overlooking potential hazards. Furthermore, existing clustering algorithms struggle to accurately identify dam body cracks in complex environments.
An improved clustering algorithm is adopted to obtain the first connected component through threshold segmentation, calculate the crack feature evaluation value and the optimality of the clustering starting point, and use the clustering distance metric function to perform clustering to identify crack areas in the dam body and provide anomaly alerts based on the degree of cracks.
It improves the accuracy and robustness of dam crack monitoring, enabling better identification of potential crack areas and timely alerts to anomalies, thereby enhancing the safety of the dam.
Smart Images

Figure CN120853112B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of image data processing technology, specifically relating to a method for image monitoring of water conservancy dams. Background Technology
[0002] With the continuous development of water conservancy projects in my country, the prevention and control of concrete cracks has become a key control point for the overall quality of water conservancy projects, and has gradually become a top priority for project managers. Therefore, strengthening the prevention and control of concrete cracks in water conservancy projects can effectively prevent damage to the internal structure of the main body of the project. Due to the long-term influence of factors such as water pressure, temperature, and geological changes, concrete cracking in dams has become a common problem. Traditional monitoring methods often rely on manual inspections, which are not only time-consuming and labor-intensive, but also prone to overlooking potential hazards. Summary of the Invention
[0003] To address the aforementioned problems, this application provides a method for image monitoring of water conservancy project dams, the method comprising:
[0004] Acquire monitoring images of the dam body of the water conservancy project;
[0005] Based on the monitoring images, an improved clustering algorithm is used to obtain the crack areas of the water conservancy project dam body;
[0006] The degree of anomaly in the crack region is obtained;
[0007] Based on the degree of abnormality in the cracked area, an anomaly warning is issued for the dam body of the water conservancy project.
[0008] The acquisition of the crack area of the water conservancy project dam body includes:
[0009] Based on the monitored images, multiple first connected components exhibiting anomalies are obtained using a threshold segmentation method;
[0010] Obtain the crack feature evaluation value of the first pixel within the first connected region;
[0011] Based on the crack feature evaluation value, the preference degree of the first pixel point as the clustering starting point of the sub-connected domain of the first connected domain is obtained;
[0012] Based on the optimization degree of the clustering starting point, obtain the clustering starting point of the sub-connected domains of the first connected domain;
[0013] Obtain the clustering distance metric function for the sub-connected regions of the first connected component;
[0014] Based on the clustering starting point and the clustering distance metric function, the sub-connected domains of the first connected domain are clustered to obtain multiple second connected domains;
[0015] Obtain the degree of cracking in the second connected component;
[0016] The crack area of the water conservancy project dam body is obtained based on the degree of cracking in the second connected domain.
[0017] Optionally, obtaining the crack feature evaluation value of the first pixel within the first connected region includes:
[0018] Obtain the grayscale value of the first pixel within the first connected component;
[0019] Obtain the gradient magnitude of the grayscale value of the first pixel;
[0020] Obtain the variance of the grayscale values of the pixels in the surrounding neighborhood of the first pixel;
[0021] Based on the gray value, the gradient magnitude, and the variance, the crack feature evaluation value of the first pixel in the first connected region is obtained.
[0022] Optionally, obtaining the preference of the first pixel as the clustering starting point of a sub-connected region of the first connected region includes:
[0023] Obtain the mean value of the crack feature evaluation values of all pixels in the sub-connected regions of the first connected region;
[0024] Obtain the sum of the distances between the first pixel and all other pixels in the sub-connected regions of the first connected region;
[0025] Based on the mean value of the crack feature evaluation values of all pixels in the sub-connected regions of the first connected region, and the sum value, the preference of the first pixel as the clustering starting point of the sub-connected regions of the first connected region is obtained.
[0026] Optionally, obtaining the clustering starting point of the sub-connected components of the first connected component includes:
[0027] The pixel with the lowest optimization degree among the clustering starting points in the sub-connected regions of the first connected region is taken as the clustering starting point of the sub-connected region of the first connected region.
[0028] Optionally, obtaining the clustering distance metric function of the sub-connected components of the first connected component includes:
[0029] Obtain the crack feature evaluation value of the clustering starting point of the sub-connected domain;
[0030] Obtain the crack feature evaluation value of the clustered pixels in the sub-connected region;
[0031] Obtain the distance between the clustering starting point and the clustered pixel;
[0032] Obtain the fitting residual between the clustering starting point and the clustered pixel;
[0033] Based on the crack feature evaluation value of the clustering starting point, the crack feature evaluation value of the clustered pixel, the distance, and the fitting residual, the clustering distance metric function of the sub-connected domains of the first connected domain is obtained.
[0034] Optionally, obtaining the degree of cracks in the second connected component includes:
[0035] Obtain the mean value of the crack feature evaluation values of all pixels in the second connected region;
[0036] Obtain the edge chain code of the edge pixels of the second connected component;
[0037] Obtain the sum of the absolute values of the differences between the edge chain codes of any two adjacent edge pixels in the second connected region;
[0038] Obtain the number of edge pixels of the second connected component;
[0039] Obtain the area of the second connected component and the area of the minimum bounding rectangle of the second connected component;
[0040] The degree of crack in the second connected region is obtained based on the mean of the crack feature evaluation values of all pixels in the second connected region, the sum of the absolute values of the differences between the edge chain codes of any two adjacent edge pixels in the second connected region, the quantity, the area of the second connected region, and the area of the circumscribed rectangle.
[0041] Optionally, obtaining the crack region of the hydraulic engineering dam body based on the crack degree of the second connected domain includes:
[0042] If the degree of cracking exceeds a set threshold, the second connected region is determined to be the cracked area of the dam body of the water conservancy project.
[0043] Optionally, obtaining the degree of anomaly in the crack region includes:
[0044] Obtain the degree of cracking in the cracked area;
[0045] Obtain the area of the crack region;
[0046] The degree of abnormality of the crack region is determined based on the degree of cracking in the crack region and the area of the crack region.
[0047] Optionally, the step of providing anomaly alerts to the dam body of the water conservancy project based on the degree of abnormality in the cracked area includes:
[0048] The dam body anomaly level is classified according to the degree of anomaly in the cracked area;
[0049] Based on the anomaly level of the dam body, set the corresponding alarm level;
[0050] Based on the alarm level, the corresponding alarm information will be sent automatically.
[0051] In summary, this application provides a method for image monitoring of a water conservancy project dam. The method includes: acquiring a monitoring image of the water conservancy project dam; based on the monitoring image, using an improved clustering algorithm to obtain crack areas of the water conservancy project dam; obtaining the anomaly degree of the crack areas; and providing anomaly alerts to the water conservancy project dam based on the anomaly degree of the crack areas. This application, through an improved clustering algorithm to identify crack areas of the dam, can better identify potential crack areas and provide anomaly alerts to the dam based on the anomaly degree of the crack areas, thereby improving the accuracy and robustness of dam crack monitoring and thus enhancing the safety of the dam. Attached Figure Description
[0052] To more clearly illustrate the implementation schemes of this application, the accompanying drawings used in the implementation schemes will be briefly introduced below. It should be understood that the accompanying drawings only show some implementation schemes of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained from the accompanying drawings without creative effort.
[0053] Figure 1 This is a flowchart illustrating an image monitoring method for a water conservancy project dam, according to an exemplary embodiment.
[0054] Figure 2 This is a flowchart illustrating a method for obtaining crack regions in a hydraulic engineering dam body according to an exemplary embodiment;
[0055] Figure 3 This is a flowchart illustrating a method for obtaining a crack feature evaluation value of a first pixel within a first connected region, according to an exemplary embodiment.
[0056] Figure 4 This is a flowchart illustrating a method for obtaining the preference of a first pixel point as a clustering starting point of a sub-connected region of a first connected region, according to an exemplary embodiment.
[0057] Figure 5This is a flowchart illustrating a method for obtaining the clustering starting point of sub-connected regions of a first connected region according to an exemplary embodiment;
[0058] Figure 6 This is a flowchart illustrating a method for obtaining a clustering distance metric function for sub-connected regions of a first connected region, according to an exemplary embodiment.
[0059] Figure 7 This is a flowchart illustrating a method for obtaining the degree of cracking in a second connected component according to an exemplary embodiment;
[0060] Figure 8 This is a flowchart illustrating yet another method for obtaining crack regions in a hydraulic engineering dam body, according to an exemplary embodiment;
[0061] Figure 9 This is a flowchart illustrating a method for obtaining the degree of anomaly in a crack region according to an exemplary embodiment;
[0062] Figure 10 This is a flowchart illustrating a method for providing anomaly alerts to a hydraulic engineering dam body based on the degree of anomaly in a cracked area, according to an exemplary embodiment. Detailed Implementation
[0063] To clearly illustrate the technical features of this solution, the following detailed description, in conjunction with specific implementation methods and accompanying drawings, will provide a comprehensive explanation of this application.
[0064] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While some embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this application. It should be understood that the drawings and embodiments of this application are for illustrative purposes only and are not intended to limit the scope of protection of this application.
[0065] It should be understood that the steps described in the method embodiments of this application may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this application is not limited in this respect.
[0066] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0067] It should be noted that the concepts of "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0068] It should be noted that the terms "one" and "multiple" used in this application are illustrative rather than restrictive. Those skilled in the art should understand that, unless explicitly stated in the context, they should be interpreted as "one or more". In the description of this application, unless otherwise stated, "multiple" refers to two or more than two, and other quantifiers are similar; "at least one item", "one item or multiple items", or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one item 'a' can represent any number of 'a's; as another example, one or more of a, b, and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple; "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural.
[0069] Although operations or steps are described in a specific order in the accompanying drawings in the embodiments of this application, this should not be construed as requiring these operations or steps to be performed in the specific order or serial order shown, or requiring all of the shown operations or steps to be performed to obtain the desired result. In the embodiments of this application, these operations or steps may be performed serially; they may be performed in parallel; or a portion of these operations or steps may be performed.
[0070] First, the application scenario of this application will be described. When using computer vision technology to detect anomalies in dam bodies, water flow marks pose a major challenge, significantly affecting the accuracy of crack detection. Water flow marks may obscure or disguise cracks, especially cracks appearing around the water flow mark, making crack identification even more difficult. This situation worsens over time, potentially leading to missed crack detections and posing potential safety hazards.
[0071] Traditional clustering algorithms have certain limitations in crack region identification, mainly because they rely on single-dimensional data to cluster image pixels, which cannot adapt to the complexities of real-world scenarios, thus affecting the accuracy and reliability of crack detection. Therefore, this invention improves the clustering method to enhance the accuracy and robustness of dam crack monitoring. Specific embodiments are described below.
[0072] Figure 1 This is a flowchart illustrating an image monitoring method for a hydraulic engineering dam, according to an exemplary embodiment. Figure 1 As shown in the figure, this application provides a method for image monitoring of a water conservancy project dam, which may include the following steps:
[0073] In step S10, a monitoring image of the dam body of the water conservancy project is acquired.
[0074] In this step, monitoring images of the dam body of the water conservancy project are acquired. For example, monitoring points can be placed at key locations on the dam body, such as the dam crest, dam slope, and dam foundation, and high-definition cameras can be installed to monitor the dam body image data in real time. However, due to environmental factors (such as weather changes, light intensity, fog, dust, etc.) and limitations in the performance of the cameras themselves, the acquired image data often contains noise. This noise can interfere with subsequent image processing and feature extraction. Therefore, Gaussian filtering is used to remove image noise and linearly enhance the image to highlight details, which is helpful for subsequent feature extraction and clustering processes.
[0075] In step S20, based on the monitoring image, an improved clustering algorithm is used to obtain the crack area of the water conservancy project dam body.
[0076] In this step, based on the monitoring images, an improved clustering algorithm is used to obtain the crack areas of the water conservancy project dam body. For example, firstly, based on the monitoring images, multiple first connected components with anomalies are obtained using a threshold segmentation method. Then, the crack feature evaluation value of the first pixel within each first connected component is obtained. Next, based on the crack feature evaluation value, the preference degree for the first pixel to become the clustering starting point of a sub-connected component of the first connected component is obtained. Then, based on the preference degree of the clustering starting point, the clustering starting points of the sub-connected components of the first connected component are obtained. Next, the clustering distance metric function of the sub-connected components of the first connected component is obtained. Then, based on the clustering starting points and the clustering distance metric function, the sub-connected components of the first connected component are clustered to obtain multiple second connected components. Then, the crack degree of the second connected components is obtained. Finally, based on the crack degree of the second connected components, the crack areas of the water conservancy project dam body are obtained.
[0077] In step S30, the degree of abnormality of the crack region is obtained.
[0078] In this step, the degree of anomaly in the crack area is obtained. For example, the crack degree of the crack area can be obtained first, then the area of the crack area can be obtained, and then the degree of anomaly in the crack area can be determined based on the crack degree and the area of the crack area.
[0079] In step S40, an anomaly warning is issued for the water conservancy dam body based on the degree of abnormality in the cracked area.
[0080] In this step, anomaly alerts are issued to the dam body based on the degree of abnormality in the cracked area. For example, the dam body anomaly level can be first classified according to the degree of abnormality in the cracked area, then corresponding alarm levels can be set based on the anomaly level, and finally, corresponding alarm information can be automatically sent according to the alarm level.
[0081] In summary, this application provides a method for image monitoring of a water conservancy project dam. The method includes: acquiring a monitoring image of the water conservancy project dam; based on the monitoring image, using an improved clustering algorithm to obtain crack areas of the water conservancy project dam; obtaining the anomaly degree of the crack areas; and providing anomaly alerts to the water conservancy project dam based on the anomaly degree of the crack areas. This application, through an improved clustering algorithm to identify crack areas of the dam, can better identify potential crack areas and provide anomaly alerts to the dam based on the anomaly degree of the crack areas, thereby improving the accuracy and robustness of dam crack monitoring and thus enhancing the safety of the dam.
[0082] Figure 2 This is a flowchart illustrating a method for obtaining crack regions in a hydraulic engineering dam body according to an exemplary embodiment. Figure 2 As shown, obtaining the crack area of the water conservancy project dam body may include the following steps:
[0083] In step S201, based on the monitoring image, multiple first connected components with anomalies are obtained by threshold segmentation.
[0084] In this step, based on the monitoring images, multiple first connected components exhibiting anomalies are obtained using threshold segmentation. For example, in a computer vision task for dam monitoring, the core objective is to identify and quantify various anomalies that may appear on the dam, such as cracks and flow marks. These anomalies often differ significantly in image features from the normal state of the main dam area. Threshold segmentation is a commonly used technique in image processing that simplifies image analysis by dividing pixels in an image into different categories (usually foreground and background). First, Otsu's method is applied to the dam monitoring images for threshold segmentation, effectively separating feature regions such as cracks and flow marks from the dam image and removing the main dam area from the background. This yields several first connected components, which may include anomalies such as cracks and flow marks that require further analysis.
[0085] In step S202, the crack feature evaluation value of the first pixel point within the first connected domain is obtained.
[0086] In this step, the crack feature evaluation value of the first pixel within the first connected region is obtained. For example, the gray value of the first pixel within the first connected region can be obtained first, then the gradient magnitude of the gray value of the first pixel can be obtained, then the variance of the gray values of the pixels in the surrounding neighborhood of the first pixel can be obtained, and then the crack feature evaluation value of the first pixel within the first connected region can be obtained based on the gray value, the gradient magnitude, and the variance.
[0087] In step S203, based on the crack feature evaluation value, the preference degree for the first pixel to become the clustering starting point of the sub-connected domain of the first connected domain is obtained.
[0088] In this step, the preference of the first pixel as the clustering starting point of the sub-connected region of the first connected region is obtained based on the crack feature evaluation value. For example, the mean of the crack feature evaluation values of all pixels in the sub-connected region of the first connected region can be obtained first, then the sum of the distances between the first pixel and all other pixels in the sub-connected region of the first connected region can be obtained. Finally, based on the mean of the crack feature evaluation values of all pixels in the sub-connected region of the first connected region and this sum, the preference of the first pixel as the clustering starting point of the sub-connected region of the first connected region is obtained.
[0089] In step S204, the clustering starting point of the sub-connected domains of the first connected domain is obtained according to the preference of the clustering starting point.
[0090] In this step, the clustering starting point of the sub-connected domains of the first connected domain is obtained based on the preference of the clustering starting point. For example, the pixel with the lowest preference of the clustering starting point in the sub-connected domains of the first connected domain can be used as the clustering starting point of the sub-connected domains of the first connected domain.
[0091] In step S205, the clustering distance metric function of the sub-connected domains of the first connected domain is obtained.
[0092] In this step, the clustering distance metric function of the sub-connected regions of the first connected region is obtained. For example, the crack feature evaluation value of the clustering starting point of the sub-connected region can be obtained first, then the crack feature evaluation value of the clustered pixels of the sub-connected region can be obtained, then the distance between the clustering starting point and the clustered pixels can be obtained, then the fitting residual between the clustering starting point and the clustered pixels can be obtained, and finally the clustering distance metric function of the sub-connected regions of the first connected region is obtained based on the crack feature evaluation value of the clustering starting point, the crack feature evaluation value of the clustered pixels, the distance, and the fitting residual.
[0093] In step S206, based on the clustering starting point and the clustering distance metric function, the sub-connected domains of the first connected domain are clustered to obtain multiple second connected domains.
[0094] In this step, based on the clustering starting point and the clustering distance metric, the sub-connected components of the first connected component are clustered to obtain multiple second connected components. For example, starting from the clustering starting point, clustering is performed with all adjacent pixels of the first connected component according to the clustering distance metric, resulting in pixels that can be classified into the same cluster. Then, starting from all edge pixels of the current cluster, the clusters are gradually expanded, repeating the above process until all pixels are classified into a cluster, or until no new pixels are added to any cluster during the iteration, indicating that the clustering has reached a stable state.
[0095] When a pixel has multiple clustering results or is an isolated pixel (not assigned to any cluster), the cluster containing the pixel with the smallest distance metric is selected as the cluster of that pixel. If there are still isolated pixels after clustering and the clustering distance with all clusters does not meet the minimum value limit, they are considered noise pixels and are removed.
[0096] In step S207, the degree of cracking in the second connected domain is obtained.
[0097] In this step, the degree of cracking in the second connected region is obtained. For example, the mean value of crack feature evaluations for all pixels in the second connected region can be obtained first, then the edge chain codes of the edge pixels in the second connected region can be obtained, then the sum of the absolute differences between the edge chain codes of any two adjacent edge pixels in the second connected region can be obtained, then the number of edge pixels in the second connected region can be obtained, then the area of the second connected region and the area of its minimum bounding rectangle can be obtained, and finally, the degree of cracking in the second connected region is obtained based on the mean value of crack feature evaluations for all pixels in the second connected region, the sum of the absolute differences between the edge chain codes of any two adjacent edge pixels in the second connected region, the number of edge pixels, the area of the second connected region, and the area of its bounding rectangle.
[0098] In step S208, the crack area of the hydraulic engineering dam body is obtained according to the degree of cracking in the second connected domain.
[0099] In this step, the cracked area of the hydraulic engineering dam body is obtained based on the crack severity of the second connected region. For example, if the crack severity exceeds a set threshold, the second connected region can be determined as a cracked area of the hydraulic engineering dam body. For example, the set threshold can be 0.6.
[0100] Figure 3 This is a flowchart illustrating a method for obtaining a crack feature evaluation value of a first pixel within a first connected region, according to an exemplary embodiment. Figure 3As shown, obtaining the crack feature evaluation value of the first pixel within the first connected region may include the following steps:
[0101] In step S2021, the grayscale value of the first pixel within the first connected region is obtained.
[0102] In this step, the grayscale value of the first pixel b within the first connected component a is obtained. The first pixel b refers to any pixel within the first connected region a.
[0103] In step S2022, the gradient magnitude of the grayscale value of the first pixel is obtained.
[0104] In this step, the gradient magnitude of the grayscale value of the first pixel b is obtained. .
[0105] In step S2023, the variance of the gray values of the pixels in the surrounding neighborhood of the first pixel is obtained.
[0106] In this step, the variance of the grayscale values of the pixels in the surrounding neighborhood of the first pixel b is obtained. The surrounding neighborhood refers to the 8-neighborhood of a pixel. In digital images, crack areas differ from dam areas and watermark areas, and are usually darker in color and have relatively more texture. The color can be described by the gray value of the pixel, and the texture distribution can be described by the gradient magnitude of the pixel and the variance of the gray values in the surrounding neighborhood.
[0107] In step S2024, the crack feature evaluation value of the first pixel in the first connected region is obtained based on the gray value, the gradient magnitude, and the variance.
[0108] In this step, based on the grayscale value Gradient magnitude and variance Obtain the crack feature evaluation value of the first pixel point b of a within the first connected region a. For example, the crack feature evaluation value of the first pixel point b of a within the first connected region a. It can be obtained from the following formula:
[0109]
[0110] When detecting cracks and defects in the dam body, there are differences in grayscale between the cracks, watermarks, and the dam body. Therefore, this method describes the characteristics of pixels in different regions (cracks, watermarks, and the dam body) by calculating the difference between the first pixel and its neighboring pixels. This allows for accurate differentiation of pixels in different regions during subsequent clustering.
[0111] Figure 4 This is a flowchart illustrating a method for obtaining the preference of a first pixel as a clustering starting point of a sub-connected region of a first connected region, according to an exemplary embodiment. Figure 4 As shown, obtaining the preference of the first pixel as the clustering starting point of a sub-connected region of the first connected region may include the following steps:
[0112] In step S2031, the mean value of the crack feature evaluation value of all pixels in the sub-connected domain of the first connected domain is obtained.
[0113] In this step, the mean value of the crack feature evaluation of all pixels in the sub-connected region c of the first connected region a is obtained. For example, taking the a-th connected component as an example, the crack feature evaluation values of all pixels in the a-th connected component are arranged in ascending order to obtain the crack feature evaluation value data sequence of the a-th connected component. Since there may be unsegmented dam background, water flow marks, and crack areas within the connected component, a clustering layer of 3 is selected to perform hierarchical clustering on the crack feature evaluation value data sequence of the a-th connected component, resulting in multiple clusters. The pixels in each cluster are distinguished and labeled within the a-th connected component to obtain the partitioning result of the a-th connected component, dividing the a-th connected component into multiple sub-connected components. Then, the mean crack feature evaluation value of all pixels in the sub-connected component c of the first connected component a can be obtained. .
[0114] In step S2032, the sum of the distances between the first pixel and all other pixels in the sub-connected regions of the first connected region is obtained.
[0115] In this step, the sum of the distances between the first pixel b and all other pixels in the sub-connected region c of the first connected region a is obtained. .in, Indicates the first The first connected component The number of pixels in each sub-connected region Indicates the first The first connected component The first sub-connected region The pixel and the The distance to the nth pixel, where x is the distance to the nth pixel. The first connected component The remaining pixels of each sub-connected region except for pixel b.
[0116] In step S2033, the preference of the first pixel as the clustering starting point of the sub-connected domain of the first connected domain is obtained based on the mean value of the crack feature evaluation value of all pixels in the sub-connected domain of the first connected domain and the sum value.
[0117] In this step, the average value of the crack feature evaluation of all pixels in the sub-connected region c of the first connected region a is used. and sum value Obtain the preference degree for the first pixel point b to become the clustering starting point of the sub-connected region c of the first connected region a. For example, the preference of the first pixel point b as the starting point for clustering of the sub-connected region c of the first connected region a. It can be obtained from the following formula:
[0118]
[0119] in, Indicates the first The first connected component The first sub-connected region The crack feature evaluation value of each pixel, where exp is an exponential function with the natural constant e as the base.
[0120] Indicates the first The smaller the difference between the crack feature evaluation value of the nth pixel and the mean value of all pixels in the sub-connected region c, the better. The more a pixel can represent the sub-connected region c, the higher the likelihood that pixel b will become the clustering starting point of the sub-connected region c of the first connected region a, thus segmenting different feature regions and making it easier to accurately screen crack regions. Indicates the first The first connected component The first sub-connected region The sum of the distances between the nth pixel and all other pixels in the connected sub-region c is used to determine the clustering process. The smaller this sum, the easier the clustering. The higher the preference of a pixel as the starting point for clustering, the more accurate the segmentation result and the faster the calculation speed.
[0121] Because the optimization degree represents the pixels with obvious features in different regions, when segmenting different regions in an image of a dam surface, in order to accurately segment each region, it is necessary to select feature pixels from different regions as initial cluster centers. The higher the optimization degree, the greater the probability of them being cluster centers. This allows the cracks and watermarks of the dam to be grouped into different clusters during the clustering process, facilitating rapid segmentation of different regions.
[0122] Figure 5 This is a flowchart illustrating a method for obtaining the clustering starting point of sub-connected regions of a first connected region according to an exemplary embodiment. Figure 5As shown, obtaining the clustering starting point of the sub-connected regions of the first connected region may include the following steps:
[0123] In step S2041, the pixel with the lowest optimization degree among the clustering starting points in the sub-connected domains of the first connected domain is taken as the clustering starting point of the sub-connected domains of the first connected domain.
[0124] In this step, the optimization degree of the clustering starting point in the sub-connected region c of the first connected region a is determined. The largest pixel, b, is used as the starting point for clustering the sub-connected region c of the first connected region a.
[0125] Based on the above method of obtaining the clustering starting points, several clustering starting points for all sub-connected domains can be obtained, which can best represent the characteristics of each region and have significant differences in the characteristics between them, ensuring that the starting point of the clustering process is highly representative.
[0126] This invention further introduces a feature-driven clustering starting point selection mechanism. Since each connected region may contain one or more sub-regions (sub-connected regions) with different feature performance, the feature value distribution of each pixel in the connected region is analyzed, such as color, texture, gradient, etc., and one or more clustering starting points are selected for clustering. Furthermore, when clustering pixels, selecting an appropriate clustering starting point is crucial.
[0127] The more representative the clustering starting point is to the features of the region, the easier it is for the features of pixels in its neighborhood to differ less from those of pixels starting from that point, thus making the clustering operation easier and more accurate. Therefore, it is necessary to introduce a crack feature evaluation value for each pixel based on its feature performance. This crack feature evaluation value is quantified using the same metric. The smaller the difference in crack feature evaluation values, the more likely the pixels belong to the same feature region. This allows for the selection of the optimal clustering starting point within the same feature region, ensuring that the starting point of the clustering process is highly representative. This enables the clustering process to cover all important feature regions while avoiding unnecessary over-segmentation or under-segmentation.
[0128] Figure 6 This is a flowchart illustrating a method for obtaining a clustering distance metric function for sub-connected regions of a first connected region, according to an exemplary embodiment. Figure 6 As shown, obtaining the clustering distance metric function for the sub-connected regions of the first connected component may include the following steps:
[0129] In step S2051, the crack feature evaluation value of the clustering starting point of the sub-connected domain is obtained.
[0130] In this step, the crack feature evaluation value of the clustering starting point s of the sub-connected domain is obtained. .
[0131] In step S2052, the crack feature evaluation value of the clustered pixels of the sub-connected domain is obtained.
[0132] In this step, the clustered pixels of the sub-connected regions are obtained. Crack characteristic evaluation value .
[0133] In step S2053, the distance between the clustering starting point and the clustered pixel is obtained.
[0134] In this step, the clustering starting point s and the clustered pixels are obtained. distance .
[0135] In step S2054, the fitting residual between the clustering starting point and the clustered pixel points is obtained.
[0136] In this step, the fitting residual between the clustering starting point s and the clustered pixel points v is obtained. For example, the clustered pixels can be started first. The crack feature evaluation values of all pixels on a straight line connecting the clustering starting point s are mapped onto a two-dimensional coordinate system as data points. Specifically, all pixels on the line are numbered according to its direction, with the pixel number as the x-axis and the crack feature evaluation value as the y-axis. This determines the mapped data points for all pixels on the line. A fitting process is then performed on all mapped data points to obtain the fitting residuals. .
[0137] In step S2055, the clustering distance metric function of the sub-connected domains of the first connected domain is obtained based on the crack feature evaluation value of the clustering starting point, the crack feature evaluation value of the clustered pixel, the distance, and the fitting residual.
[0138] In this step, the crack feature evaluation value is based on the clustering starting point s. Clustered pixels Crack characteristic evaluation value ,distance and fitting residuals Obtain the clustering distance metric function for the sub-connected components of the first connected component. For example, the clustering distance metric function for the sub-connected components of the first connected component. It can be obtained from the following formula:
[0139]
[0140] , Reflecting pixels and pixels The difference in crack feature evaluation values and distance values are considered. The smaller the difference and distance values, the more likely cracks should be clustered into one class. Crack pixels and watermark pixels on the dam body may overlap, but watermarks, due to long-term water erosion, exhibit different grayscale characteristics than cracks. Since cracks are continuous, pixels with similar grayscale characteristics and closer distances are more likely to be from the same region and thus more likely to cluster into the same cluster. This makes it easier to discover potential cracks and reduces omissions.
[0141] Therefore, based on the preferred clustering starting point and the improved clustering distance metric function based on scene features, the sub-connected domains of the first connected domain are clustered to obtain multiple second connected domains.
[0142] Figure 7 This is a flowchart illustrating a method for obtaining the degree of cracking in a second connected component according to an exemplary embodiment. Figure 7 As shown, obtaining the degree of cracks in the second connected component may include the following steps:
[0143] In step S2071, the mean value of the crack feature evaluation values of all pixels in the second connected domain is obtained.
[0144] In this step, the mean value of the crack feature evaluation values of all pixels in the second connected region is obtained. .
[0145] In step S2072, the edge chain code of the edge pixels of the second connected domain is obtained.
[0146] In this step, the edge chain codes of the edge pixels of the second connected component are obtained. For example, the Freeman chain code algorithm can be used to obtain the edge chain code sequence for each second connected component, which is a well-known technique. This application will not elaborate further on this.
[0147] In step S2073, the sum of the absolute values of the differences between the edge chain codes of any two adjacent edge pixels of the second connected domain is obtained.
[0148] In this step, the sum of the absolute differences between the edge chain codes of any two adjacent edge pixels in the second connected component is obtained. .
[0149] In step S2074, the number of edge pixels of the second connected domain is obtained.
[0150] In this step, the number of edge pixels of the second connected component is obtained. .
[0151] In step S2075, the area of the second connected region and the area of the smallest bounding rectangle of the second connected region are obtained.
[0152] In this step, the area of the second connected component is obtained. And the area of the minimum bounding rectangle of the second connected region. .
[0153] In step S2076, the degree of crack in the second connected region is obtained based on the mean value of the crack feature evaluation values of all pixels in the second connected region, the sum of the absolute values of the differences between the edge chain codes of any two adjacent edge pixels in the second connected region, the quantity, the area of the second connected region, and the area of the circumscribed rectangle.
[0154] In this step, the average crack feature evaluation value of all pixels in the second connected region is used. The sum of the absolute values of the differences between the edge chain codes of any two adjacent edge pixels in the second connected region. ,quantity Area of the second connected region and the area of the circumscribed rectangle Obtain the degree of cracks in the second connected component. For example, the degree of cracking in the second connected component. It can be obtained from the following formula:
[0155]
[0156] in, This is for normalization purposes.
[0157] No. The mean value of the crack feature evaluation of all pixels in the second connected region The larger the value, the more it matches the characteristics of a crack, the higher the degree of cracking, and the easier it is to accurately screen crack areas; the... The larger the absolute value of the difference between the edge chain codes of any two adjacent edge pixels in a second connected region, the stronger the irregularity of its edge shape. This is because crack edges are more irregular, while watermark edges are more regular. Therefore, cracks and watermarks can be distinguished by the chain codes of the edges of different second connected regions. The larger the value, the higher the likelihood that the second connected region is a crack, making it easier to accurately screen crack areas; since cracks in dam bodies are usually thin and relatively small in area, the smaller the area occupied by the second connected region of the circumscribed rectangle, the better. The larger the value, the higher the likelihood that it is a crack, which is helpful for identifying crack areas.
[0158] Figure 8This is a flowchart illustrating yet another method for obtaining crack regions in a hydraulic engineering dam body, according to an exemplary embodiment. Figure 8 As shown, obtaining the crack region of the hydraulic engineering dam body based on the crack degree of the second connected domain may include the following steps:
[0159] In step S2081, if the degree of cracking is greater than a set threshold, the second connected region is determined to be the cracked area of the water conservancy project dam body.
[0160] In this step, the degree of cracking If the crack level exceeds a set threshold, the second connected region u is determined to be a cracked area in the dam body of the hydraulic engineering project. For example, the set threshold could be 0.6. (Crack severity) When the value exceeds the threshold, the second connected region u is considered to be a crack region; thus, all crack regions in the dam image can be obtained.
[0161] Figure 9 This is a flowchart illustrating a method for obtaining the degree of anomaly in a crack region according to an exemplary embodiment. Figure 9 As shown, obtaining the degree of anomaly in the crack region may include the following steps:
[0162] In step S301, the degree of cracking in the cracked area is obtained.
[0163] In this step, the crack degree of crack region j is obtained. .
[0164] In step S302, the area of the crack region is obtained.
[0165] In this step, the area of crack region j is obtained. .
[0166] In step S303, the degree of abnormality of the crack region is determined based on the degree of cracking in the crack region and the area of the crack region.
[0167] In this step, based on the degree of cracking in crack region j and the area of crack region j Determine the degree of anomaly in all crack areas of the dam body. For example, the degree of abnormality in all cracked areas of the dam body It can be obtained from the following formula:
[0168]
[0169] Where n represents the number of crack regions.
[0170] Figure 10This is a flowchart illustrating a method for providing anomaly alerts to a hydraulic engineering dam body based on the degree of anomaly in a cracked area, according to an exemplary embodiment. Figure 10 As shown, the step of providing an anomaly alert for the hydraulic engineering dam body based on the degree of abnormality in the cracked area may include the following steps:
[0171] In step S401, the dam body anomaly level is classified according to the degree of anomaly in the cracked area.
[0172] In this step, based on the degree of anomaly in the crack area... The dam body anomaly levels are classified. For example, the anomaly levels of the dam body can be classified into three levels: low, medium, and high, based on the range of values for W.
[0173] In step S402, an alarm level is set according to the dam body anomaly level.
[0174] In this step, corresponding alarm levels are set according to the anomaly level of the dam body. For example, three alarm levels (low, medium, and high) can be set based on the three anomaly levels of the dam body.
[0175] In step S403, the corresponding alarm information is automatically sent according to the alarm level.
[0176] In this step, corresponding alarm information is automatically sent based on the alarm level. For example, alarm information can be automatically sent according to three alarm levels: low, medium, and high. This alarm information can be voice information or alarm sounds of different frequencies; the higher the alarm level, the higher the frequency of the alarm sound.
[0177] In summary, this application provides a method for image monitoring of a water conservancy project dam. The method includes: acquiring a monitoring image of the water conservancy project dam; based on the monitoring image, using an improved clustering algorithm to obtain crack areas of the water conservancy project dam; obtaining the anomaly degree of the crack areas; and providing anomaly alerts to the water conservancy project dam based on the anomaly degree of the crack areas. This application, through an improved clustering algorithm to identify crack areas of the dam, can better identify potential crack areas and provide anomaly alerts to the dam based on the anomaly degree of the crack areas, thereby improving the accuracy and robustness of dam crack monitoring and thus enhancing the safety of the dam.
[0178] This application also provides a computer-readable storage medium storing computer program instructions thereon, which, when executed by a processor, implement the steps of the image monitoring method for water conservancy engineering dams provided in this application.
[0179] In another exemplary embodiment, a computer program product is also provided, which includes a computer program executable by a programmable electronic device, the computer program having a code portion for performing the above-described method for monitoring the image of a hydraulic engineering dam when executed by the programmable electronic device.
[0180] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these modifications and improvements all fall within the protection scope of this application.
Claims
1. A method for image monitoring of dam bodies in water conservancy projects, characterized in that, The method includes: Acquire monitoring images of the dam body of the water conservancy project; Based on the monitored images, multiple first connected components exhibiting anomalies are obtained using a threshold segmentation method; a crack feature evaluation value for a first pixel within each first connected component is obtained; based on the crack feature evaluation value, the preference degree for the first pixel to become a clustering starting point for a sub-connected component of the first connected component is obtained; based on the preference degree of the clustering starting point, clustering starting points for the sub-connected components of the first connected component are obtained; a clustering distance metric function for the sub-connected components of the first connected component is obtained; based on the clustering starting points and the clustering distance metric function, the sub-connected components of the first connected component are clustered to obtain multiple second connected components; the crack severity of the second connected components is obtained; based on the crack severity of the second connected components, the crack region of the hydraulic engineering dam body is obtained. The degree of anomaly in the crack region is obtained; Based on the degree of anomaly in the crack region, an anomaly warning is issued for the dam body of the water conservancy project; obtaining the crack feature evaluation value of the first pixel point within the first connected region includes: Obtain the grayscale value of the first pixel within the first connected component; Obtain the gradient magnitude of the grayscale value of the first pixel; Obtain the variance of the grayscale values of the pixels in the surrounding neighborhood of the first pixel; Based on the gray value, the gradient magnitude, and the variance, obtain the crack feature evaluation value of the first pixel in the first connected region; The step of obtaining the preference of the first pixel as the clustering starting point of a sub-connected region of the first connected region includes: Obtain the mean value of the crack feature evaluation values of all pixels in the sub-connected regions of the first connected region; Obtain the sum of the distances between the first pixel and all other pixels in the sub-connected regions of the first connected region; Based on the mean of the crack feature evaluation values of all pixels in the sub-connected regions of the first connected region, and the sum value, the preference of the first pixel as the clustering starting point of the sub-connected regions of the first connected region is obtained. The step of obtaining the clustering distance metric function for the sub-connected regions of the first connected region includes: Obtain the crack feature evaluation value of the clustering starting point of the sub-connected domain; Obtain the crack feature evaluation value of the clustered pixels in the sub-connected region; Obtain the distance between the clustering starting point and the clustered pixel; To obtain the fitting residual between the clustering starting point and the clustered pixel points, the following steps are taken: First, the crack feature evaluation values of all pixels on the straight line connecting the clustered pixel points v and the clustering starting point s are mapped onto a two-dimensional coordinate system as data points. That is, all pixels on the straight line are numbered according to the direction of the straight line, with the pixel number as the abscissa and the crack feature evaluation value of the pixel as the ordinate, to determine the mapped data points of all pixels on the straight line, and to fit all the mapped data points to obtain the fitting residual. Based on the crack feature evaluation value of the clustering starting point, the crack feature evaluation value of the clustered pixel, the distance, and the fitting residual, obtain the clustering distance metric function of the sub-connected domains of the first connected domain; The step of obtaining the degree of cracks in the second connected component includes: Obtain the mean value of the crack feature evaluation values of all pixels in the second connected region; Obtain the edge chain code of the edge pixels of the second connected component; Obtain the sum of the absolute values of the differences between the edge chain codes of any two adjacent edge pixels in the second connected region; Obtain the number of edge pixels of the second connected component; Obtain the area of the second connected component and the area of the minimum bounding rectangle of the second connected component; The degree of crack in the second connected region is obtained based on the mean of the crack feature evaluation values of all pixels in the second connected region, the sum of the absolute values of the differences between the edge chain codes of any two adjacent edge pixels in the second connected region, the quantity, the area of the second connected region, and the area of the circumscribed rectangle.
2. The method for image monitoring of a water conservancy project dam according to claim 1, characterized in that, The step of obtaining the clustering starting point of the sub-connected regions of the first connected region includes: The pixel with the lowest optimization degree among the clustering starting points in the sub-connected regions of the first connected region is taken as the clustering starting point of the sub-connected region of the first connected region.
3. The method for image monitoring of a water conservancy project dam according to claim 1, characterized in that, The step of obtaining the crack region of the hydraulic engineering dam body based on the crack degree of the second connected domain includes: If the degree of cracking exceeds a set threshold, the second connected region is determined to be the cracked area of the dam body of the water conservancy project.
4. The method for image monitoring of a water conservancy project dam according to claim 1, characterized in that, The process of obtaining the degree of anomaly in the crack region includes: Obtain the degree of cracking in the cracked area; Obtain the area of the crack region; The degree of abnormality of the crack region is determined based on the degree of cracking in the crack region and the area of the crack region.
5. The method for image monitoring of a water conservancy project dam according to claim 1, characterized in that, The method of providing anomaly alerts to the hydraulic engineering dam body based on the degree of abnormality in the cracked area includes: The dam body anomaly level is classified according to the degree of anomaly in the cracked area; Based on the anomaly level of the dam body, set the corresponding alarm level; Based on the alarm level, the corresponding alarm information will be sent automatically.
Citation Information
Patent Citations
Underwater detection method and system for contact leakage of joint of culvert body under dam
CN118230147A
Underwater detection method and system for contact leakage of tunnel joints of dam culvert
US20250044175A1