A method for preventing leakage in water conservancy projects
By analyzing underwater images and calculating image quality, identifying and screening cracks in water conservancy projects, the leakage problem in water conservancy projects is solved, the detection efficiency and accuracy are improved, and the project safety is ensured.
Patent Information
- Application Number
- CN202411311590.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-09-20
AI Technical Summary
In water conservancy projects, the disrepair of the dam body and dam foundation, the aging of the engineering structure and the cracks caused by incomplete foundation treatment lead to leakage and threaten the safety of the project and the property safety of the coastal residents.
By analyzing the underwater image, calculating the image quality, identifying suspected cracks and determining whether they are cracks based on the morphological characteristics and credibility evaluation values, and then taking anti-leakage treatment. Specific methods include obtaining underwater image sequences, performing pre-processing and threshold division, extracting key points and connected domains, calculating credibility evaluation values, and further screening using morphological and mathematical models.
It improves the efficiency and accuracy of crack detection in water conservancy projects, reduces the interference of floating objects and sediments in water bodies on judgments, and ensures the stable operation and safety of water conservancy projects.
Smart Images

Figure CN118823026B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of water conservancy projects, and in particular to a water conservancy project anti-leakage treatment method. Background Art
[0002] With the continuous progress of water conservancy, the number of water conservancy projects has increased significantly. In these projects, the implementation of anti-leakage measures is a key link to ensure the quality of the project. By adopting advanced technology and materials, anti-leakage work provides the necessary quality assurance for water conservancy projects.
[0003] In the construction process of water conservancy projects, the occurrence of leakage is a problem that cannot be underestimated. These leakage problems usually occur due to the disrepair of the dam body and dam foundation, the aging of the engineering structure, and cracks caused by incomplete treatment of the engineering foundation. The existence of these cracks not only threatens the normal operation of water conservancy projects and limits their full benefits, but also poses a potential threat to the property safety of residents along the coast. Therefore, when constructing water conservancy projects, it is very important to accurately identify the crack locations and take targeted anti-leakage measures to ensure the safety of the project. Summary of the invention
[0004] The purpose of the present invention is to provide a method for preventing leakage in water conservancy projects to solve the problems raised in the above background technology. In order to achieve the above purpose, the technical solution adopted by the present invention is as follows:
[0005] A method for anti-leakage treatment of a water conservancy project, the method comprising: sequentially acquiring underwater images at the same position of the water conservancy project at preset time intervals; pre-processing all the underwater images and forming an image sequence; calculating the image quality of each underwater image according to the grayscale features of each underwater image; confirming suspected cracks and credibility evaluation values corresponding to the suspected cracks based on the image quality of each underwater image and the change of each shadow part in the image sequence over time; judging whether the suspected cracks are cracks according to the morphological features of the suspected cracks and the credibility evaluation values, and if the suspected cracks are cracks, performing anti-leakage treatment on the water conservancy project according to the position information of the suspected cracks.
[0006] In a possible implementation, the image quality of each underwater image is calculated based on the grayscale features of each underwater image, including: performing threshold division on a first target image to obtain a background area and a foreground area corresponding to the first target image, where the first target image is any underwater image in an image sequence; calculating a grayscale difference based on the grayscale value of the background area and the grayscale value of the foreground area corresponding to the first target image; extracting key points in the first target image based on a preset key point extraction algorithm, and extracting the grayscale values of the key points in at least one first subsequent image in sequence according to a time sequence, where the first subsequent image is an underwater image taken after the first target image; calculating a grayscale mean of the key points based on the grayscale value of the key points in each first subsequent image; and calculating the image quality of the first target image based on the grayscale mean of the key points and the grayscale difference.
[0007] In a possible implementation, threshold division is performed on the first target image to obtain a background area and a foreground area, including: calculating the underwater image based on the Otsu method to obtain an optimal threshold; dividing the pixel points of the underwater image based on the optimal threshold to obtain a background area and a foreground area, wherein each pixel point in the background area is smaller than the optimal threshold, and each pixel point in the foreground area is greater than or equal to the optimal threshold.
[0008] In a possible implementation, the key point extraction is a process of extracting feature points from the first target image using a scale-invariant feature transformation mathematical model.
[0009] In a possible implementation, based on the image quality of each underwater image and the change of each shadow part in the image sequence over time, the suspected cracks and the credibility evaluation values corresponding to the suspected cracks are confirmed, including: performing threshold division on the second target image to obtain the foreground area corresponding to the second target image, where the second target image is any underwater image in the image sequence; obtaining at least one connected domain according to the adjacent state of pixels in the foreground area corresponding to the second target image; obtaining the pixel coordinates of each connected domain in the second target image one by one to form an initial pixel coordinate set corresponding to each connected domain; obtaining the pixel coordinates of each connected domain in each second subsequent image one by one to form a pixel coordinate set sequence corresponding to each connected domain, where the second subsequent image is an underwater image taken after the second target image; calculating the credibility evaluation value corresponding to each connected domain according to the initial pixel set corresponding to each connected domain, the pixel set sequence and the image quality corresponding to each second subsequent image; judging whether each connected domain is a suspected crack according to the credibility evaluation value.
[0010] In a possible implementation, based on the image quality of each underwater image and the change over time of each shadow part in the image sequence, the suspected cracks and the credibility assessment values corresponding to the suspected cracks are confirmed, and then it also includes: correcting the credibility assessment values according to the correlation between the quality data set and the area data set, and updating the credibility assessment values to the corrected results, the quality data set is composed of the image quality corresponding to each third target image, the area data set is composed of the area values of the suspected cracks in each third target image, and the third target image is the underwater image where the suspected cracks appear.
[0011] In a possible implementation, the credibility assessment value is corrected according to the correlation between the quality data set and the area data set, including: sorting the quality data set and the area data set in time sequence to obtain an image quality sequence and an area sequence; subtracting adjacent areas in the area sequence and forming an area difference sequence in time sequence; calculating the Pearson correlation coefficient between the area difference sequence and the image quality sequence; correcting the credibility assessment value based on the Pearson correlation coefficient, and updating the credibility assessment value to the corrected result.
[0012] In a possible implementation, judging whether the suspected crack is a crack based on its morphological features and credibility evaluation values includes: respectively calculating a first area and a second area of the suspected crack in each third target image, wherein the first area is an enclosed area of the suspected crack, the second area is a minimum circumscribed rectangular area of the suspected crack, and the third target image is the underwater image where the suspected crack appears; respectively extracting skeleton lines of the suspected crack in each third target image according to a preset extraction algorithm; respectively calculating a symmetry evaluation value of each skeleton line; calculating a crack possibility evaluation value of the suspected crack in each third target image based on the symmetry evaluation value corresponding to each third target image, the credibility evaluation value, the first area, and the second area; calculating the mean of all the crack possibility evaluation values to obtain a crack possibility evaluation mean; judging whether the suspected crack is a crack area based on the crack possibility evaluation mean.
[0013] In one possible implementation, the symmetry evaluation value of each skeleton line is calculated separately, including: extracting the normal vector of each point on the skeleton line one by one; calculating the gradient of all points on each normal vector separately and summing them to obtain the sum vector corresponding to each normal vector; calculating the modulus of each sum vector separately and summing them to obtain the symmetry evaluation value.
[0014] In a possible implementation, the preset time interval is 15 minutes.
[0015] The present invention has the following beneficial effects:
[0016] The present invention calculates the image quality by analyzing underwater images and combining the influence of the water level depth in the dam. The present invention uses the grayscale features of the connected domain in the underwater image to identify suspected cracks. At the same time, by screening suspected cracks according to the changes in the shadow part of the underwater image over time, the analysis scope and workload are narrowed. Finally, based on the morphological characteristics of the suspected cracks, the cracks are further screened and determined, effectively reducing the interference of floating objects and sediments in the water body on the judgment of cracks. The present invention improves the efficiency and accuracy of crack detection in water conservancy projects, helps to find cracks in time and take corresponding anti-leakage measures, and ensures the stable operation of water conservancy projects. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A schematic flow chart of a method for preventing leakage in a water conservancy project provided in Embodiment 1 of the present invention;
[0019] Figure 2 A schematic flow chart of step S4 provided in Example 1 of the present invention;
[0020] Figure 3 A schematic flow chart of step S5 provided in Example 1 of the present invention;
[0021] Figure 4 A schematic flow chart of step S3 provided in Embodiment 2 of the present invention;
[0022] Figure 5 A schematic diagram of a flow chart of a method for preventing leakage in a water conservancy project provided in Embodiment 3 of the present invention;
[0023] Figure 6 This is a flow chart of step 5 provided in embodiment 3 of the present invention. DETAILED DESCRIPTION
[0024] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of a water conservancy project anti-leakage treatment method proposed by the present invention, its specific implementation method, structure, features and effects, in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0025] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0026] Embodiment 1:
[0027] The specific scheme of the anti-leakage treatment method for water conservancy projects provided by the present invention is described in detail below in conjunction with the accompanying drawings.
[0028] See also Figure 1 , which shows a schematic flow chart of a method for preventing leakage of a water conservancy project provided by an embodiment of the present invention, which includes steps S1-S5 in this implementation.
[0029] S1. Acquire underwater images at the same location of a water conservancy project in sequence according to preset time intervals.
[0030] In this embodiment, the water conservancy project involved can be a dam or a dike, which is not specifically limited in this embodiment. To facilitate in-depth understanding by those skilled in the art, this embodiment is described in detail by taking the reservoir dam foundation as an example.
[0031] The underwater image of the dam obtained in this step is obtained by taking a high-resolution camera (resolution of 8688*5792). The camera has advanced imaging technology and can capture subtle changes in the underwater environment. In addition, in view of the influence of factors such as reservoir scheduling, upstream water and downstream water use, the water level in the dam is in continuous change, so the time interval set in this embodiment is 15 minutes. For those skilled in the art, this time interval can be adjusted to other values to adapt to different application environment requirements, and this embodiment does not set specific restrictions on this.
[0032] S2. Preprocess all the underwater images and form an image sequence.
[0033] Based on the above-mentioned shooting results, this embodiment arranges the underwater images taken within 12 hours before the current moment in chronological order to form an image sequence. The sequence contains a total of 48 underwater images, and each image records the state of the dam foundation at the same location in the underwater environment at different time points.
[0034] In addition, to facilitate subsequent processing, all the underwater images are uniformly preprocessed in this embodiment. That is, the 48 underwater images in the image sequence are uniformly grayed. Graying is a common image processing technology that removes color information and retains only brightness information, thereby simplifying image data and facilitating analysis and identification of underwater structure details. The processed image sequence not only reduces the amount of data, but also improves the efficiency and accuracy of image analysis.
[0035] S3. Calculate the image quality of each underwater image according to the grayscale features of each underwater image.
[0036] In this embodiment, the fluctuation of the water level in the dam at different time periods and the difference in water clarity are taken into account. The clarity of the water body is affected by many factors, including but not limited to seasonal rainfall, upstream water carrying materials, and aquatic biological activities. These factors work together to cause the water body to present different degrees of turbidity at different time points. The height of the water level and the change of water turbidity have a significant impact on the underwater lighting conditions, and the change of lighting conditions will directly affect the quality of underwater image acquisition.
[0037] Considering that the quality of the image is directly related to the accuracy of dam foundation crack identification, in this embodiment, the quality of the collected images is first analyzed, and based on the analysis results, correction guidance is provided for subsequent crack judgment to ensure the accuracy and reliability of the identification results.
[0038] Regarding the evaluation of image quality, those skilled in the art usually use the Full Reference (FR) indicator method. This method requires the existence of a reference image with the same quality as the image to be evaluated. In this embodiment, an image with clear subjective evaluation can be selected as the reference image, and the image quality is evaluated by comparing the difference between the two. For example, the Structural Similarity Index (SSIM) is a commonly used full-reference image quality evaluation indicator, which evaluates image quality by comparing the brightness, contrast and structural information of the image. In addition, the Gradient Magnitude Similarity Deviation (GMSD) is also an effective evaluation method, which measures image quality by analyzing the distribution of image gradients. Using the above method, this embodiment provides a scientific basis for the accurate evaluation of image quality.
[0039] S4. Based on the image quality of each underwater image and the change of each shadow part in the image sequence over time, confirm and obtain the suspected crack and the credibility evaluation value corresponding to the suspected crack.
[0040] In this embodiment, it is considered that if cracks appear in the dam foundation, the position of the cracks remains relatively stable and will not change significantly in position or shape due to changes in water level. However, the length or shape of the cracks may change over time. For example, initially it may only appear as small cracks, but over time, these cracks may gradually expand and grow. At the same time, floating objects in the water body can present diverse characteristics, including long strips or clumps of water plants, algae, driftwood, and various other irregularly shaped garbage. These floating objects will be affected by the scouring effect of the water flow, causing their position and coverage area to change, and the degree of change in the underwater image will be greater than that of the cracks.
[0041] Based on the above situation, this embodiment proposes a step for preliminarily judging whether the shadow part in the dam foundation is likely to be a crack. Figure 2 The flowchart shown in the figure shows the process of processing one of the underwater images, including steps S41 to S46.
[0042] S41. Perform threshold division on a second target image to obtain a foreground area corresponding to the second target image, where the second target image is any underwater image in an image sequence.
[0043] It should be noted that the division method in this step is the same as that in step S31 and will not be repeated in this step.
[0044] S42, obtaining at least one connected region according to the adjacent states of pixels in the foreground region corresponding to the second target image.
[0045] It should be noted that in this embodiment, the connected domain refers to a set of adjacent pixels in the foreground area, and these adjacent pixels may be adjacent in the horizontal, vertical or diagonal direction. After understanding the concept of the connected domain, the next step is to operate on the second target image.
[0046] Specifically, we need to sort all connected domains in the second target image. The purpose of sorting is to facilitate processing each connected domain in sequence.
[0047] S43, acquiring pixel point coordinates of each connected domain in the second target image one by one to form an initial pixel point coordinate set corresponding to each connected domain.
[0048] S44, acquiring pixel point coordinates of each of the connected domains in each second subsequent image one by one to form a pixel point coordinate set sequence corresponding to each of the connected domains, wherein the second subsequent image is an underwater image taken after the second target image.
[0049] In order to facilitate the understanding of those skilled in the art, Underwater image Through step S43, the first connected domain can be obtained. Underwater image Then, through step S44, the coordinates of all pixels in the connected domain are obtained in sequence. The first underwater image was taken The connected domains are the coordinates of all pixels in the underwater image, and form a time-ordered pixel coordinate set sequence in turn.
[0050] S45. Calculate a credibility evaluation value corresponding to each connected domain according to the initial pixel point set corresponding to each connected domain, the pixel point set sequence, and the image quality corresponding to each second subsequent image.
[0051] The calculation formula of the credibility evaluation value is as follows:
[0052]
[0053] In the formula, Indicates Underwater image The connected domain is the credibility evaluation value of the crack; Indicates the The shooting time of the underwater images is the number of underwater images shot at the starting time, which is equal to the number of elements in the pixel point coordinate set sequence; Indicates The connected domain is The number of pixels in the underwater image, Not zero; Indicates The connected domain is The pixel coordinate set of the underwater image is The number of pixels in the intersection of the pixel coordinate sets of the underwater images can also be called the The number of pixels in the intersection of the initial pixel point coordinate set of the connected domain and the cth pixel point coordinate set in the pixel point coordinate set sequence; Indicates Image quality of underwater images; Indicates Image quality of underwater images; Represents the normalization function.
[0054] In the above calculation formula, Indicates The connected domain and The degree of overlap of each underwater image behind the underwater image to which the connected domain belongs, The larger the value, the The smaller the position change of the connected domain in the later time period, the smaller the position change of the connected domain in the i-th underwater image. The greater the possibility that a connected domain is a crack.
[0055] S46: Determine whether each connected domain is a suspected crack according to the credibility evaluation value.
[0056] After completing the above calculation steps, this embodiment ensures that each connected domain corresponds to a suspected crack. For those skilled in the art, by setting a specific suspected threshold, the interference of some floating objects in the water body can be eliminated in turn, thereby improving the accuracy of crack detection. Specifically, in this embodiment, the suspected threshold can be set to 0.7. However, for those skilled in the art, they can also choose other values as suspected thresholds according to actual conditions. In this embodiment, no restrictions are imposed on the specific values of the suspected threshold.
[0057] S5. Determine whether the suspected crack is a crack according to the morphological characteristics and credibility evaluation value of the suspected crack. If the suspected crack is a crack, perform anti-leakage treatment on the water conservancy project according to the location information of the suspected crack.
[0058] Through the above steps, the suspected crack area and the credibility evaluation value of the suspected crack area in each underwater image are obtained in this embodiment. However, there is still a possibility of misjudgment of cracks due to the distribution of sediments, so further analysis is required based on the image features of the suspected cracks.
[0059] In this embodiment, it is taken into account that cracks are usually distributed in a linear manner, while sediments are mostly in a clumpy form, and the cracks show a grayscale change from the center to the sides in the image, with the grayscale value in the middle being low and the color being dark, while the grayscale value on both sides gradually becomes higher and the color becomes brighter, so the suspected cracks can be judged based on this morphological feature.
[0060] In this embodiment, suspected crack areas are extracted from each underwater image through the above steps, and credibility assessment values are calculated for these areas. However, in view of the complexity of the underwater environment, especially the distribution of sediments, there is still a possibility of misjudgment of cracks. In order to improve the accuracy of recognition, this embodiment further analyzes the image characteristics of suspected cracks. That is, cracks show linear distribution characteristics in the image, while sediments are mostly in clumps. In addition, cracks show a special grayscale change pattern in the image, which gradually changes from the center to the sides. Specifically, the grayscale value of the central part of the crack is lower and the color is darker, while the grayscale values on both sides gradually increase. Based on these morphological features, we can make more accurate judgments on suspected cracks, thereby effectively distinguishing cracks from sediments and reducing the possibility of misjudgment. For details, please refer to Figure 3The flowchart shown in FIG. 1 shows a process of performing auxiliary judgment based on the morphological characteristics of the crack, including steps S51 to S56.
[0061] S51. Calculate the first area and the second area of the suspected crack in each third target image respectively, where the first area is the enclosed area of the suspected crack, and the second area is the minimum circumscribed rectangular area of the suspected crack. The third target image is the underwater image where the suspected crack appears.
[0062] S52 . Extract skeleton lines of the suspected cracks in each third target image according to a preset extraction algorithm.
[0063] In this step, the extraction algorithm involved can be either a morphological thinning algorithm or a mathematical morphology algorithm.
[0064] Among them, the morphological thinning algorithm is a technology used for image processing, which makes the target shape in the image more refined and clear by gradually removing the pixels in the image. The mathematical morphology algorithm is an image processing method based on set theory and geometry, which operates the image by using structural elements to extract, analyze and process the morphological features of the image. The above-mentioned morphological thinning algorithm and mathematical morphology algorithm are both prior arts and will not be repeated in this embodiment.
[0065] S53, respectively calculating the symmetry evaluation value of each skeleton line.
[0066] In this step, the symmetry evaluation value involved mainly quantifies the linear features of each connected domain from the morphological point of view, and evaluates whether the connected domain presents a characteristic of gradual change from the center to the sides from the perspective of grayscale value. Specifically, the symmetry evaluation value can quantify the linear distribution characteristics of the cracks in the image and quantify whether the cracks show a specific grayscale change pattern in the image, that is, a gradual transition from the center to the sides.
[0067] To facilitate understanding by those skilled in the art, in this embodiment, the method for calculating the symmetry evaluation value of one skeleton line is taken as an example, see steps S531 to S533 for details, and the symmetry evaluation values of other skeleton lines are calculated in the same manner as follows.
[0068] S531, extracting the normal vector of each point on the skeleton line one by one.
[0069] S532, respectively calculate the gradients of all points on each normal vector and sum them up to obtain a sum vector corresponding to each normal vector.
[0070] S533, respectively calculate the modulus of each sum vector, and perform mean calculation to obtain a symmetry evaluation value.
[0071] In this step, the gradient directions of the pixels corresponding to both sides of the crack skeleton line are considered. Specifically, the gradient directions of these pixels show opposite characteristics, while their gradient values remain consistent. Based on this characteristic, for any point on the skeleton line, the sum of the gradients of all pixels in the normal direction should be zero. The above method can effectively measure the shape characteristics of suspected cracks.
[0072] S54, calculating the symmetry evaluation value corresponding to each third target image, the credibility evaluation value, the first area, and the second area to obtain a crack possibility evaluation value of the suspected crack in each third target image.
[0073] Among them, the calculation formula for the mean value of crack possibility assessment is as follows:
[0074]
[0075] In the formula, Indicates The mean value of the crack possibility assessment for the suspected cracks; Indicates The credibility assessment value of the suspected cracks; Indicates The first area of suspected cracks; Indicates A second area of suspected cracks, Not zero; Indicates Symmetry evaluation value of suspected cracks; Represents an exponential function with the natural constant e as the base.
[0076] In the above calculation formula, The smaller the value, the The greater the difference between the area of a suspected crack and its minimum circumscribed rectangle, the The shape of the first suspected crack is closer to the shape of the crack. The greater the probability that a suspected crack is a crack.
[0077] S55. Calculate the mean of all the crack possibility assessment values to obtain a crack possibility assessment mean.
[0078] S56. Determine whether the suspected crack is a crack area according to the crack possibility assessment mean value.
[0079] In this embodiment, by calculating the mean of the crack possibility assessment and comparing it with the preset judgment threshold, it can be confirmed whether the suspected crack actually belongs to the crack area. Specifically, in this embodiment, the judgment threshold can be set to 0.8, but those skilled in the art can select other values according to actual conditions, and this embodiment does not make specific restrictions on this.
[0080] Based on the above judgment, the user of this embodiment can perform corresponding anti-leakage treatment on the water conservancy project according to the location information of the suspected cracks. In addition, this embodiment effectively reduces the interference of floating objects and water level depth in the water body on the judgment of cracks in the image by conducting in-depth analysis of the dam foundation image, thereby improving the accuracy of crack identification. By more accurately detecting cracks in the dam foundation, this embodiment can take appropriate treatment measures for the detected cracks, such as crack repair, excavation backfill, and covering, so as to reduce water leakage and further reduce other safety hazards that may be caused by water leakage.
[0081] Embodiment 2:
[0082] The difference between this embodiment and embodiment 1 is that this embodiment provides an image quality evaluation method different from the full reference (FR) indicator method. Specifically, this embodiment provides an image quality analysis method specifically for the impact of various floating objects in the water body. For details, please refer to Figure 4 , Figure 4 It shows that steps S31 to S35 process any underwater image separately, that is, The same method can be used to process other underwater images, which will not be described in detail in this embodiment.
[0083] S31. Perform threshold division on a first target image to obtain a background area and a foreground area corresponding to the first target image, wherein the first target image is any underwater image in an image sequence.
[0084] It should be noted that, in this step, those skilled in the art can directly segment the first target image by presetting the segmentation threshold. At the same time, segmentation can also be performed according to an algorithm, such as step S311 and step S312 provided in this embodiment to achieve segmentation of the foreground and background.
[0085] It should be noted that in this step, those skilled in the art can directly perform segmentation processing on the first target image by means of a preset threshold mechanism. The key to this step is to accurately define the boundary of the segmentation to retain the core information of the image and eliminate irrelevant background elements. At the same time, if it is necessary to respond to different image characteristics more flexibly, those skilled in the art can also adopt an algorithm-driven segmentation method. For example, in step S311 and step S312 of this embodiment, through the synergy of these two steps, the foreground and background of the image can be effectively distinguished, providing strong support for subsequent image analysis and application.
[0086] S311. Calculate the underwater image based on the Otsu method to obtain the optimal threshold.
[0087] S312. Divide the pixels of the underwater image into a background area and a foreground area based on the optimal threshold, wherein each pixel in the background area is smaller than the optimal threshold, and each pixel in the foreground area is greater than or equal to the optimal threshold.
[0088] In the present step S311-S312, the OTSU method is an algorithm for determining the threshold value for image binarization segmentation, which was proposed by Japanese scholar OTSU in 1979. This method is also called the maximum inter-class variance method, because after the image is binarized and segmented according to the threshold value calculated by the OTSU method, the inter-class variance between the foreground and background images reaches the maximum value. This algorithm is considered to be the optimal method for selecting thresholds in image segmentation, and its calculation process is simple and is not affected by changes in image brightness and contrast.
[0089] S32. Calculate a grayscale difference based on the grayscale value of the background area and the grayscale value of the foreground area corresponding to the first target image.
[0090] The grayscale difference calculation formula is as follows:
[0091]
[0092] in, Indicates Grayscale difference of underwater images; Indicates The mean grayscale value of the pixels in the foreground area of the underwater image; Indicates The mean grayscale value of the pixels in the background area of the underwater image; The above-mentioned method for calculating the grayscale average value of the pixels in the foreground area and the grayscale average value of the pixels in the background area belongs to the prior art. The method involves summing the grayscale values and dividing by the total number of pixels to obtain the average value, which will not be described in detail in this embodiment.
[0093] In the above calculation formula The larger the value is, the greater the grayscale difference between the foreground area and the background area is, which means that the pixels in the foreground area are more obvious, thus indicating that the image quality is better.
[0094] S33. Extract key points in the first target image based on a preset key point extraction algorithm, and extract grayscale values of the key points in at least one first subsequent image in sequence according to a time sequence, where the first subsequent image is an underwater image taken after the first target image.
[0095] The key point extraction mentioned in this step is the process of extracting feature points of the first target image using a scale-invariant feature transform mathematical model. Among them, the scale-invariant feature transform (SIFT) mathematical model is a technical means well known to those skilled in the art. When extracting the key points of the first target image, the algorithm includes constructing a multi-scale space and detecting feature points at different scales to ensure that these feature points can maintain their invariance when the image is scaled, rotated, or even when the illumination changes. Among them, it should be noted that in this step, the number of key points may not be one, that is, it may be greater than or equal to two, and it represents an area. In order to facilitate the understanding of those skilled in the art, this step is exemplified by taking one key point as an example.
[0096] On this basis, the grayscale value of the key point in the first subsequent image is further explored. Specifically, this step adopts the Continuously Adaptive Mean-Shift (CamShift) algorithm. Specifically, the continuous adaptive mean shift algorithm is used to accurately identify and locate all the pixels constituting the key point in the first target image. And thereby obtain a set of coordinate parameter information of all the pixels constituting the key point, which represents the specific position of the key point in turn. Subsequently, the grayscale value is extracted in each first subsequent image using the coordinate parameter information set.
[0097] S34. Calculate the grayscale value of the key point in each first subsequent image to obtain a grayscale mean of the key point.
[0098] Specifically, the calculation formula for the grayscale mean of the key points in this step is as follows:
[0099]
[0100] In the formula, Indicates The grayscale mean of the key points of the underwater image; Indicates the The number of underwater images taken at the start time; Indicates The grayscale mean of all key points in the underwater image. The method for calculating the grayscale mean of the above key points belongs to the prior art. The method involves summing the grayscale values and dividing by the total number of pixels to obtain the average value, which will not be described in detail in this embodiment.
[0101] In the above calculation formula, The larger the value, the The larger the grayscale mean of the key points of the underwater image, the The more obvious the key points of the first underwater image are, the more obvious the key points of the first underwater image are. The higher the quality of the underwater image.
[0102] S35. Calculate the image quality of the first target image based on the grayscale mean of the key points and the grayscale difference.
[0103] In this embodiment, considering that the grayscale difference between target pixels and background pixels in an underwater image and the grayscale mean of key points can both represent the quality of the image, the same weight is given to the two to represent the quality of the image.
[0104] Specifically, the image quality calculation formula in this step is as follows:
[0105]
[0106] In the formula, Indicates Image quality of underwater images; Indicates The grayscale mean of the key points of the underwater image; Indicates Grayscale difference of underwater images; Represents the normalization function.
[0107] In the above calculation formula, and The larger the corresponding The larger the value, the The higher the quality of an underwater image, the clearer it can reflect the cracks in the dam foundation. Conversely, the smaller the cracks are, and the worse the quality of the underwater image is, the more turbid the water is.
[0108] Embodiment 3:
[0109] Although the effect of image quality on water turbidity is fully considered in this embodiment 1 or embodiment 2, when the image quality is low, this usually indicates that the turbidity of the water is high. In such turbid water, the sediments are densely distributed and grow relatively fast. In contrast, in high-quality images, the water appears clear and transparent, and the sediments grow relatively slowly. At the same time, it is worth noting that the growth of cracks is not affected by the turbidity of the water. Therefore, the difference between this embodiment and embodiment 1 or embodiment 2 is that this embodiment can further correct the credibility evaluation value of the suspected crack. See Figure 5 In this embodiment, a total of steps Step 1 to Step 6 are included, wherein in Step 5, the credibility evaluation value is corrected according to the change in the area of the suspected crack.
[0110] Step 1: Obtain underwater images at the same location of the water conservancy project in sequence according to preset time intervals.
[0111] Step 2: pre-process all the underwater images and form an image sequence.
[0112] Step 3, calculating the image quality of each underwater image according to the grayscale features of each underwater image.
[0113] Step 4: Based on the image quality of each underwater image and the change of each shadow part in the image sequence over time, the suspected cracks and the credibility evaluation values corresponding to the suspected cracks are confirmed.
[0114] Step 5. Correct the credibility assessment value according to the correlation between the quality data set and the area data set, and update the credibility assessment value to the corrected result. The quality data set is composed of the image quality corresponding to each third target image, and the area data set is composed of the area values of the suspected cracks in each third target image. The third target image is the underwater image where the suspected cracks appear.
[0115] It should be noted that the area data set mentioned above can be obtained through the continuous adaptive mean shift algorithm. First, the continuous adaptive mean shift algorithm is used to obtain the first suspected crack. The connected domain corresponding to each suspected crack in each underwater image after the underwater image where the crack is located is obtained, and the area of the connected domain is obtained, that is, the area data set is obtained.
[0116] Specifically, see Figure 6The process diagram shown in FIG. The figure shows the process of correcting the credibility evaluation value according to the change in the area of the suspected crack, including steps from Step 51 to Step 54. It should be noted that steps from Step 51 to Step 54 are based on the first image in the ith image. A suspected crack is shown as an example.
[0117] Step 51, sort the quality data set and the area data set in time sequence to obtain the image quality sequence and area sequence.
[0118] In this step, the volumes are sorted in chronological order, and the area sequence is recorded as , ; The image quality sequence is recorded as , , Indicates The number of water body images taken after the water body image where the suspected crack is located.
[0119] Step 52: Subtract the adjacent areas in the area sequence and construct an area difference sequence in time sequence. The area difference sequence is recorded as , .
[0120] Step 53: Calculate the Pearson correlation coefficient between the area difference sequence and the image quality sequence .
[0121] It should be noted that the calculation method of the Pearson correlation coefficient is a prior art and is not specifically limited in this embodiment.
[0122] Step 54: Correct the credibility evaluation value based on the Pearson correlation coefficient, and update the credibility evaluation value to the corrected result.
[0123] Among them, the correction formula of the credibility evaluation value is as follows:
[0124]
[0125] In the formula, Indicates The credibility assessment value after the suspected crack is corrected; Indicates The credibility assessment value of the suspected cracks; represents the Pearson correlation coefficient; Represents the normalization function.
[0126] In the above calculation, by using The normalization function will Normalize to Within the range, The smaller the value, The smaller, the The more suspected fractures there are, the more likely they are to belong to sediments.
[0127] Step 6: Determine whether the suspected crack is a crack based on its morphological features and credibility evaluation value; if the suspected crack is a crack, perform anti-leakage treatment on the water conservancy project based on the location information of the suspected crack.
[0128] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous. In addition, in this specification, the terms "first", "second", etc. are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.
[0129] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A method for preventing leakage in a water conservancy project, characterized in that: The method comprises: Sequentially acquiring underwater images at the same location of the water conservancy project at preset time intervals; Preprocessing all the underwater images and forming an image sequence; The image quality of each underwater image is calculated according to the grayscale feature of each underwater image; Based on the image quality of each underwater image and the change of each shadow part in the image sequence over time, confirming the suspected cracks and the credibility evaluation values corresponding to the suspected cracks; Determine whether the suspected crack is a crack according to the morphological characteristics and the credibility evaluation value of the suspected crack, and if the suspected crack is a crack, perform anti-leakage treatment on the water conservancy project according to the location information of the suspected crack; The step of calculating the image quality of each underwater image according to the grayscale feature of each underwater image comprises: Performing threshold division on a first target image to obtain a background area and a foreground area corresponding to the first target image, wherein the first target image is any underwater image in an image sequence; The grayscale difference is calculated based on the grayscale value of the background area and the grayscale value of the foreground area corresponding to the first target image; Extracting key points in the first target image based on a preset key point extraction algorithm, and extracting grayscale values of the key points in at least one first subsequent image in a time sequence, where the first subsequent image is an underwater image taken after the first target image; Calculate the grayscale value of the key point in each first subsequent image to obtain a grayscale mean of the key point; Calculating the image quality of the first target image based on the grayscale mean of the key points and the grayscale difference; The confirming of the suspected cracks and the credibility evaluation values corresponding to the suspected cracks based on the image quality of each underwater image and the change of each shadow part in the image sequence over time includes: Performing threshold division on the second target image to obtain a foreground area corresponding to the second target image, wherein the second target image is any underwater image in the image sequence; At least one connected domain is obtained by dividing the foreground region corresponding to the second target image according to the adjacent states of the pixels; Acquire pixel point coordinates of each connected domain in the second target image one by one to form an initial pixel point coordinate set corresponding to each connected domain; Acquiring pixel point coordinates of each of the connected domains in each second subsequent image one by one to form a pixel point coordinate set sequence corresponding to each of the connected domains, wherein the second subsequent image is an underwater image taken after the second target image; Obtaining a credibility evaluation value corresponding to each connected domain according to the initial pixel point set corresponding to each connected domain, the pixel point set sequence and the image quality corresponding to each second subsequent image; Determine whether each connected domain is a suspected crack according to the credibility evaluation value; The determining whether the suspected crack is a crack according to its morphological characteristics and credibility evaluation value includes: Calculating respectively a first area and a second area of the suspected crack in each third target image, wherein the first area is an enclosed area of the suspected crack, and the second area is a minimum circumscribed rectangular area of the suspected crack, and the third target image is the underwater image where the suspected crack appears; Extracting skeleton lines of suspected cracks in each third target image respectively according to a preset extraction algorithm; Calculate the symmetry evaluation value of each skeleton line separately; The symmetry evaluation value corresponding to each third target image, the credibility evaluation value, the first area, and the second area are used to calculate the crack possibility evaluation value of the suspected crack in each third target image; Calculate the mean of all the crack possibility assessment values to obtain a crack possibility assessment mean; It is determined whether the suspected crack is a crack area according to the crack possibility assessment mean value.
2. The water conservancy project anti-leakage treatment method according to claim 1, characterized in that: Threshold division is performed on the first target image to obtain a background area and a foreground area, including: The underwater image is calculated based on the Otsu method to obtain the optimal threshold; The pixels of the underwater image are divided into a background area and a foreground area based on the optimal threshold, each pixel in the background area is smaller than the optimal threshold, and each pixel in the foreground area is greater than or equal to the optimal threshold.
3. The water conservancy project anti-leakage treatment method according to claim 1, characterized in that: The key point extraction is a process of extracting feature points from the first target image using a scale-invariant feature transformation mathematical model.
4. The water conservancy project anti-leakage treatment method according to claim 1, characterized in that: Based on the image quality of each underwater image and the change of each shadow part in the image sequence over time, the suspected cracks and the credibility evaluation values corresponding to the suspected cracks are confirmed, and then the following is further included: The credibility assessment value is corrected according to the correlation between the quality data set and the area data set, and the credibility assessment value is updated as the corrected result, the quality data set is composed of the image quality corresponding to each third target image, the area data set is composed of the area value of the suspected crack in each third target image, and the third target image is the underwater image where the suspected crack appears.
5. The water conservancy project anti-leakage treatment method according to claim 4, characterized in that: The credibility evaluation value is corrected according to the correlation between the quality data set and the area data set, including: The quality data set and the area data set are sorted in time sequence to obtain image quality sequence and area sequence; Subtract the adjacent areas in the area sequence and form an area difference sequence in time sequence; Calculating the Pearson correlation coefficient between the area difference sequence and the image quality sequence; The credibility evaluation value is corrected based on the Pearson correlation coefficient, and the credibility evaluation value is updated to the corrected result.
6. The water conservancy project anti-leakage treatment method according to claim 1, characterized in that: Calculate the symmetry evaluation value of each skeleton line separately, including: Extracting the normal vector of each point on the skeleton line one by one; Calculate the gradients of all points on each normal vector and sum them up to get the sum vector corresponding to each normal vector; The magnitude of each sum vector is calculated separately and summed to obtain the symmetry evaluation value.
7. The water conservancy project anti-leakage treatment method according to claim 1, characterized in that: The preset time interval is 15 minutes.
