Video-based shallow surface pollution risk identification method and device, equipment and medium

By processing grayscale images of video frame sequences and differentiating risks, the problem of the inability to identify shallow surface pollution risks in existing technologies has been solved, achieving accurate and effective pollution risk identification and improving regulatory efficiency.

CN121661580APending Publication Date: 2026-03-13MINISTRY OF ECOLOGY & ENVIRONMENT CENT FOR SATELLITE APPL ON ECOLOGY ENVIRONMENT
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-07
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies cannot quickly and effectively identify shallow surface pollution risks, especially slow seepage and cumulative pollution, resulting in poor regulatory effectiveness and making it difficult to achieve continuous 24-hour monitoring and accurate identification.

Method used

By acquiring video frame sequences of the target area, we distinguish between areas of gradual change and areas of water stains. Using methods such as grayscale conversion, brightness standard deviation, linear regression fitting, and morphological processing, we identify the pollution risks of areas of gradual change and areas of water stains respectively. Combined with a preset risk classification strategy, we determine the risk level.

Benefits of technology

It achieves accurate identification of random, non-uniform, and cumulative pollution risks while ensuring long-term pollution identification accuracy, thereby improving the level of information-based supervision of pollution prevention and control and reducing algorithm computational complexity and processing latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121661580A_ABST
    Figure CN121661580A_ABST
Patent Text Reader

Abstract

The invention provides a video-based shallow surface pollution risk identification method, apparatus and device, and a medium. The method comprises the steps of obtaining a video frame sequence of a target area; according to the video frame sequence, determining a slow change area and a water stain area; wherein the slowly changing region is used for representing a region where pixel values change gently in the video frame sequence, and the water stain region is used for representing an abnormal point region in the video frame sequence; and respectively carrying out shallow surface pollution risk identification on the slowly changing area and the water stain area to obtain corresponding risk identification results. According to the method, the random non-uniform cumulative pollution risk can be accurately and effectively identified while the long-term pollution identification accuracy is ensured, and the informatization supervision level of pollution prevention and control is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a video-based method, apparatus, equipment, and medium for identifying shallow surface pollution risks. Background Technology

[0002] Improving management capabilities and governance effectiveness has always been a core issue in modern social development. Since the beginning of the 21st century, the rapid development of information technology has provided a powerful impetus for achieving this goal. Among these advancements, video surveillance systems, centered on regulatory platforms, have emerged and been widely applied in various fields such as traffic management, community security, and criminal investigation. Based on this, video image data, due to its intuitive and objective characteristics, has gradually evolved into an important basis for governance decision-making, profoundly changing traditional regulatory models.

[0003] In environmental supervision, particularly in the management of surface pollution, video surveillance technology typically involves deploying high-definition cameras in potentially polluted areas such as critical wastewater outlets, material storage yards, and wastewater pools within the factory area. The captured real-time video streams are transmitted to a monitoring center, where supervisory personnel take turns continuously reviewing the video feed, relying on their visual inspection and experience to detect anomalies such as changes in ground color, liquid leaks, or spilled materials. Furthermore, with the development of artificial intelligence, some intelligent monitoring platforms have been introduced. These platforms, building upon the aforementioned video streams, employ general intelligent analysis algorithms to detect and identify pedestrians and vehicles entering the factory area, or to trigger intrusion alarms in specific areas.

[0004] However, manual review results in high labor costs, and the effectiveness of supervision is limited by the physiological limits and subjective states of personnel, making it difficult to achieve continuous 24-hour monitoring. Furthermore, the human eye is inefficient at recognizing subtle and gradual changes in pollution, resulting in a lack of precision in the monitoring process. In addition, shallow surface pollution, such as the slow leakage and accumulation of oil spills and chemical liquids, often exhibits characteristics of slow and non-abrupt changes, making current deep learning models, which rely on large numbers of labeled samples and primarily learn salient target features, unsuitable for effectively identifying specific pollution phenomena such as leaks and spills. This leads to a significant technological gap and application shortcomings in effectively and accurately identifying and issuing early warnings for such cumulative pollution risks. Summary of the Invention

[0005] This invention provides a video-based method, apparatus, equipment, and medium for identifying shallow surface pollution risks, which addresses the shortcomings of existing technologies in quickly and effectively identifying shallow surface pollution risks. While ensuring the accuracy of long-term pollution identification, it accurately and effectively identifies random, non-uniform, and cumulative pollution risks, thereby improving the level of information-based supervision of pollution prevention and control.

[0006] This invention provides a video-based method for identifying shallow surface pollution risks, comprising: acquiring a video frame sequence of a target area; determining a gradually changing region and a water-stained region based on the video frame sequence; wherein the gradually changing region is used to characterize areas where pixel values ​​change gently in the video frame sequence, and the water-stained region is used to characterize areas of abnormal points in the video frame sequence; and performing shallow surface pollution risk identification on the gradually changing region and the water-stained region respectively to obtain corresponding risk identification results.

[0007] According to the present invention, a video-based method for identifying shallow surface pollution risks determines a gradual change region based on a video frame sequence, comprising: converting each frame of the video image in the video frame sequence into a grayscale image to obtain a grayscale image corresponding to each frame of the video image; determining the brightness standard deviation corresponding to each pixel coordinate based on all frame grayscale images, and filtering pixel coordinates whose brightness standard deviation is less than a first preset brightness threshold to obtain a gradual change region mask; and using the gradual change region mask to perform masking processing on each frame grayscale image to obtain the gradual change region of each frame grayscale image.

[0008] According to the present invention, a video-based method for identifying shallow surface pollution risk is provided for identifying shallow surface pollution risk in a gradually changing area. The method includes: determining the temporal brightness sequence of each first pixel coordinate based on the gradually changing area of ​​each frame of grayscale image; wherein the first pixel coordinate is used to characterize the pixel coordinate located within the gradually changing area, and the temporal brightness sequence includes the pixel value of the corresponding pixel coordinate within the gradually changing area of ​​each frame of grayscale image; performing linear regression fitting on the temporal brightness sequence of each first pixel coordinate to determine the brightness slope and determination coefficient of the corresponding first pixel coordinate; wherein the determination coefficient is used to characterize the goodness of fit of the corresponding linear regression; when the determination coefficient of the first pixel coordinate is greater than a preset confidence threshold, determining the risk level of the corresponding pixel based on the brightness slope of the corresponding first pixel coordinate and a first preset risk classification strategy, thereby obtaining the corresponding risk identification result; wherein the first preset risk classification strategy is generated based on different slope ranges and preset risk levels corresponding to each slope range.

[0009] According to the present invention, a video-based method for identifying shallow surface pollution risks, based on a video frame sequence, determines water stain areas, and further includes: determining the average brightness corresponding to each pixel coordinate based on all frame grayscale images, and performing binarization processing on the corresponding pixel coordinates based on whether the average brightness is less than a second preset brightness threshold to obtain a binarization result of the video frame sequence; wherein the second preset brightness threshold is less than a first preset brightness threshold; performing morphological processing on the binarization result of the video frame sequence, and determining connected components based on the binary image obtained by morphological processing to obtain a water stain area mask; and using the water stain area mask, performing masking processing on each frame grayscale image to obtain the water stain area of ​​each frame grayscale image.

[0010] According to the present invention, a video-based method for identifying shallow surface pollution risks includes the following steps after obtaining the water stain areas in each frame of grayscale images: determining a global average brightness based on the average brightness of each pixel coordinate within the water stain area mask; determining the average brightness of the water stain area in the corresponding frame of grayscale images for each frame of grayscale images; comparing the average brightness of the water stain area in each frame of grayscale images with the global average brightness to obtain the brightness difference between each frame of grayscale images; determining the brightness of each pixel coordinate within the corresponding grayscale image based on the brightness difference being greater than a preset difference threshold, and performing binarization processing on the corresponding grayscale image based on whether the brightness is less than a third preset brightness threshold to obtain the binarization result of the corresponding grayscale image; wherein the third preset brightness threshold is less than a first preset brightness threshold; performing morphological processing on the binarization result of the corresponding grayscale image, and determining the corresponding connected components based on the binarized image obtained by morphological processing to obtain the water stain area of ​​the corresponding frame of grayscale images.

[0011] According to the present invention, a video-based method for identifying shallow surface pollution risks in waterlogged areas includes: determining the number of frames in which each second pixel coordinate appears based on the waterlogged area in each frame of grayscale image; wherein the second pixel coordinate is used to characterize the pixel coordinate located within the waterlogged area, and the number of appearance frames is used to characterize the number of grayscale images in which the corresponding second pixel coordinate is located within the waterlogged area; determining the risk level of the corresponding pixel based on the number of appearance frames of each second pixel coordinate and in conjunction with a second preset risk classification strategy, thereby obtaining the corresponding risk identification result; wherein the second preset risk classification strategy is generated in advance based on different number of appearance frames and a preset risk level corresponding to each number of appearance frames.

[0012] According to the present invention, a method for identifying shallow surface pollution risk based on video involves performing morphological processing on the binarization results of a video frame sequence and determining connected components based on the binarized image obtained from the morphological processing; or, performing morphological processing on the binarization results of a corresponding grayscale image and determining the corresponding connected components based on the binarized image obtained from the morphological processing. The method includes: for the binarization results of the video frame sequence, or for the binarization results of the corresponding grayscale image, traversing each pixel in the corresponding binarization result, aligning the target element in a preset element structure with the currently selected pixel, and performing binarization processing on the currently selected pixel in conjunction with a first preset marking strategy to obtain an updated binarization result; wherein the preset element structure is a matrix pre-configured based on the binarization result, and the first preset marking strategy is used to mark the corresponding currently selected pixel as a first preset value when all pixels covered by the preset element structure are less than a corresponding preset brightness threshold. The process involves several steps: First, if all pixels covered by the preset element structure are not less than the corresponding preset brightness threshold, the currently selected pixel is marked as the second preset value. Then, each pixel in the updated binarized result is traversed, the target element of the preset structure element is aligned with the current pixel, and the current element is marked using the second preset marking strategy to obtain a binary image. The second preset marking strategy is used to mark the current pixel as the third preset value if at least one pixel in all pixels covered by the preset element structure has a first preset value, and to mark the current pixel as the fourth preset value if all pixels covered by the preset element structure have the second preset value. Based on the binary image, when adjacent pixels are all at the third preset value, the corresponding connected component is obtained, and the number of pixels in the corresponding connected component is determined to obtain the area of ​​the corresponding connected component. Finally, based on the area of ​​each connected component, connected components with areas less than a preset area threshold are deleted to obtain the corresponding connected component.

[0013] According to the present invention, a video-based method for identifying shallow surface pollution risk includes a video frame sequence comprising at least two video images. After acquiring the video frame sequence of the target area, the method includes: selecting a reference image and a cleaning calibration point based on the video frame sequence; using the reference image to perform matching correction on the remaining video images in the video frame sequence; and using the cleaning calibration point to calibrate the pixel values ​​of other pixels in each video image frame.

[0014] According to the present invention, a video-based method for identifying shallow surface pollution risks includes selecting a reference image based on a video frame sequence, comprising: converting each video image in the video frame sequence into a grayscale image to obtain a grayscale image corresponding to each video image; determining the Laplacian variance of the corresponding video image based on the grayscale image of each video image, and selecting a preset proportion of video images as candidate frames in descending order of Laplacian variance; obtaining a time-series average image based on the video frame sequence, and performing similarity matching between each candidate frame and the time-series average image, selecting the candidate frame with the highest similarity as the reference image; wherein the pixels in the time-series average image are obtained based on the average pixel value of the corresponding pixel coordinates of all video images in the video frame sequence.

[0015] According to the present invention, a video-based method for identifying shallow surface pollution risks includes selecting clean calibration points based on a video frame sequence. The method comprises: determining the temporal brightness sequence corresponding to each pixel coordinate based on all frame grayscale images, determining the brightness standard deviation of each pixel coordinate, selecting pixel coordinates with a brightness standard deviation less than a first preset threshold to obtain first target pixel coordinates; performing linear regression fitting on the temporal brightness sequence corresponding to each pixel coordinate to obtain the target slope corresponding to each pixel coordinate, and selecting pixels with an absolute value of the target slope less than a second preset threshold to obtain second target pixels; and performing a logical AND operation on the first target pixels and the second target pixels to obtain clean calibration points.

[0016] The present invention also provides a video-based shallow surface pollution risk identification device, comprising: an image acquisition module for acquiring a video frame sequence of a target area; an image recognition module for determining a gradually changing region and a water stain region based on the video frame sequence; wherein the gradually changing region is used to characterize an area in the video frame sequence where pixel values ​​change gently, and the water stain region is used to characterize anomaly point areas in the video frame sequence; and a risk identification module for performing shallow surface pollution risk identification on the gradually changing region and the water stain region respectively, and obtaining corresponding risk identification results.

[0017] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the video-based shallow surface pollution risk identification method as described above.

[0018] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the video-based shallow surface pollution risk identification method as described above.

[0019] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the video-based shallow surface pollution risk identification method as described above.

[0020] The present invention provides a video-based method, apparatus, device, and medium for identifying shallow surface pollution risks. By acquiring video frame sequences of a target area, it is possible to observe the changes in the target area over time and distinguish between gradually changing areas and waterlogged areas. Shallow surface pollution risks are identified separately for these two areas. By identifying the pollution risks that accumulate continuously in the gradually changing areas and the pollution risks that exist in the waterlogged areas in the long term, the accuracy of long-term pollution identification is ensured while accurately and effectively identifying random, non-uniform, cumulative pollution risks. This improves the level of information-based supervision of pollution prevention and control, avoids wasting computing power on irrelevant areas, and reduces the computational complexity and processing delay of the algorithm. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0022] Figure 1 This is one of the flowcharts of the video-based shallow surface pollution risk identification method provided by the present invention; Figure 2 This is the second flowchart of the video-based shallow surface pollution risk identification method provided by the present invention; Figure 3 This is a schematic diagram of the structure of the video-based shallow surface pollution risk identification device provided by the present invention; Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0024] Figure 1 This is a flowchart illustrating the video-based shallow surface pollution risk identification method provided by the present invention, as shown below. Figure 1 As shown, the method includes: S11, Obtain the video frame sequence of the target area; S12, Based on the video frame sequence, determine the gradual change region and the water stain region; wherein, the gradual change region is used to characterize the region in the video frame sequence where the pixel value changes slowly, and the water stain region is used to characterize the abnormal point region in the video frame sequence. S13, shallow surface pollution risk identification was carried out in the gradual change zone and the waterlogged zone respectively, and the corresponding risk identification results were obtained.

[0025] It should be noted that the step numbers "S11-S13" in this manual do not represent the sequential order of the video-based shallow surface pollution risk identification method. The following details will explain further. Figure 2 This invention describes a video-based method for identifying shallow surface pollution risks.

[0026] Step S11: Obtain the video frame sequence of the target area.

[0027] In this embodiment, obtaining the video frame sequence of the target area includes: obtaining video data of the target area; and extracting images from the video data at a preset sampling frequency to obtain the video frame sequence. It should be noted that the preset sampling frequency can be selected based on the actual video length and prior experience, such as collecting video images at noon every day; no further limitations are made here.

[0028] In one alternative embodiment, reference Figure 2 The video frame sequence includes at least two video images; after acquiring the video frame sequence of the target area, the process includes: selecting a reference image and a cleaning calibration point based on the video frame sequence; using the reference image to perform matching correction on the remaining video images in the video frame sequence; and using the cleaning calibration point to calibrate the pixel values ​​of other pixels in each video image.

[0029] It should be noted that the preset feature matching algorithm can be selected according to the actual design requirements, such as the Oriented FAST and Rotated BRIEF (ORB) algorithm or the Scale-Invariant Feature Transform (SIFT) algorithm. No further restrictions are imposed here.

[0030] Specifically, selecting a reference image based on the video frame sequence includes: converting each video image in the video frame sequence into a grayscale image to obtain the grayscale image corresponding to each video image; determining the Laplacian variance of the corresponding video image based on the grayscale image of each video image, and selecting video images of a preset proportion as candidate frames in descending order of Laplacian variance; obtaining a temporal average image based on the video frame sequence, and performing similarity matching between each candidate frame and the temporal average image, selecting the candidate frame with the highest similarity as the reference image; wherein, the pixels in the temporal average image are obtained based on the average pixel value of the corresponding pixel coordinates of all video images in the video frame sequence.

[0031] It should be noted that the video images are filtered by Laplacian variance to remove blurry video images. Furthermore, the selected candidate frames are matched with the temporal average map for similarity to select the video frames that best represent the normal state of the video. This ensures that the reference image is clear while also representing the normal state of the scene, avoiding the selection of clear but poorly lit video frames.

[0032] In addition, based on the video frame sequence, cleaning calibration points are selected, including: determining the temporal brightness sequence corresponding to each pixel coordinate based on all frame grayscale images, determining the brightness standard deviation of each pixel coordinate, selecting pixel coordinates with a brightness standard deviation less than a first preset threshold to obtain the first target pixel coordinates; performing linear regression fitting on the temporal brightness sequence corresponding to each pixel coordinate to obtain the target slope corresponding to each pixel coordinate, and selecting pixels with an absolute value of the target slope less than a second preset threshold to obtain the second target pixels; performing a logical AND operation on the first target pixels and the second target pixels to obtain the cleaning calibration points.

[0033] It should be noted that the stability of pixels over time is measured by the standard deviation of brightness to select stable first target pixels. Then, linear regression is performed on the time-series brightness sequence to determine the pixel change trend based on the corresponding slope, thus selecting second target pixels without obvious long-term change trends. By combining stability and change trends, a logical AND operation is performed on the corresponding target pixels to select pixel coordinates with stable pixel changes and no obvious long-term change trends as cleaning calibration points. This avoids the problem of poor pixel value calibration accuracy caused by spills, leaks, or shallow surface pollution.

[0034] Furthermore, using the reference image, matching correction is performed on the remaining video images in the video frame sequence, including: for each remaining video image in the video frame sequence, using a preset feature matching algorithm to obtain matching point pairs between the remaining video images in the corresponding frame and the reference image; determining the homography transformation matrix of the remaining video images in the corresponding frame relative to the reference image based on the matching point pairs between the remaining video images in the corresponding frame and the reference image; and performing geometric correction on the remaining video images in the corresponding frame based on each homography transformation matrix.

[0035] It should be noted that when the camera position is relatively fixed, the deviation of the video image may not be significant. In this case, the translation and rotation matrix can be determined first based on the camera parameters, and then the image can be corrected using the translation and rotation matrix. The specific image correction method can be selected according to the actual design requirements, and no further restrictions are made here.

[0036] In addition, using the cleaning calibration points, the pixel values ​​of other pixels in each frame of video image are calibrated, including: for each frame of video image, determining the average pixel value of the corresponding cleaning calibration points to obtain the corresponding pixel reference; and using the pixel reference to calibrate other pixels in the corresponding frame of video image.

[0037] Further, the average pixel value of the cleaning calibration points corresponding to each frame of video image is determined to obtain the corresponding pixel reference. This includes: obtaining the pixel reference of the corresponding frame of video image based on the average pixel value of the cleaning calibration points corresponding to each frame of video image, so as to facilitate the subsequent calibration of other pixels in the corresponding video image using the pixel reference corresponding to each frame of video image; or, further determining the average value based on the average pixel value of the cleaning calibration points corresponding to all frames of video image, and using it as the pixel reference to calibrate other pixels in each frame of video image.

[0038] Step S12: Based on the video frame sequence, determine the gradual change region and the water stain region; wherein, the gradual change region is used to characterize the region in the video frame sequence where the pixel value changes gently, and the water stain region is used to characterize the region of abnormal points in the video frame sequence.

[0039] In this embodiment, determining the gradual transition region based on the video frame sequence includes: converting each video image in the video frame sequence into a grayscale image to obtain a grayscale image corresponding to each video image; determining the brightness standard deviation corresponding to each pixel coordinate based on all frame grayscale images, and filtering pixel coordinates with brightness standard deviations less than a first preset brightness threshold to obtain a gradual transition region mask; and using the gradual transition region mask to perform masking processing on each frame grayscale image to obtain the gradual transition region of each frame grayscale image.

[0040] It should be added that the standard deviation of brightness corresponding to each pixel coordinate is expressed as: in, Represents pixel coordinates The corresponding standard deviation of brightness; N represents the total number of frames in the video frame sequence; This represents the pixel value at pixel coordinates (x, y) in the i-th frame of the video image; Represents pixel coordinates The corresponding average brightness; by squaring the difference between the pixel value corresponding to each pixel coordinate and the corresponding average brightness, the negative sign is eliminated and the difference is amplified. All squared differences are summed and averaged to obtain the variance that measures the overall fluctuation. The square root of the variance is then taken to obtain the corresponding standard deviation.

[0041] In addition, the first preset brightness threshold can be configured according to actual design requirements or prior experience, such as 0.02, etc., without further limitation here.

[0042] Further, the pixel coordinates with a brightness standard deviation less than a first preset brightness threshold are selected to obtain a gradual change region mask. This includes marking pixels with a brightness standard deviation less than the first preset brightness threshold as 1 and the rest as 0. In practical applications, the regions with a value of 1 in the gradual change region mask represent areas that are spatially continuous and have a gradual change in brightness over time, such as clean floors or walls. Additionally, the first, third, and fifth preset values ​​described below can be set with reference to value 1, and the second, fourth, and sixth preset values ​​can be set with reference to value 0. The markings of 0 and 1 can also be adjusted according to actual design requirements, such as 1 and 2, etc., only needing to distinguish whether the corresponding pixels meet the threshold conditions; no further limitations are made here.

[0043] Accordingly, when performing masking on each frame of grayscale image using a gradual change region mask, only the pixels marked as 1 are retained as the gradual change region of the corresponding frame video image.

[0044] In an optional embodiment, determining the water stain area based on the video frame sequence further includes: determining the average brightness corresponding to each pixel coordinate based on all frame grayscale images, and performing binarization processing on the corresponding pixel coordinates based on whether the average brightness is less than a second preset brightness threshold to obtain the binarization result of the video frame sequence; wherein the second preset brightness threshold is less than a first preset brightness threshold; performing morphological processing on the binarization result of the video frame sequence, and determining connected components based on the binary image obtained by morphological processing to obtain a water stain area mask; and using the water stain area mask, performing mask processing on each frame grayscale image to obtain the water stain area of ​​each frame grayscale image.

[0045] It should be noted that by determining the average brightness of each pixel coordinate, binarization is performed based on a second preset brightness threshold. This, combined with morphological processing, allows for the rapid generation of a water stain mask, improving computational efficiency. Furthermore, the second preset brightness threshold can be configured according to the actual scene and design requirements; for example, it could be 0.15, etc., without further limitation here.

[0046] Further reference Figure 2 After obtaining the water stain areas in each frame of grayscale images, the process includes: determining the global average brightness based on the average brightness of each pixel coordinate within the water stain area mask; determining the average brightness of the water stain area in the corresponding frame of grayscale images for each frame of grayscale images; comparing the average brightness of the water stain area in each frame of grayscale images with the global average brightness to obtain the brightness difference between each frame of grayscale images; determining the brightness of each pixel coordinate within the corresponding grayscale image based on the brightness difference being greater than a preset difference threshold, and performing binarization processing on the corresponding grayscale image based on whether the brightness is less than a third preset brightness threshold to obtain the binarization result of the corresponding grayscale image; wherein the third preset brightness threshold is less than the first preset brightness threshold; performing morphological processing on the binarization result of the corresponding grayscale image, and determining the corresponding connected components based on the binary image obtained from the morphological processing to obtain the water stain area of ​​the corresponding frame of grayscale images.

[0047] It should be added that, since the water stain area determined by the water stain area mask may deviate from the actual area, the average brightness of the water stain area in each frame grayscale image is further compared with the global average brightness to capture sudden and gradual changes that cannot be detected by the global averaging method. When the brightness difference is determined to be greater than the corresponding threshold, the water stain area of ​​the corresponding frame image is re-determined based on the corresponding grayscale image to achieve dynamic updating of the water stain area.

[0048] In addition, the third preset brightness threshold is less than the second preset brightness threshold. The third preset brightness threshold can be configured according to the actual scenario and design requirements, such as 0.1, etc., without further limitation here.

[0049] Furthermore, based on whether the brightness is less than a third preset brightness threshold, the corresponding grayscale image is binarized, including: marking pixels with brightness less than the third preset brightness threshold as 1, and marking pixels with brightness greater than or equal to the third preset brightness threshold as 0, to obtain the corresponding binarization result.

[0050] In one optional embodiment, morphological processing is performed on the binarization result of the video frame sequence, and connected components are determined based on the binary image obtained from the morphological processing; or, morphological processing is performed on the binarization result of the corresponding grayscale image, and connected components are determined based on the binary image obtained from the morphological processing. This includes: for the binarization result of the video frame sequence, or for the binarization result of the corresponding frame grayscale image, traversing each pixel in the corresponding binarization result, aligning the target element in the preset element structure with the currently selected pixel, and performing binarization processing on the currently selected pixel in conjunction with a first preset marking strategy to obtain an updated binarization result; wherein, the preset element structure is a matrix pre-configured based on the binarization result, and the first preset marking strategy is used to mark the corresponding currently selected pixel as a first preset value when all pixels covered by the preset element structure are less than the corresponding preset brightness threshold, and in the case of preset elements... If all pixels covered by the structure are not less than the corresponding preset brightness threshold, the currently selected pixel is marked as the second preset value. Each pixel in the updated binarized result is traversed, the target element of the preset structure element is aligned with the current pixel, and the current element is marked using the second preset marking strategy to obtain a binary image. The second preset marking strategy is used to mark the current pixel as the third preset value if at least one pixel in all pixels covered by the preset element structure has a first preset value, and to mark the current pixel as the fourth preset value if all pixels covered by the preset element structure have the second preset value. Based on the binary image, when adjacent pixels are all of the third preset value, the corresponding connected component is obtained, and the number of pixels in the corresponding connected component is determined to obtain the area of ​​the corresponding connected component. Based on the area of ​​each connected component, connected components with an area less than a preset area threshold are deleted to obtain the corresponding connected component.

[0051] It should be noted that by aligning the target elements in the preset element structure with the currently selected pixel, and combining the first preset marking strategy to binarize the currently selected pixel, the edges of all objects are eroded and all areas smaller than the preset element structure are eliminated. On this basis, the preset element structure and the second preset marking strategy are further used to expand the boundaries of the remaining objects to restore their size. After opening operations, isolated noise points smaller than the preset element structure are removed, and large, meaningful dark areas are retained, that is, the white areas on the binary image are retained.

[0052] Furthermore, the Two-Pass algorithm or the seed filling algorithm can be used to traverse the binary image. When a pixel has not yet been marked as a connected component and its value is the fifth preset value, it is treated as a new connected component. Starting from that pixel, all pixels adjacent to it with the value of the fifth preset value are found and marked as pixels of the connected component. The remaining image is then scanned until all images have been scanned.

[0053] Step S13: Conduct shallow surface pollution risk identification for the gradual change zone and the waterlogged zone respectively, and obtain the corresponding risk identification results.

[0054] In this embodiment, shallow surface pollution risk identification for gradually changing zones includes: determining the temporal brightness sequence of each first pixel coordinate based on the gradually changing zones of each frame of grayscale image; wherein, the first pixel coordinate is used to characterize the pixel coordinate located within the gradually changing zone, and the temporal brightness sequence includes the pixel value of the corresponding pixel coordinate within the gradually changing zone of each frame of grayscale image; performing linear regression fitting on the temporal brightness sequence of each first pixel coordinate to determine the brightness slope and determination coefficient of the corresponding first pixel coordinate; wherein, the determination coefficient is used to characterize the goodness of fit of the corresponding linear regression; when the determination coefficient of the first pixel coordinate is greater than a preset confidence threshold, determining the risk level of the corresponding pixel based on the brightness slope of the corresponding first pixel coordinate and in combination with a first preset risk classification strategy, thereby obtaining the corresponding risk identification result; wherein, the first preset risk classification strategy is generated in advance based on different slope ranges and preset risk levels corresponding to each slope range.

[0055] It should be noted that for each first pixel coordinate, its temporal brightness sequence can be determined based on the pixel value at the corresponding coordinate position in the video frame sequence.

[0056] Furthermore, the preset risk levels include high risk, medium risk, and low risk, and the first preset risk threshold includes a first gradually changing risk threshold and a second gradually changing risk threshold. Accordingly, based on the slope of the corresponding first pixel coordinates and in conjunction with the first preset risk classification strategy, the risk level of the corresponding pixel is determined, including: determining the corresponding pixel as high risk when the slope of the corresponding first pixel coordinates is greater than or equal to the first gradually changing risk threshold; determining the corresponding pixel as medium risk when the slope of the corresponding first pixel coordinates is less than the first gradually changing risk threshold but greater than the second gradually changing risk threshold; and determining the corresponding pixel as low risk when the slope of the corresponding first pixel coordinates is less than or equal to the second gradually changing risk threshold.

[0057] In addition, before determining that the determination coefficient is greater than the preset confidence threshold, the process includes: determining whether the determination coefficient of the first pixel coordinate is greater than the preset confidence threshold; if the determination coefficient of the first pixel coordinate is greater than the preset confidence threshold, then the corresponding first pixel coordinate is marked as the fifth preset value, otherwise, it is marked as the sixth preset value; based on the marked first pixel coordinates, a binary mask is obtained; based on the first pixel coordinates, the first pixel coordinate with a determination coefficient greater than the preset confidence threshold is selected using the binary mask.

[0058] It should be added that the closer the coefficient of determination is to 1, the more closely the data points cluster around the regression line, and the more reliable and significant the trend is. Therefore, the preset confidence threshold can be set according to the coefficient of determination of the linear regression required in practice. No further restrictions are made here. For example, a preset confidence threshold of 0.6 means that the linear regression can explain more than 60% of the changes in brightness over time.

[0059] In addition, shallow surface pollution risk identification is performed on the water-stained areas, including: determining the number of frames in which each second pixel coordinate appears based on the water-stained areas in each grayscale image; wherein, the second pixel coordinate is used to represent the pixel coordinate located within the water-stained area, and the number of frames in which it appears is used to represent the number of grayscale images in which the corresponding second pixel coordinate is located within the water-stained area; and determining the risk level of the corresponding pixel based on the number of frames in which each second pixel coordinate appears, combined with a second preset risk classification strategy, to obtain the corresponding risk identification result; wherein, the second preset risk classification strategy is generated in advance based on different numbers of frames in which it appears and the preset risk level corresponding to each number of frames in which it appears.

[0060] It should be added that when identifying shallow surface pollution risks in waterlogged areas, the corresponding preset risk level and the risk level of the corresponding pixel can be referred to the above description of shallow surface pollution risk identification in gradually changing areas, which will not be repeated here, so as to realize the shallow surface pollution risk identification in areas where waterlogging has been present for a long time or where waterlogging is frequent.

[0061] It is worth noting that before conducting shallow surface pollution risk identification for the gradual change zone and the waterlogged zone respectively, shallow surface pollution risk identification can be performed in advance based on historical data in the manner described above, and the risk zone can be detected using ground-based rapid detection equipment to verify the accuracy of the risk identification results. In this way, the corresponding algorithm parameters, such as the various thresholds mentioned above, can be adjusted to improve the accuracy of actual risk identification.

[0062] In addition, after identifying shallow surface pollution risks in the gradual change zone and the waterlogged zone, ground-based rapid detection equipment can also be used to detect the risk zone to verify the accuracy of the risk identification results, thereby optimizing the corresponding algorithm parameters online to improve the accuracy of risk identification.

[0063] In summary, the embodiments of the present invention acquire video frame sequences of the target area to observe the changes in the target area over time, and distinguish between gradually changing areas and waterlogged areas. This allows for shallow surface pollution risk identification in both areas. By identifying the continuously accumulating pollution risk in the gradually changing areas and the long-term pollution risk in the waterlogged areas, the invention ensures the accuracy of long-term pollution identification while precisely and effectively identifying random, non-uniform, cumulative pollution risks. This improves the level of information-based supervision for pollution prevention and control, avoids wasting computing power on irrelevant areas, and reduces the computational complexity and processing latency of the algorithm.

[0064] The following describes the video-based shallow surface pollution risk identification device provided by the present invention. The video-based shallow surface pollution risk identification device described below and the video-based shallow surface pollution risk identification method described above can be referred to in correspondence.

[0065] Figure 3 A schematic diagram of a video-based shallow surface pollution risk identification device is shown. The device includes: Image acquisition module 31 acquires a video frame sequence of the target area; The image recognition module 32 determines the gradual change region and the water stain region based on the video frame sequence; wherein, the gradual change region is used to characterize the region where the pixel value changes slowly in the video frame sequence, and the water stain region is used to characterize the abnormal point region in the video frame sequence. The risk identification module 33 performs shallow surface pollution risk identification for the gradual change zone and the waterlogged zone respectively, and obtains the corresponding risk identification results.

[0066] In this embodiment, the image acquisition module 31 includes: a video acquisition unit for acquiring video data of a target area; and an image extraction unit for extracting images from the video data at a preset sampling frequency to obtain a video frame sequence.

[0067] In one optional embodiment, the video frame sequence includes at least two video images; the apparatus further includes: a selection module, which, after acquiring the video frame sequence of the target area, selects a reference image and a cleaning calibration point based on the video frame sequence; an image correction module, which uses the reference image to perform matching correction on the remaining video images in the video frame sequence; and a pixel calibration module, which uses the cleaning calibration point to calibrate the pixel values ​​of other pixels in each video image frame.

[0068] Specifically, the selection module includes: a conversion unit that converts each video image in the video frame sequence into a grayscale image to obtain the grayscale image corresponding to each video image; a candidate frame selection unit that determines the Laplacian variance of the corresponding video image based on the grayscale image of each video image, and selects video images of a preset proportion as candidate frames in descending order of Laplacian variance; and a benchmark determination unit that obtains a time-series average image based on the video frame sequence, performs similarity matching between each candidate frame and the time-series average image, and selects the candidate frame with the highest similarity as the benchmark image; wherein, the pixels in the time-series average image are obtained based on the average pixel value of the corresponding pixel coordinates of all video images in the video frame sequence.

[0069] In addition, the selection module further includes: a first coordinate selection unit, which determines the temporal brightness sequence corresponding to each pixel coordinate based on all frame grayscale images, and determines the brightness standard deviation of each pixel coordinate, and selects pixel coordinates with a brightness standard deviation less than a first preset threshold to obtain the first target pixel coordinates; a second coordinate selection unit, which performs linear regression fitting on the temporal brightness sequence corresponding to each pixel coordinate to obtain the target slope corresponding to each pixel coordinate, and selects pixels with an absolute value of the target slope less than a second preset threshold to obtain the second target pixel; and a calibration point determination unit, which performs a logical AND operation on the first target pixel and the second target pixel to obtain a clean calibration point.

[0070] Furthermore, the image correction module includes: a matching unit, which uses a preset feature matching algorithm to obtain matching point pairs between the remaining video images in each frame of the video frame and the reference image; a deformation determination unit, which determines the homography transformation matrix of the remaining video images in the corresponding frame relative to the reference image based on the matching point pairs between the remaining video images in the corresponding frame and the reference image; and a correction unit, which performs geometric correction on the remaining video images in the corresponding frame based on each homography transformation matrix.

[0071] In addition, the pixel calibration module includes: a pixel reference determination unit, which determines the average pixel value of the corresponding clean calibration point for each frame of video image to obtain the corresponding pixel reference; and a pixel calibration unit, which uses the pixel reference to calibrate other pixels in the corresponding frame of video image.

[0072] Furthermore, the pixel reference determination unit is also used to: obtain the pixel reference of the corresponding video frame based on the average pixel value of the cleaning calibration points corresponding to each video frame, so as to facilitate the subsequent calibration of other pixels in the corresponding video image using the pixel reference corresponding to each video frame; or, further determine the average value based on the average pixel value of the cleaning calibration points corresponding to all video frames, and use it as the pixel reference to calibrate other pixels in each video frame.

[0073] The image recognition module 32 includes: a grayscale image acquisition unit, which converts each frame of video image in the video frame sequence into a grayscale image to obtain the grayscale image corresponding to each frame of video image; a gradual change region mask generation unit, which determines the brightness standard deviation corresponding to each pixel coordinate based on all frame grayscale images, and filters the pixel coordinates whose brightness standard deviation is less than a first preset brightness threshold to obtain a gradual change region mask; and a gradual change region determination unit, which uses the gradual change region mask to perform masking processing on each frame grayscale image to obtain the gradual change region of each frame grayscale image.

[0074] Furthermore, the gradual change region mask generation unit is also used to: mark pixels that are less than a first preset brightness threshold as 1 and the rest as 0, to obtain a gradual change region mask.

[0075] In an optional embodiment, the image recognition module 32 further includes: a binarization processing unit, which determines the average brightness corresponding to each pixel coordinate based on all frame grayscale images, and performs binarization processing on the corresponding pixel coordinates based on whether the average brightness is less than a second preset brightness threshold to obtain the binarization result of the video frame sequence; wherein the second preset brightness threshold is less than a first preset brightness threshold; a water stain area mask generation unit, which performs morphological processing on the binarization result of the video frame sequence, and determines the connected components based on the binary image obtained by morphological processing to obtain the water stain area mask; and a first water stain area determination unit, which performs mask processing on each frame grayscale image using the water stain area mask to obtain the water stain area of ​​each frame grayscale image.

[0076] Furthermore, the image recognition module 32 further includes: a first brightness determination unit, which, after obtaining the water stain area of ​​each frame grayscale image, determines the global average brightness based on the average brightness of each pixel coordinate within the water stain area mask; a second brightness determination unit, which determines the average brightness of the water stain area of ​​the corresponding frame grayscale image for the water stain area of ​​each frame grayscale image; a difference determination unit, which compares the average brightness of the water stain area of ​​each frame grayscale image with the global average brightness to obtain the brightness difference of each frame grayscale image; a binarization processing unit, which determines the brightness of each pixel coordinate within the corresponding grayscale image based on the brightness difference being greater than a preset difference threshold, and performs binarization processing on the corresponding grayscale image based on whether the brightness is less than a third preset brightness threshold to obtain the binarization result of the corresponding grayscale image; wherein the third preset brightness threshold is less than the first preset brightness threshold; and a second water stain area determination unit, which performs morphological processing on the binarization result of the corresponding grayscale image, and determines the corresponding connected components based on the binarized image obtained by morphological processing to obtain the water stain area of ​​the corresponding frame grayscale image.

[0077] Furthermore, the binarization processing unit is used to: mark pixels with brightness less than a third preset brightness threshold as 1, and mark pixels with brightness greater than or equal to the third preset brightness threshold as 0, to obtain the corresponding binarization result.

[0078] In an optional embodiment, the binarization processing unit includes: an erosion subunit, which, for the binarization result of the video frame sequence, or for the binarization result of the corresponding frame grayscale image, traverses each pixel in the corresponding binarization result, aligns the target element in the preset element structure with the currently selected pixel, and performs binarization processing on the currently selected pixel in conjunction with a first preset marking strategy to obtain an updated binarization result; wherein, the preset element structure is a matrix pre-configured based on the binarization result, and the first preset marking strategy is used to mark the corresponding currently selected pixel as a first preset value when all pixels covered by the preset element structure are less than the corresponding preset brightness threshold, and to mark the corresponding currently selected pixel as a second preset value when not all pixels covered by the preset element structure are less than the corresponding preset brightness threshold; and an expansion subunit. The process iterates through each pixel in the updated binarized result, aligns the target element of the preset structuring element with the current pixel, and marks the current element using a second preset marking strategy to obtain a binary image. The second preset marking strategy is used to mark the current pixel as a third preset value when at least one pixel in all pixels covered by the preset structuring element has a first preset value, and to mark the current pixel as a fourth preset value when all pixels covered by the preset structuring element have the second preset value. A connected component determination subunit is used to determine the corresponding connected component when adjacent pixels all have the third preset value, and to determine the number of pixels in the corresponding connected component, thus obtaining the area of ​​the corresponding connected component. A connected component filtering subunit is used to delete connected components with areas smaller than a preset area threshold based on the area of ​​each connected component, thus obtaining the corresponding connected component.

[0079] The risk identification module 33 includes: a brightness sequence determination unit, which determines the temporal brightness sequence of each first pixel coordinate based on the gradual change zone of each frame grayscale image; wherein the first pixel coordinate is used to characterize the pixel coordinate located within the gradual change zone, and the temporal brightness sequence includes the pixel value of the corresponding pixel coordinate within the gradual change zone of each frame grayscale image; a linear fitting unit, which performs linear regression fitting on the temporal brightness sequence of each first pixel coordinate to determine the brightness slope and determination coefficient of the corresponding first pixel coordinate; wherein the determination coefficient is used to characterize the goodness of fit of the corresponding linear regression; and a first risk identification unit, which determines the risk level of the corresponding pixel based on the brightness slope of the corresponding first pixel coordinate and in combination with a first preset risk classification strategy when the determination coefficient of the first pixel coordinate is greater than a preset confidence threshold, thereby obtaining the corresponding risk identification result; wherein the first preset risk classification strategy is generated in advance based on different slope ranges and preset risk levels corresponding to each slope range.

[0080] Furthermore, the preset risk levels include high risk, medium risk, and low risk, and the first preset risk threshold includes a first gradually changing risk threshold and a second gradually changing risk threshold. Accordingly, the first risk identification unit is configured to: determine that the corresponding pixel is high risk when the slope of the corresponding first pixel coordinate is greater than or equal to the first gradually changing risk threshold; determine that the corresponding pixel is medium risk when the slope of the corresponding first pixel coordinate is less than the first gradually changing risk threshold but greater than the second gradually changing risk threshold; and determine that the corresponding pixel is low risk when the slope of the corresponding first pixel coordinate is less than or equal to the second gradually changing risk threshold.

[0081] In addition, the risk identification module 33 also includes: a judgment unit, which determines whether the determination coefficient of the first pixel coordinate is greater than the preset confidence threshold before determining that the determination coefficient is greater than the preset confidence threshold; if the determination coefficient of the first pixel coordinate is greater than the preset confidence threshold, the corresponding first pixel coordinate is marked as the fifth preset value, otherwise, it is marked as the sixth preset value; a binary mask is obtained based on each marked first pixel coordinate; and the first pixel coordinate with a determination coefficient greater than the preset confidence threshold is selected based on each first pixel coordinate using the binary mask.

[0082] In addition, the risk identification module 33 further includes: a frame number determination unit, which determines the number of occurrence frames of each second pixel coordinate based on the water stain area of ​​each frame grayscale image; wherein, the second pixel coordinate is used to represent the pixel coordinate located within the water stain area, and the number of occurrence frames is used to represent the number of grayscale image frames in which the corresponding second pixel coordinate is located within the water stain area; and a second risk identification unit, which determines the risk level of the corresponding pixel based on the number of occurrence frames of each second pixel coordinate and in combination with a second preset risk classification strategy, thereby obtaining the corresponding risk identification result; wherein, the second preset risk classification strategy is generated in advance based on different number of occurrence frames and the preset risk level corresponding to each number of occurrence frames.

[0083] In summary, this embodiment of the invention acquires video frame sequences of the target area through an image acquisition module, enabling observation of the target area's changes over time. An image recognition module distinguishes between gradually changing areas and waterlogged areas, while a risk identification module separately identifies shallow surface pollution risks in these areas. By identifying the continuously accumulating pollution risks in the gradually changing areas and the long-term pollution risks in the waterlogged areas, the invention ensures accurate long-term pollution identification while precisely and effectively identifying random, non-uniform, cumulative pollution risks. This improves the level of information-based supervision for pollution prevention and control, avoids wasting computational resources on irrelevant areas, and reduces the computational complexity and processing latency of the algorithm.

[0084] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4As shown, the electronic device may include a processor 410, a communications interface 420, a memory 430, and a communication bus 440. The processor 410, communications interface 420, and memory 430 communicate with each other via the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute a video-based shallow surface pollution risk identification method. This method includes: acquiring a video frame sequence of a target area; determining a gradually changing region and a water stain region based on the video frame sequence; wherein the gradually changing region is used to characterize areas where pixel values ​​change smoothly in the video frame sequence, and the water stain region is used to characterize abnormal point areas in the video frame sequence; and performing shallow surface pollution risk identification on the gradually changing region and the water stain region respectively to obtain corresponding risk identification results.

[0085] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0086] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the video-based shallow surface pollution risk identification method provided by the above methods. The method includes: acquiring a video frame sequence of a target area; determining a gradually changing area and a water stain area based on the video frame sequence; wherein the gradually changing area is used to characterize an area in the video frame sequence where the pixel value changes gently, and the water stain area is used to characterize an abnormal point area in the video frame sequence; and performing shallow surface pollution risk identification on the gradually changing area and the water stain area respectively to obtain the corresponding risk identification results.

[0087] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is implemented to perform the video-based shallow surface pollution risk identification method provided by the above methods. The method includes: acquiring a video frame sequence of a target area; determining a gradually changing region and a water stain region based on the video frame sequence; wherein the gradually changing region is used to characterize a region in the video frame sequence where pixel values ​​change gently, and the water stain region is used to characterize anomaly point regions in the video frame sequence; and performing shallow surface pollution risk identification on the gradually changing region and the water stain region respectively to obtain corresponding risk identification results.

[0088] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0089] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A video-based method for identifying shallow surface pollution risks, characterized in that, include: Obtain the video frame sequence of the target area; Based on the video frame sequence, a gradual change region and a water stain region are determined; wherein, the gradual change region is used to characterize the area in the video frame sequence where the pixel value changes smoothly, and the water stain region is used to characterize the abnormal point area in the video frame sequence; Shallow surface pollution risk identification was performed on the gradually changing zone and the waterlogged zone respectively, and the corresponding risk identification results were obtained.

2. The video-based shallow surface pollution risk identification method according to claim 1, characterized in that, Based on the video frame sequence, the gradual transition region is determined, including: Each video image in the video frame sequence is converted to a grayscale image to obtain the grayscale image corresponding to each video image. Based on all frame grayscale images, determine the brightness standard deviation corresponding to each pixel coordinate, and filter the pixel coordinates with brightness standard deviation less than the first preset brightness threshold to obtain the gradual change region mask. Using the gradually changing region mask, the grayscale images of each frame are masked to obtain the gradually changing regions of the grayscale images of each frame; The identification of shallow surface pollution risks in the gradually changing zone includes: Based on the gradual change region of the grayscale image in each frame, a temporal brightness sequence of each first pixel coordinate is determined; wherein, the first pixel coordinate is used to characterize the pixel coordinate located in the gradual change region, and the temporal brightness sequence includes the pixel value of the corresponding pixel coordinate in the gradual change region of the grayscale image in each frame. For each of the temporal brightness sequences of the first pixel coordinates, linear regression fitting is performed to determine the brightness slope and coefficient of determination for the corresponding first pixel coordinates; wherein, the coefficient of determination is used to characterize the goodness of fit of the corresponding linear regression. When the determination coefficient of the first pixel coordinate is greater than the preset confidence threshold, the risk level of the corresponding pixel is determined based on the brightness slope of the corresponding first pixel coordinate and combined with the first preset risk classification strategy, and the corresponding risk identification result is obtained; wherein, the first preset risk classification strategy is generated in advance based on different slope ranges and the preset risk level corresponding to each slope range.

3. The video-based shallow surface pollution risk identification method according to claim 2, characterized in that, Determining the water stain area based on the video frame sequence also includes: Based on all frame grayscale images, the average brightness corresponding to each pixel coordinate is determined, and the corresponding pixel coordinates are binarized based on whether the average brightness is less than a second preset brightness threshold to obtain the binarization result of the video frame sequence; wherein, the second preset brightness threshold is less than the first preset brightness threshold. The binarization result of the video frame sequence is subjected to morphological processing, and the connected components are determined based on the binary map obtained by morphological processing to obtain the water stain area mask. Using the water stain area mask, the grayscale images of each frame are masked to obtain the water stain areas of each frame's grayscale image.

4. The video-based shallow surface pollution risk identification method according to claim 3, characterized in that, After obtaining the water stain areas in the grayscale images of each frame, the process includes: The global average brightness is determined based on the average brightness of each pixel coordinate within the water stain area mask. For the water stain area in the grayscale image of each frame, determine the average brightness of the water stain area in the corresponding frame's grayscale image; The average brightness of the water stain area in each frame of the grayscale image is compared with the global average brightness to obtain the brightness difference of each frame of the grayscale image; Based on the brightness difference being greater than a preset difference threshold, the brightness of each pixel coordinate in the corresponding grayscale image is determined, and based on whether the brightness is less than a third preset brightness threshold, the corresponding grayscale image is binarized to obtain the binarization result of the corresponding grayscale image; wherein, the third preset brightness threshold is less than the first preset brightness threshold. The binarization result of the corresponding grayscale image is subjected to morphological processing, and based on the binary image obtained by morphological processing, the corresponding connected components are determined to obtain the water stain area of ​​the corresponding frame grayscale image. The shallow surface pollution risk identification for the waterlogged area includes: Based on the water stain area in each frame of the grayscale image, the number of frames in which each second pixel coordinate appears is determined; wherein, the second pixel coordinate is used to represent the pixel coordinate located within the water stain area, and the number of frames in which the corresponding second pixel coordinate is located within the water stain area is used to represent the number of grayscale image frames in which the corresponding second pixel coordinate is located within the water stain area. Based on the number of frames in which each of the second pixel coordinates appears, and in conjunction with the second preset risk classification strategy, the risk level of the corresponding pixel is determined, and the corresponding risk identification result is obtained; wherein, the second preset risk classification strategy is generated in advance based on different number of occurrence frames and the preset risk level corresponding to each number of occurrence frames.

5. The video-based shallow surface pollution risk identification method according to claim 3 or 4, characterized in that, Morphological processing is performed on the binarized result of the video frame sequence, and connected components are determined based on the binary image obtained from the morphological processing; alternatively, morphological processing is performed on the binarized result of the corresponding grayscale image, and connected components are determined based on the binary image obtained from the morphological processing, including: For the binarization result of the video frame sequence, or for the binarization result of the corresponding frame grayscale image, traverse each pixel in the corresponding binarization result, align the target element in the preset element structure with the currently selected pixel, and perform binarization processing on the currently selected pixel in conjunction with the first preset marking strategy to obtain the updated binarization result; wherein, the preset element structure is a matrix pre-configured based on the binarization result, and the first preset marking strategy is used to mark the corresponding currently selected pixel as a first preset value when all pixels covered by the preset element structure are less than the corresponding preset brightness threshold, and to mark the corresponding currently selected pixel as a second preset value when not all pixels covered by the preset element structure are less than the corresponding preset brightness threshold; Traverse each pixel in the updated binarization result, align the target element of the preset structural element with the current pixel, and mark the current element in combination with the second preset marking strategy to obtain a binary image; wherein, the second preset marking strategy is used to mark the current pixel as the third preset value when at least one pixel in all pixels covered by the preset element structure has the first preset value, and to mark the current pixel as the fourth preset value when all pixels covered by the preset element structure have the second preset value; Based on the binary image, when it is determined that all adjacent pixels are the third preset value, the corresponding connected component is obtained, and the number of pixels in the corresponding connected component is determined, and the area of ​​the corresponding connected component is obtained. Based on the area of ​​each connected component, connected components with an area smaller than a preset area threshold are deleted to obtain the corresponding connected components.

6. The video-based shallow surface pollution risk identification method according to claim 1, characterized in that, The video frame sequence includes at least two video images; After acquiring the video frame sequence of the target area, the following is included: Based on the video frame sequence, a reference image and a cleaning calibration point are selected; Using the reference image, the remaining video frames in the video frame sequence are matched and corrected. Using the cleaning calibration points, pixel values ​​are calibrated for other pixels in each frame of the video image.

7. The video-based shallow surface pollution risk identification method according to claim 6, characterized in that, Based on the video frame sequence, a reference image is selected, including: Each video image in the video frame sequence is converted to a grayscale image to obtain the grayscale image corresponding to each video image. Based on the grayscale image of each frame of the video image, determine the Laplacian variance of the corresponding frame of the video image, and select video images of a preset proportion as candidate frames in descending order of Laplacian variance. Based on the video frame sequence, a temporal average map is obtained, and each candidate frame is matched with the temporal average map for similarity. The candidate frame with the highest similarity is selected as the reference image. The pixels in the temporal average map are obtained based on the average pixel value of the corresponding pixel coordinates of all video images in the video frame sequence. Based on the video frame sequence, clean calibration points are selected, including: Based on all frame grayscale images, determine the temporal brightness sequence corresponding to each pixel coordinate, and determine the brightness standard deviation of each pixel coordinate. Select pixel coordinates with brightness standard deviation less than a first preset threshold to obtain the first target pixel coordinates. For each of the pixel coordinates, a linear regression fit is performed to obtain the target slope corresponding to each pixel coordinate, and the pixel whose absolute value of the target slope is less than the second preset threshold is selected to obtain the second target pixel; Perform a logical AND operation on the first target pixel and the second target pixel to obtain the cleaning calibration point.

8. A video-based shallow surface pollution risk identification device, characterized in that, include: The image acquisition module acquires a sequence of video frames from the target area. The image recognition module determines the gradual change region and the water stain region based on the video frame sequence; wherein, the gradual change region is used to characterize the area in the video frame sequence where the pixel value changes smoothly, and the water stain region is used to characterize the abnormal point area in the video frame sequence; The risk identification module performs shallow surface pollution risk identification on the gradually changing zone and the waterlogged zone respectively, and obtains the corresponding risk identification results.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the video-based shallow surface pollution risk identification method as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the video-based shallow surface pollution risk identification method as described in any one of claims 1 to 7.