Dam bank danger video detection method and system based on real-time image edge enhancement
Through real-time image edge enhancement processing and database matching, the problem of poor reliability of the dam bank dangerous situation inspection system is solved, the dangerous situation is accurately identified, the false alarm rate is reduced, and the dangerous situation detection efficiency is improved.
Patent Information
- Application Number
- CN202111471602.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-06
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-12-06
AI Technical Summary
The existing dam bank dangerous situation inspection system has poor reliability and is prone to false alarms. The efficiency of manual inspection at night is low, resulting in late detection of dangerous situations.
A video detection method based on real-time image edge enhancement is used to obtain monitoring images for grayscale, geometric transformation, edge enhancement and fusion processing, and then match historical images in the database to determine the danger level of the dam bank and reduce the false alarm rate.
It improves the reliability of dam bank dangerous situation inspections, accurately identifies dangerous situations, reduces false alarm rates, shortens the time for dangerous situation detection, and provides guarantee for emergency rescue.
Smart Images

Figure CN114359149B
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of dam bank danger monitoring, and in particular to a dam bank danger video detection method and system based on real-time image edge enhancement. Background Art
[0002] The Yellow River Basin has more precipitation during the flood season, and there is a high possibility of heavy rain and floods in the middle and upper reaches of the Yellow River, and floods occur from time to time. In the face of floods, the traditional method of manual inspection of dams has the following disadvantages: low efficiency, untimely discovery of dangerous conditions, especially at night when it is difficult for manual inspections to detect dangerous conditions of dams. The occurrence of dangerous conditions in dams is often accompanied by partial collapse of the dam body, and the entire dam body will be destroyed in a very short time. In the face of the limitations of the above-mentioned manual dam inspections, the existing solution is to arrange sensors on the dam bank through the Sky Eye River Inspection System, and the Sky Eye camera will capture the dangerous conditions of the dam body in time, but this system has the following disadvantages: due to the complex environment of the dam body, a small vibration can trigger the sensor to send a signal, and the system often prompts false alarms that dangerous conditions have occurred but the dam body is safe and sound, and the reliability is poor. Summary of the invention
[0003] The object of the present invention is to provide a dam bank danger video detection method and system based on real-time image edge enhancement, which is used to solve the problem of poor reliability of existing dam bank danger inspection.
[0004] In order to solve the above technical problems, the present invention provides a dam bank danger video detection method based on real-time image edge enhancement, comprising the following steps:
[0005] Obtain N monitoring images of the monitoring dam bank, perform grayscale processing on each monitoring image, and obtain a grayscale image of each monitoring image;
[0006] Performing geometric transformation and difference filling processing on each grayscale image respectively to obtain each corrected grayscale image;
[0007] Performing edge enhancement processing on each corrected grayscale image to obtain each edge feature enhanced image;
[0008] Perform fusion processing on each edge feature enhanced image to obtain a multi-scale fused image;
[0009] The multi-scale fusion image is matched with the historical images stored in the database, and the danger level of the monitored dam bank is determined based on the matching results.
[0010] Furthermore, the weighted average method is used to grayscale each monitoring image.
[0011] Furthermore, the process of performing geometric transformation and difference filling processing on each grayscale image includes:
[0012] Perform translation, transposition, mirroring, rotation and scaling processing on each grayscale image to obtain each grayscale image processed by geometric transformation;
[0013] The cubic convolution interpolation method is used to perform grayscale difference on each grayscale image processed by geometric transformation to obtain each corrected grayscale image.
[0014] Furthermore, the step of performing edge enhancement processing on each corrected grayscale image includes:
[0015] Performing Gaussian filtering to reduce noise on each corrected grayscale image to obtain each Gaussian filtered smoothed image;
[0016] Performing gradient detection on each Gaussian filter smoothed image respectively to obtain the gradient amplitude of each pixel in each Gaussian filter smoothed image;
[0017] The non-maximum value of the gradient amplitude of each pixel in each Gaussian filter smoothed image is suppressed to obtain each initial edge feature enhanced image;
[0018] The double threshold algorithm is used to process the initial edge feature enhanced images to obtain the final edge feature enhanced images.
[0019] Furthermore, the step of fusing the edge feature enhanced images includes:
[0020] Performing local detail Gaussian blur processing on each edge feature enhanced image respectively to obtain a Gaussian blurred image corresponding to each edge feature enhanced image;
[0021] According to each edge feature enhanced image and the Gaussian blurred image corresponding to each edge feature enhanced image, each local image corresponding to each edge feature enhanced image is obtained;
[0022] A multi-scale fused image is obtained according to each local image corresponding to each edge feature enhanced image and each edge feature enhanced image.
[0023] Furthermore, the calculation formula corresponding to the local detail Gaussian blur processing of each edge feature enhanced image is:
[0024] U i =V i U 0
[0025] Among them, U i is the i-th Gaussian blurred image corresponding to the edge feature enhanced image, V i The i-th Gaussian kernel used for local detail Gaussian blur processing, i = 1, 2, 3, U 0 Enhance images for edge features.
[0026] Furthermore, the calculation formula corresponding to the multi-scale fusion image is obtained as follows:
[0027] N 4 =(1-ω 1 sgn(N 1 ))N 1 +ω 2 N 2 +ω 3 N 3
[0028]
[0029] N=N 4 +U 0
[0030] Among them, N 4 is the intermediate fusion image, N 1 、N 2 、N 3 is the local image corresponding to the edge feature enhanced image, ω 1 ,ω 2 ,ω 3 are local images N 1 、N 2 、N 3 The weight of , sgn is the sign function, g(x, y) is the gray value of the pixel (x, y), N is the multi-scale fusion image, U 0 Enhance images for edge features.
[0031] Further, the step of determining the danger level of the monitored dam bank according to the matching result includes:
[0032] If the matching result is greater than the first matching similarity threshold, the monitored dam bank is determined to be at the first level of danger;
[0033] If the matching result is not greater than the first matching similarity threshold and not less than the second matching similarity threshold, the monitored dam bank is determined to be at the second-level dangerous level;
[0034] If the matching result is less than the second matching similarity threshold, the monitored dam bank is determined to be at the third level of danger;
[0035] The danger levels of the first danger level, the second danger level and the third danger level increase in sequence.
[0036] The present invention also provides a dam bank danger video detection system based on real-time image edge enhancement, comprising a processor and a memory, wherein the processor is used to process instructions stored in the memory to implement the above-mentioned dam bank danger video detection method based on real-time image edge enhancement.
[0037] The present invention has the following beneficial effects: the present invention obtains monitoring images of the dam bank, processes the monitoring images to finally obtain a multi-scale fusion image, matches the multi-scale fusion image with each historical image stored in the database, and thus determines the danger level of the monitored dam bank. The present invention can accurately identify the danger situation of the dam bank, effectively reduce the probability of false alarm of danger, and improve the reliability of dam bank danger inspection. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] 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.
[0039] Figure 1 It is a flow chart of the dam bank danger video detection method based on real-time image edge enhancement of the present invention;
[0040] Figure 2 Schematic diagram of cubic convolution interpolation of the present invention;
[0041] Figure 3 A flow chart of obtaining each edge feature enhanced image of the present invention;
[0042] Figure 4 Schematic diagram of gradient direction segmentation of the present invention. DETAILED DESCRIPTION
[0043] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the technical solutions proposed by the present invention are described in detail below 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.
[0044] 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.
[0045] This embodiment provides a dam bank danger video detection method based on real-time image edge enhancement, and the corresponding flow chart is as follows: Figure 1 As shown, the following steps are included:
[0046] (1) Obtain N monitoring images of the dam bank, perform grayscale processing on each monitoring image, and obtain a grayscale image of each monitoring image.
[0047] The dam bank camera is used to scan and record the dam bank, and N monitoring images of the dam bank at different times are obtained. Then the weighted average method is used to grayscale each monitoring image, and the color monitoring image is converted into a grayscale image. The weighted average method uses different weights to calculate the different colors of the RGB three channels in the image, and filters out irrelevant information in the color. For example, the grass on the dam bank appears green. Here, the environmental information irrelevant to the dam bank needs to be lowered accordingly; in the case of foggy weather, the weights of red and green need to be increased. In this way, only the edge features of the dam bank are focused. The corresponding calculation formula is:
[0048] B′(i,j)=xR(i,j)+yG(i,j)+zB(i,j)
[0049] Among them, R(i, j) is the red grayscale value of the pixel at position (i, j) in the monitoring image, G(i, j) is the green grayscale value of the pixel at position (i, j) in the monitoring image, B(i, j) is the blue grayscale value of the pixel at position (i, j) in the monitoring image, x, y, z are the weights corresponding to red, green and blue respectively, and B′(i, j) is the grayscale value of the pixel at position (i, j) in the grayscale image.
[0050] Grayscale processing of each monitoring image can help highlight the edge features of the dam bank and weaken environmental information irrelevant to the edge of the dam bank.
[0051] (2) Performing geometric transformation and difference filling processing on each grayscale image to obtain each corrected grayscale image. The specific implementation steps include:
[0052] (2-1) Each grayscale image is translated, transposed, mirrored, rotated, and scaled to obtain a grayscale image processed by geometric transformation.
[0053] Because of the errors in camera angle and surrounding environment, in order to avoid errors when comparing subsequent new images with historical images in the database, it is necessary to perform operations such as translation, transposition, mirroring, rotation, and scaling on the images to align the coordinates, so as to obtain grayscale images processed by geometric transformation.
[0054] (2-2) The cubic convolution interpolation method is used to perform grayscale interpolation on each grayscale image processed by the geometric transformation to obtain each corrected grayscale image.
[0055] For each grayscale image processed by geometric transformation, the cubic convolution interpolation method in the grayscale interpolation algorithm is used to perform grayscale difference to correct the image and improve the accuracy of image comparison in the next stage.
[0056] Among them, the principle of the cubic convolution interpolation algorithm is: in order to determine the gray value of the mapping point P in the original image, such as Figure 2 , collect information of 16 points (Aii, 0≤i≤3, 0≤j≤3) around P, calculate the weights of these 16 points through BiCubi function according to the distances of these 16 points from P in the X and Y directions, multiply the gray value of each point by the corresponding weight, and the sum is the gray value of P.
[0057] The mathematical formula of the BiCubi function is as follows:
[0058]
[0059] Among them, H(x) is the weight, x is the horizontal distance between point P and the 16 points, and n is a parameter, which is generally -0.5 or -0.75.
[0060] (3) Perform edge enhancement processing on each corrected grayscale image to obtain each edge feature enhanced image. The corresponding flow chart is as follows: Figure 3 As shown, the specific implementation steps include:
[0061] (3-1) Perform Gaussian filtering to reduce noise on each corrected grayscale image to obtain a Gaussian filtered smoothed image.
[0062] Because the edge detection result is highly sensitive to image noise, a two-dimensional Gaussian function is used to reduce the noise of each corrected grayscale image to achieve the effect of enhancing the spatial domain edge of the image and deepen the edge features of the image bank. The formula of the two-dimensional Gaussian function is as follows:
[0063]
[0064] Where Z(x, y) is the grayscale value of the pixel at the coordinate (x, y) in the Gaussian filter smoothed image, and σ is the standard deviation.
[0065] (3-2) Perform gradient detection on each Gaussian filtered smoothed image to obtain the gradient amplitude of each pixel in each Gaussian filtered smoothed image.
[0066] The edge corresponds to the change of pixel intensity. The most common method is to highlight this intensity change in the horizontal and vertical directions through filters. In this embodiment, the gradient dx and dy are calculated by convolution of the image in the horizontal and vertical directions through edge difference operators. The corresponding formulas are as follows:
[0067]
[0068]
[0069] Among them, A is the original image, that is, the 3*3 matrix of the Gaussian filter smoothed image, d x ,d y are the gradients in the horizontal and vertical directions respectively.
[0070] Furthermore, the magnitude M(x, y) and direction θ of the image pixel gradient can be obtained, and the corresponding formula is as follows:
[0071] M(x, y) = |d x |+|d y |
[0072]
[0073] (3-3) Non-maximum suppression is performed on the gradient amplitude of each pixel in each Gaussian filtered smoothed image to obtain the initial edge feature enhanced images.
[0074] According to the image pixel gradient direction calculated in the above step (3-2), the extreme points in the image are enhanced along this direction, and the grayscale value is set to 255, and the grayscale value of non-extreme points is set to 0. In implementation, the gradient direction segmentation is as follows Figure 4 As shown in the figure, the center gray value position is divided into 4 directions, θ∈[45,90) and θ∈[225,270) are direction 1; θ∈[0,45) and θ∈[180,225) are direction 2; θ∈[315,360) and θ∈[135,180) are direction 3; θ∈[270,315) and θ∈[90,135) are direction 4. The gradient strength of the current pixel is compared with the two pixels along the positive and negative gradient directions. If the pixel value is larger than both pixels, the pixel can be considered as an edge point and retained.
[0075] (3-4) The initial edge feature enhanced images are processed using a double threshold algorithm to obtain the final edge feature enhanced images.
[0076] The dual threshold algorithm is used to detect and lag edge tracking on the initial edge feature enhanced images, which includes three steps: (a) for the pixel points in the image whose grayscale value is higher than the high threshold, the grayscale value is assigned to 255; (b) for the pixel points in the image whose grayscale value is lower than the low threshold, the grayscale value is assigned to 0; (c) for the pixel points in the image whose grayscale value is between the low threshold and the high threshold, the calculation is tested to see whether the pixel point is connected to the high threshold point. If so, the grayscale value of this point is assigned to 255.
[0077] (4) The edge feature enhanced images are fused to obtain a multi-scale fused image.
[0078] For each final edge feature enhanced image obtained through the above step (3), a multi-scale feature fusion strategy is used to extract the feature set in each image, and feature fusion is performed to retain the dangerous features of the original dam bank image as much as possible. The specific implementation steps include:
[0079] (4-1) Perform local detail Gaussian blur processing on each edge feature enhanced image to obtain the Gaussian blurred image corresponding to each edge feature enhanced image. The corresponding calculation formula is:
[0080] U i =V i U 0
[0081] Among them, U i is the i-th Gaussian blurred image corresponding to the edge feature enhanced image, V i The i-th Gaussian kernel used for local detail Gaussian blur processing, i = 1, 2, 3, set to 1.0, 2.0, 4.0 respectively, U 0 Enhance images for edge features.
[0082] (4-2) Subtracting each edge feature enhanced image and the Gaussian blurred image corresponding to each edge feature enhanced image to obtain each local image corresponding to each edge feature enhanced image. The corresponding calculation formula is:
[0083] N j+1 =U j -U j+1
[0084] Among them, N j+1 is the j+1th local image, that is, the details of different images are subtracted to obtain different local image data, j=0, 1, 2, when j=0, U j For edge feature enhanced images, when j = 1, 2, U j is a Gaussian blurred image.
[0085] (4-3) A multi-scale fused image is obtained based on each local image corresponding to each edge feature enhanced image and each edge feature enhanced image.
[0086] Among them, different local image data are spliced and fused through feature fusion to enhance the image edge details. The corresponding calculation formula is:
[0087] N 4 =(1-ω 1 sgn(N 1 ))N 1 +ω 2 N 2 +ω 3 N3
[0088]
[0089] N=N 4 +U 0
[0090] Among them, N 4 is the intermediate fusion image, N 1 、N 2 、N 3 is the local image corresponding to the edge feature enhanced image, ω 1 ,ω 2 ,ω 3 are local images N 1 、N 2 、N 3 The weights are set to 0.4, 0.4, and 0.3 respectively, sgn is the sign function, g(x, y) is the gray value of the pixel (x, y), N is the multi-scale fusion image, that is, the image after multi-scale fusion, U 0 Enhance images for edge features.
[0091] (5) Match the multi-scale fusion image with the historical images stored in the database, and determine the hazard level of the monitored dam bank based on the matching results.
[0092] The cosine similarity algorithm is used to match the multi-scale fusion image with each historical image stored in the database to obtain a matching result, that is, a matching probability value. The matching probability value is compared with the first matching similarity threshold and the second matching similarity threshold to obtain the hazard level of the monitored dam bank. If the matching result is greater than the first matching similarity threshold, the monitored dam bank is judged to be at the first hazard level; if the matching result is not greater than the first matching similarity threshold and not less than the second matching similarity threshold, the monitored dam bank is judged to be at the second hazard level; if the matching result is less than the second matching similarity threshold, the monitored dam bank is judged to be at the third hazard level. The hazard levels of the first hazard level, the second hazard level, and the third hazard level increase in sequence.
[0093] In this embodiment, the first matching similarity threshold is set to 95%, and the second matching similarity threshold is set to 85%. When the matching probability value exceeds 95%, it is considered that the danger level of the dam bank is a general danger; when the matching probability value is between 85% and 95%, it is considered that the danger level of the dam bank is a large danger; when the matching probability value is below 85%, it is considered that the danger level of the dam bank is a major danger.
[0094] This embodiment also provides a dam bank danger video detection system based on real-time image edge enhancement, including a processor and a memory, wherein the processor is used to process instructions stored in the memory to implement the above-mentioned dam bank danger video detection method based on real-time image edge enhancement. Since the dam bank danger video detection method based on real-time image edge enhancement has been described in detail in the above content, it will not be repeated here.
[0095] The present invention arranges sensors on the dam bank and uses the Sky Eye camera to timely capture the dangerous situation of the dam body, calculates and analyzes the dam body information, and then divides the dangerous situation into levels, which effectively reduces the probability of false alarms of dangerous situations, shortens the time for discovering dangerous situations, and provides time guarantee for subsequent rescue operations.
[0096] It should be noted that the sequence of the embodiments of the present invention described above is for description only and does not represent the advantages and disadvantages of the embodiments. The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the 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.
[0097] 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.
[0098] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A dam bank danger video detection method based on real-time image edge enhancement, characterized in that: The following steps are involved: Obtain N monitoring images of the monitoring dam bank, perform grayscale processing on each monitoring image, and obtain a grayscale image of each monitoring image; Performing geometric transformation and difference filling processing on each grayscale image respectively to obtain each corrected grayscale image; Performing edge enhancement processing on each corrected grayscale image to obtain each edge feature enhanced image; Perform fusion processing on each edge feature enhanced image to obtain a multi-scale fused image; Match the multi-scale fusion image with the historical image stored in the database, and determine the danger level of the monitored dam bank based on the matching results; The steps of performing edge enhancement processing on each corrected grayscale image include: Performing Gaussian filtering to reduce noise on each corrected grayscale image to obtain each Gaussian filtered smoothed image; Performing gradient detection on each Gaussian filter smoothed image respectively to obtain the gradient amplitude of each pixel in each Gaussian filter smoothed image; The non-maximum value of the gradient amplitude of each pixel in each Gaussian filter smoothed image is suppressed to obtain each initial edge feature enhanced image; The initial edge feature enhanced images are processed using a double threshold algorithm to obtain the final edge feature enhanced images; The steps of fusing each edge feature enhanced image include: Performing local detail Gaussian blur processing on each edge feature enhanced image respectively to obtain a Gaussian blurred image corresponding to each edge feature enhanced image; According to each edge feature enhanced image and the Gaussian blurred image corresponding to each edge feature enhanced image, each local image corresponding to each edge feature enhanced image is obtained; A multi-scale fused image is obtained according to each local image corresponding to each edge feature enhanced image and each edge feature enhanced image.
2. The dam bank danger video detection method based on real-time image edge enhancement according to claim 1 is characterized in that: The weighted average method is used to grayscale each monitoring image.
3. The dam bank danger video detection method based on real-time image edge enhancement according to claim 1 is characterized in that: The process of performing geometric transformation and difference filling processing on each grayscale image includes: Perform translation, transposition, mirroring, rotation and scaling processing on each grayscale image to obtain each grayscale image processed by geometric transformation; The cubic convolution interpolation method is used to perform grayscale difference on each grayscale image processed by geometric transformation to obtain each corrected grayscale image.
4. The dam bank danger video detection method based on real-time image edge enhancement according to claim 1 is characterized in that: The corresponding calculation formula for performing local detail Gaussian blur processing on each edge feature enhanced image is: U i =V i U0 Among them, U i is the i-th Gaussian blurred image corresponding to the edge feature enhanced image, V i It is the i-th Gaussian kernel used for local detail Gaussian blur processing, i=1,2,3, and U0 is the edge feature enhanced image.
5. The dam bank danger video detection method based on real-time image edge enhancement according to claim 4 is characterized in that: The calculation formula corresponding to the multi-scale fusion image is: Among them, N4 is the intermediate fused image, N1, N2, and N3 are the local images corresponding to the edge feature enhanced image, ω1, ω2, and ω3 are the weights of the local images N1, N2, and N3 respectively, sgn is the sign function, g(x, y) is the grayscale value of the pixel point (x, y), N is the multi-scale fused image, and U0 is the edge feature enhanced image.
6. The dam bank danger video detection method based on real-time image edge enhancement according to claim 1 is characterized in that: The steps of determining the danger level of the monitored dam bank according to the matching results include: If the matching result is greater than the first matching similarity threshold, the monitored dam bank is determined to be at the first level of danger; If the matching result is not greater than the first matching similarity threshold and not less than the second matching similarity threshold, the monitored dam bank is determined to be at the second-level dangerous level; If the matching result is less than the second matching similarity threshold, the monitored dam bank is determined to be at the third level of danger; The danger levels of the first danger level, the second danger level and the third danger level increase in sequence.
7. A dam bank danger video detection system based on real-time image edge enhancement, characterized in that: The method comprises a processor and a memory, wherein the processor is used to process instructions stored in the memory to implement a dam bank danger video detection method based on real-time image edge enhancement as described in any one of claims 1 to 6.
