Method for identifying density of floating objects on water surface based on image
By using the RTK drone in the water surface floating objects for spatial calibration and large models for floating object recognition, calculating floating objects accounting for the area, solving the problem that the existing technology is difficult to quantify the dense of floating objects, and realizes the dense floating objects dense Effective quantitative assessment and timely processing.
Patent Information
- Application Number
- CN202411380617.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-09-30
AI Technical Summary
The existing water surface floating object monitoring technology based on image recognition is difficult to effectively quantify the density of floating objects, resulting in the problem that if there are fewer floating objects, and only a large number of floating objects need to be disposed of.
Adopt image -based recognition methods, use the RTK drone for space calibration to determine the water level area and water level calibration point, combined with large models for floating objects and surface recognition, calculate the current water surface floating material monitoring plane area at the current high range of water level highs, The proportion of floating objects in it can achieve quantitative assessment of floating object density.
The effective quantitative assessment of floating object density is achieved, the accuracy and efficiency of monitoring are improved, the timely treatment of floating objects is ensured, and the water environment and ecological balance are protected.
Smart Images

Figure CN118887572B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image processing, and in particular relates to a method for identifying the density of floating objects on a water surface based on images. Background Art
[0002] With the acceleration of global urbanization and the increase of industrial activities, water pollution is becoming increasingly serious, among which pollution caused by floating objects on the water surface is particularly prominent. Floating objects on the water surface mainly include various types of garbage, plant residues, etc. They not only seriously affect the beauty of the water body, but also may pollute the water quality, endanger the living environment of aquatic organisms, and even threaten the safety of human water. Therefore, effective monitoring and management of floating objects on the water surface has become an important task for environmental protection and water governance.
[0003] Traditional methods for monitoring floating objects on the water surface mainly rely on manual inspections, which is not only inefficient but also difficult to achieve real-time and comprehensive monitoring. With the advancement of science and technology, especially the development of image processing technology and computer vision technology, methods for monitoring floating objects on the water surface based on image recognition have gradually attracted attention.
[0004] At present, some surface floating object monitoring technologies based on image recognition have been developed and applied. These technologies usually use cameras installed around the water area to capture the water surface in real time, and automatically identify and monitor surface floating objects through image recognition algorithms. However, most of these methods focus on the identification and classification of floating objects, and lack effective quantitative evaluation of the density of floating objects.
[0005] Therefore, it is particularly important to develop a method that can accurately and real-time monitor the density of floating objects on the water surface. This method can not only provide strong technical support for environmental protection and water management, but also help relevant departments take timely measures to clean up and deal with floating objects, maintain water quality and environment, and ensure the ecological balance of water bodies and the safety of human water use. Summary of the invention
[0006] The present invention provides a method for identifying the density of floating objects on the water surface based on images to solve the above-mentioned technical problems, and specifically adopts the following technical solutions:
[0007] A method for identifying the density of floating objects on a water surface based on an image comprises the following steps:
[0008] S1: Determine the monitoring location of floating objects;
[0009] S2: Collect water surface related images containing floating objects, annotate the water surface related images, use semantic segmentation technology to train the model, and obtain the floating object and water surface recognition model M;
[0010] S3: Use RTK UAV to calibrate the monitoring position in space, obtain the longitude, latitude, elevation and pixel coordinates of 8 surface floating object monitoring space area calibration points A1, A2, B1, B2, C1, C2, D1, D2 and 2 water level calibration points Z1, Z2, and determine the surface floating object monitoring space area and water level calibration points;
[0011] S4: Collect the current image of the monitoring position, perform image abnormality determination on the current image, if abnormal, issue an image abnormality warning, and execute step S9, perform monitoring position abnormality verification based on the current image, if the monitoring position is inconsistent, issue a position abnormality warning, and execute step S8;
[0012] S5: Calculate the current water level elevation WL based on the current image and water level calibration points Z1 and Z2;
[0013] S6: Calculate the longitude, latitude, elevation and pixel coordinates of four points AE, BE, CE and DE in the surface floating object monitoring plane area under the current water level elevation through the current water level elevation WL and eight surface floating object monitoring space area calibration points A1, A2, B1, B2, C1, C2, D1 and D2, and obtain the floating object pixel coordinate point set FP by identifying the image in the current surface floating object monitoring plane area using the floating object and water surface recognition model M;
[0014] S7: Using the surface floating object monitoring plane area and floating object pixel coordinate point set FP under the current water level elevation, the floating object proportion area is calculated through perspective transformation;
[0015] S8: Take abnormal measures for abnormal warnings.
[0016] Furthermore, in step S1, the monitoring position includes the water surface and the dam body, the water surface range includes the range of floating object monitoring, and the water level elevation change of the water surface is observed through the dam body.
[0017] Furthermore, in the step S2, the water surface related images containing floating objects include images of different time periods, different weather conditions, and different monitoring locations. The images are automatically annotated using a large model, and the floating object and water surface recognition model M is trained using the annotated images.
[0018] Furthermore, in step S3, the specific method of using the RTK UAV to perform spatial calibration on the monitoring position is:
[0019] Use RTK UAV to select 5 calibration points A1, B1, C1, D1 and Z1 on the initial water level elevation plane. The A1, B1, C1 and D1 calibration points are the surface floating object monitoring plane areas under the initial water level elevation, and the Z1 calibration point is the water level observation point under the initial water level elevation. Determine the longitude, latitude, elevation and pixel coordinates X and Y of the calibration points.
[0020] The RTK UAV flies to the highest water level elevation plane and selects 5 calibration points A2, B2, C2, D2 and Z2. Among them, the A2, B2, C2 and D2 calibration points are the surface floating object monitoring plane areas under the highest water level elevation, and the Z2 calibration point is the water level observation point under the highest water level elevation. The longitude, latitude, elevation and pixel coordinate X and pixel coordinate Y of the calibration points are determined; among them, the longitude and latitude of A1 and A2, B1 and B2, C1 and C2, D1 and D2, Z1 and Z2 are consistent.
[0021] Furthermore, in step S4, the specific method for determining abnormality of the image is as follows:
[0022] The image classification algorithm VisionTransformer is used to perform image classification and recognition on the current image. The image classification includes: normal image 0, video packet loss 1, camera occlusion 2, lens damage 3, image blur 4.
[0023] Furthermore, in step S4, the specific method for performing abnormality verification of the monitoring position based on the current image is:
[0024] The current image and the initial image are compared by feature matching, and grayscale conversion, feature point extraction, feature point matching, and pixel deviation calculation are performed in sequence to obtain the pixel deviation value. When the pixel deviation value is greater than 10, the monitoring position is considered inconsistent and an abnormal warning is issued.
[0025] Furthermore, in step S5, the specific method for calculating the current water level WL is:
[0026] The floating object and water surface recognition model M is used to identify the image, and the water surface pixel coordinate point set WP is obtained. The ray from the pixel coordinate of Z2 to the pixel coordinate of Z1 is used to calculate the intersection point I with the water surface WP, and the current water level elevation WL is calculated by the following formula:
[0027] ,
[0028] Where: WL is the current water level, Z1WL is the elevation of Z1, is the pixel coordinate of Z1 in the horizontal direction of the image, is the pixel coordinate of Z1 in the vertical direction of the image, Z2WL is the elevation of Z2, is the pixel coordinate of Z2 in the horizontal direction of the image, is the pixel coordinate of Z2 in the vertical direction of the image, is the pixel coordinate of the intersection point I in the horizontal direction of the image, is the pixel coordinate of the intersection point I in the vertical direction of the image.
[0029] Furthermore, in step S6, the longitudes and latitudes of the four points AE, BE, CE, and DE correspond to the longitudes and latitudes of A1, B1, C1, and D1. Taking AE as an example, the pixel coordinates of AE are calculated by the following formula:
[0030] ,
[0031] Where: is the pixel coordinate of AE in the image, WL is the current water level, A1WL is the elevation of calibration point A1, A2WL is the elevation of calibration point A2, is the pixel coordinate of A1 in the image, is the pixel coordinate of A2 in the image.
[0032] Furthermore, in step S7, the specific method for calculating the area occupied by floating objects is:
[0033] The latitude and longitude coordinates of the four points AE, BE, CE, and DE are converted into projection coordinate values of the Gauss-Krüger projection coordinate system to obtain the projection coordinate values of the four points;
[0034] Match the projection coordinate values and pixel coordinate values of the four points AE, BE, CE, and DE, and use the homography matrix search function to calculate and obtain the homography matrix mat_perspective;
[0035] The pixel coordinate values of the four points AE, BE, CE, and DE in the image and the floating object pixel coordinate point set FP are calculated through the homography matrix mat_perspective to respectively perform perspective transformation calculations, and obtain the top view of the monitoring plane area of floating objects on the water surface and the top view of floating objects at the monitoring position;
[0036] The floating objects proportion area is obtained by dividing the top-view area of floating objects at the monitoring location by the top-view area of the floating objects monitoring plane on the water surface.
[0037] Furthermore, in step S8, the specific method for handling the abnormality is:
[0038] For image anomalies, we conduct on-site inspections of the network, equipment, and surrounding environment for video packet loss, camera occlusion, lens damage, and image blur to ensure that images at the monitoring location are normal.
[0039] For position abnormalities, the camera is pan-tilt controlled and the feature matching method is used for identification to obtain the pixel deviation value between the current image and the initial image. When the pixel deviation value is less than or equal to 2, it is determined that the monitoring position has returned to the original position, and the monitoring position correction is completed.
[0040] The method for recognizing the density of floating objects on the water surface based on images provided by the present invention is to obtain a floating object and water surface recognition model by labeling and training through a large model, and to use an RTK drone for spatial calibration to determine the spatial area for monitoring floating objects on the water surface and the water level calibration points, and to use the floating object and water surface recognition model and the water level calibration points to obtain the current water level elevation, and to further obtain the surface floating object monitoring plane area and the floating object recognition result under the current water level elevation, and to obtain the floating object proportion area by combining the current surface floating object monitoring plane area and the floating object recognition result through perspective transformation calculation to determine the density of floating objects. This method can not only identify floating objects, but also quantitatively monitor the floating object proportion area, which solves the problem of not handling when there are fewer floating objects, and only needing to deal with a large number of floating objects. At the same time, image abnormality processing and monitoring position verification are added, which can better eliminate image abnormalities and carry out effective abnormality disposal, and has stronger applicability.
[0041] Beneficial effects of the present invention:
[0042] 1. The floating object proportion area identification proposed in the present invention upgrades the qualitative identification of floating objects to quantitative identification, and realizes the effective quantitative evaluation of the density of floating objects.
[0043] 2. The present invention adopts RTK UAV for spatial calibration, which not only improves the calibration efficiency of the spatial area of surface floating object monitoring and water level calibration points, but also brings significant improvements in operation safety, cost-effectiveness and intelligence level.
[0044] 3. The present invention combines the high efficiency of large model annotation with the balanced optimization of category loss by the class_weight parameter, which not only improves the efficiency and quality of data annotation, but also significantly improves the accuracy of model recognition.
[0045] 4. The present invention realizes the effective elimination of image anomalies and rapid response to abnormal situations through the dual protection of image anomaly processing and monitoring position verification, thereby enhancing its reliability in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0047] Figure 1 It is a flow chart of a method for identifying the density of floating objects on the water surface based on images of the present invention;
[0048] Figure 2 It is a training result diagram of the floating object and water surface recognition model of the present invention;
[0049] Figure 3 It is a schematic diagram of using an RTK UAV to perform spatial calibration on a monitoring position in the present invention;
[0050] Figure 4 is another schematic diagram of the present invention using an RTK UAV to perform spatial calibration on a monitoring position;
[0051] 1: Dam body, 2: Water surface, 3: Camera. DETAILED DESCRIPTION
[0052] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0053] like Figure 1 The present invention shows a method for identifying the density of floating objects on the water surface based on an image, which includes the following steps:
[0054] S1: Determine the monitoring location of floating objects.
[0055] Specifically, the camera direction angle is adjusted to determine the monitoring position of the floating object, the monitoring position needs to include the water surface and the dam body, and the water surface range needs to include the monitoring range of the floating object. It can be understood that the water level elevation change of the water surface can be observed through the dam body.
[0056] S2: Collect water surface related images containing floating objects, annotate the floating objects and water surface in the images, use semantic segmentation technology to train the model, and obtain the floating object and water surface recognition model M.
[0057] In step S2, the water surface images containing floating objects include images of different time periods, different weather conditions, and different monitoring locations, and a large model is used to automatically annotate the images. Specifically, through SAM interactive segmentation, a frame is drawn or points are taken on the target to generate a target mask image for annotation. During model training, the background category is set to 0, the water category is set to 1, and the floating object category is set to 2. The class_weight parameter is introduced to balance the category loss. The corresponding parameters of the background category, water category, and floating object category are set to 0.5, 1.0, and 3.0, respectively. Finally, the floating object and water surface recognition model M is obtained. Figure 2 This is a graph of the training results of the floating object and water surface recognition model.
[0058] S3: Use RTK UAV to perform spatial calibration of the monitoring position, and obtain the longitude, latitude, elevation and pixel coordinates of 8 surface floating object monitoring spatial area calibration points A1, A2, B1, B2, C1, C2, D1, D2 and 2 water level calibration points Z1 and Z2, so as to determine the surface floating object monitoring spatial area and water level calibration points.
[0059] It can be understood that spatial calibration is to determine the position of the calibration points in the physical world and their positions in the image. Since different cameras have different distortion coefficients, by measuring the distance between different calibration points in the physical world and the pixel distance between their corresponding calibration points in the image, it can be ensured that the pixel values measured from the image are consistent with the actual values in the physical world.
[0060] The 8 surface floating object monitoring space area calibration points are used to determine the surface floating object monitoring space area. Since the water level is changing, the surface floating object monitoring plane area will change in the image, so a spatial interval needs to be calibrated to calculate the current surface floating object monitoring plane area.
[0061] The two water level calibration points are used to determine the current water level elevation. Only with the current water level elevation can the current surface floating object monitoring plane area be calculated.
[0062] like Figure 3 and Figure 4 As shown, specifically, in the implementation manner of the present application, the specific method of using the RTK drone to perform spatial calibration on the monitoring position is:
[0063] Use RTK UAV to select 5 calibration points A1, B1, C1, D1 and Z1 on the initial water level elevation plane. The A1, B1, C1 and D1 calibration points are the surface floating object monitoring plane areas under the initial water level elevation, and the Z1 calibration point is the water level observation point under the initial water level elevation. Determine the longitude, latitude, elevation and pixel coordinates X and Y of the calibration points.
[0064] The RTK UAV flies to the highest water level elevation plane and selects five calibration points A2, B2, C2, D2 and Z2. The A2, B2, C2 and D2 calibration points are the surface floating object monitoring plane areas under the highest water level elevation, and the Z2 calibration point is the water level observation point under the highest water level elevation. The longitude, latitude, elevation and pixel coordinates X and Y of the calibration points are determined;
[0065] Among them, the longitude and latitude of A1 and A2, B1 and B2, C1 and C2, D1 and D2, and Z1 and Z2 are consistent.
[0066] Among them, the RTK drone is equipped with an RTK sensor, and a rope and a weight are mounted directly below the RTK sensor to ensure that the weight can be vertically dropped into the water surface. The initial water level elevation plane is determined by the position where the weight touches the water surface, and the highest water level elevation plane is determined by the position where the weight reaches the top of the dam.
[0067] It is understandable that the number of surface floating object monitoring space area calibration points and water level calibration points can be adjusted as needed.
[0068] S4: Collect the current image of the monitoring position, perform image anomaly judgment on the current image, and if there is an abnormality, issue an image anomaly warning, and execute step S8. Perform monitoring position anomaly verification based on the current image. If the monitoring position is inconsistent, issue a position anomaly warning, and execute step S8.
[0069] In the implementation of the present application, the image classification algorithm VisionTransformer is used to classify and identify the current image. The image classification includes: normal image 0, video packet loss 1, camera occlusion 2, lens damage 3, image blur 4. If the image is identified as video packet loss 1, camera occlusion 2, lens damage 3 or image blur 4, it is considered to be an image abnormality and an abnormality warning is issued. It can be understood that the type of image abnormality can be adjusted according to the actual situation, and the specific method of abnormality determination can also be set accordingly according to the actual type classification.
[0070] In the implementation manner of the present application, the specific method for performing abnormality verification of the monitoring position based on the current image is:
[0071] The current image and the initial image are compared by feature matching, and grayscale conversion, feature point extraction, feature point matching, and pixel deviation calculation are performed in sequence to obtain the pixel deviation value. When the pixel deviation value is greater than 10, the monitoring position is considered inconsistent and an abnormal warning is issued.
[0072] It is understandable that the pixel deviation value of the position anomaly check can be set as needed, and the preferred range is 8-12.
[0073] S5: Calculate the current water level elevation WL based on the current image and water level calibration points Z1 and Z2.
[0074] It is understandable that the calculation of the water level elevation WL is to determine the position of the surface floating object monitoring plane area in the image under the current water level elevation WL. Since different water levels will cause the position of the surface floating object monitoring plane area in the image to change, in this application, the current surface floating object monitoring plane area is determined by calculating the water level elevation WL in combination with 8 surface floating object monitoring space area calibration points, thereby ensuring the accuracy of recognition.
[0075] In step S5, the specific method for calculating the current water level WL is:
[0076] The floating object and water surface recognition model M is used to identify the image, and the water surface pixel coordinate point set WP is obtained. The ray from the pixel coordinate of Z2 to the pixel coordinate of Z1 is used to calculate the intersection point I with the water surface WP, and the current water level elevation WL is calculated by the following formula:
[0077] ,
[0078] Where: WL is the current water level, Z1WL is the elevation of Z1, is the pixel coordinate of Z1 in the horizontal direction of the image, is the pixel coordinate of Z1 in the vertical direction of the image, Z2WL is the elevation of Z2, is the pixel coordinate of Z2 in the horizontal direction of the image, is the pixel coordinate of Z2 in the vertical direction of the image, is the pixel coordinate of the intersection point I in the horizontal direction of the image, is the pixel coordinate of the intersection point I in the vertical direction of the image.
[0079] S6: Calculate the longitude, latitude, elevation and pixel coordinates of four points AE, BE, CE and DE in the surface floating object monitoring plane area under the current water level elevation through the current water level elevation WL and eight surface floating object monitoring space area calibration points A1, A2, B1, B2, C1, C2, D1 and D2, and obtain the floating object pixel coordinate point set FP by using the floating object and water surface recognition model M to identify the image in the current surface floating object monitoring plane area.
[0080] It can be understood that the obtained floating object pixel coordinate point set FP is the pixel point set of the outline of the floating object in the corresponding image of the current surface floating object monitoring plane area. Since the spatial calibration has associated the physical world with the image, calculating the area occupied by the floating object only requires calculating the area occupied by the floating object in the image.
[0081] In the implementation of the present application, the longitude, latitude, elevation and pixel coordinates of four points AE, BE, CE and DE need to be determined to calculate the monitoring plane area of floating objects on the water surface under the current water level elevation. That is, the longitude, latitude, elevation and pixel coordinates of the four points AE, BE, CE and DE can be determined to determine the monitoring plane area of floating objects on the water surface under the current water level elevation. In the step S6, the longitude and latitude of the four points AE, BE, CE and DE correspond to the longitude and latitude of A1, B1, C1 and D1. Taking AE as an example, the pixel coordinates of AE are calculated by the following formula:
[0082] ,
[0083] Where: is the pixel coordinate of AE in the image, WL is the current water level, A1WL is the elevation of calibration point A1, A2WL is the elevation of calibration point A2, is the pixel coordinate of A1 in the image, is the pixel coordinate of A2 in the image.
[0084] S7: Using the surface floating object monitoring plane area and the floating object pixel coordinate point set FP under the current water level elevation, the floating object share area is calculated through perspective transformation.
[0085] In step S7, the specific method for calculating the area occupied by floating objects is:
[0086] Convert the latitude and longitude coordinates of the four points AE, BE, CE, and DE into the projection coordinate values of the Gauss-Kruger projection coordinate system to obtain the projection coordinate values of the four points. Match the projection coordinate values of the four points AE, BE, CE, and DE with the pixel coordinate values, and use the opencv cv2.findHomography function to calculate the homography matrix to obtain the homography matrix mat_perspective. Use the homography matrix mat_perspective to perform perspective transformation calculations on the pixel coordinate values of the four points AE, BE, CE, and DE in the image and the floating object pixel coordinate point set FP, respectively, to obtain the top view of the surface floating object monitoring plane area and the top view of the floating object at the monitoring position. The floating object proportion area is obtained by dividing the top view area of the floating object at the monitoring position by the top view area of the surface floating object monitoring plane area.
[0087] S8: Take abnormal measures for abnormal warnings.
[0088] Analyze the cause of the abnormal warning monitoring position. If it is an image abnormality, conduct on-site inspection and disposal. If it is inconsistent with the monitoring position, correct the monitoring position.
[0089] In step S8, the specific method for handling the abnormality is:
[0090] For image anomalies, we conduct on-site inspections of the network, equipment, and surrounding environment for issues such as video packet loss, camera occlusion, lens damage, and image blur to ensure that images at the monitoring location are normal.
[0091] For position abnormalities, the camera is pan-tilt controlled and the feature matching method is used for identification to obtain the pixel deviation value between the current image and the initial image. When the pixel deviation value is less than or equal to 2, it is determined that the monitoring position has returned to the original position and the monitoring position correction is completed. It can be understood that the pixel deviation value judgment threshold for returning to the original position can be adjusted according to the specific situation.
[0092] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the above embodiments do not limit the present invention in any form, and any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.
Claims
1. A method for identifying the density of floating objects on a water surface based on an image, characterized in that: The steps include: S1: Determine the monitoring location of floating objects; S2: Collect water surface images containing floating objects, annotate the water surface images, use semantic segmentation technology to train the model, and obtain the floating object and water surface recognition model M; S3: Use RTK UAV to calibrate the monitoring position in space, obtain the longitude, latitude, elevation and pixel coordinates of 8 surface floating object monitoring space area calibration points A1, A2, B1, B2, C1, C2, D1, D2 and 2 water level calibration points Z1, Z2, and determine the surface floating object monitoring space area and water level calibration points; S4: Collect the current image of the monitoring position, perform image abnormality determination on the current image, if abnormal, issue an image abnormality warning, and execute step S8, perform monitoring position abnormality verification based on the current image, if the monitoring position is inconsistent, issue a position abnormality warning, and execute step S8; S5: Calculate the current water level elevation WL based on the current image and water level calibration points Z1 and Z2; S6: Calculate the longitude, latitude, elevation and pixel coordinates of four points AE, BE, CE and DE in the surface floating object monitoring plane area under the current water level elevation through the current water level elevation WL and eight surface floating object monitoring space area calibration points A1, A2, B1, B2, C1, C2, D1 and D2, and obtain the floating object pixel coordinate point set FP by identifying the image in the current surface floating object monitoring plane area using the floating object and water surface recognition model M; S7: Using the surface floating object monitoring plane area and floating object pixel coordinate point set FP under the current water level elevation, the floating object proportion area is calculated through perspective transformation; S8: handle abnormal warnings; In step S5, the specific method for calculating the current water level WL is: The floating object and water surface recognition model M is used to identify the image, and the water surface pixel coordinate point set WP is obtained. The ray from the pixel coordinate of Z2 to the pixel coordinate of Z1 is used to calculate the intersection point I with the water surface WP, and the current water level elevation WL is calculated by the following formula: Where: WL is the current water level, Z1WL is the height of Z1, Z1 X is the pixel coordinate of Z1 in the horizontal direction of the image, Z1 Y is the pixel coordinate of Z1 in the vertical direction of the image, Z2WL is the elevation of Z2, and Z2 X is the pixel coordinate of Z2 in the horizontal direction of the image, Z2 Y is the pixel coordinate of Z2 in the vertical direction of the image, I X is the pixel coordinate of the intersection point I in the horizontal direction of the image, I Y is the pixel coordinate of the intersection point I in the vertical direction of the image; In step S6, the longitudes and latitudes of the four points AE, BE, CE, and DE correspond to the longitudes and latitudes of A1, B1, C1, and D1. Taking AE as an example, the pixel coordinates of AE are calculated by the following formula: Where: AE x,y is the pixel coordinate of AE in the image, WL is the current water level, A1WL is the elevation of calibration point A1, A2WL is the elevation of calibration point A2, A1 x,y is the pixel coordinate of A1 in the image, A2 x,y is the pixel coordinate of A2 in the image; In step S7, the specific method for calculating the area occupied by floating objects is: The latitude and longitude coordinates of the four points AE, BE, CE, and DE are converted into projection coordinate values of the Gauss-Krüger projection coordinate system to obtain the projection coordinate values of the four points; The projection coordinate values and pixel coordinate values of the four points AE, BE, CE, and DE are matched, and the homography matrix mat_perspective is obtained by using the opencvcv2.findHomography function to calculate; The pixel coordinate values of the four points AE, BE, CE, and DE in the image and the floating object pixel coordinate point set FP are calculated through the homography matrix mat_perspective to respectively perform perspective transformation calculations, and obtain the top view of the monitoring plane area of floating objects on the water surface and the top view of floating objects at the monitoring position; The floating objects proportion area is obtained by dividing the top-view area of floating objects at the monitoring location by the top-view area of the floating objects monitoring plane on the water surface.
2. The method for identifying the density of floating objects on the water surface based on images according to claim 1, characterized in that: In step S1, the monitoring position includes the water surface and the dam body, the water surface range includes the range of floating object monitoring, and the water level elevation change of the water surface is observed through the dam body.
3. The method for identifying the density of floating objects on the water surface based on images according to claim 1, characterized in that: In step S2, the water surface related images containing floating objects include images of different time periods, different weather conditions, and different monitoring locations. The images are automatically annotated using a large model, and the floating object and water surface recognition model M is trained using the annotated images.
4. The method for identifying the density of floating objects on the water surface based on images according to claim 1, characterized in that: In step S3, the specific method of using the RTK UAV to perform spatial calibration on the monitoring position is: Use RTK UAV to select 5 calibration points A1, B1, C1, D1 and Z1 on the initial water level elevation plane. The A1, B1, C1 and D1 calibration points are the surface floating object monitoring plane areas under the initial water level elevation, and the Z1 calibration point is the water level observation point under the initial water level elevation. Determine the longitude, latitude, elevation and pixel coordinates X and Y of the calibration points. The RTK UAV flies to the highest water level elevation plane and selects 5 calibration points A2, B2, C2, D2 and Z2. Among them, the A2, B2, C2 and D2 calibration points are the surface floating object monitoring plane areas under the highest water level elevation, and the Z2 calibration point is the water level observation point under the highest water level elevation. The longitude, latitude, elevation and pixel coordinate X and pixel coordinate Y of the calibration points are determined; among them, the longitude and latitude of A1 and A2, B1 and B2, C1 and C2, D1 and D2, Z1 and Z2 are consistent.
5. The method for identifying the density of floating objects on the water surface based on images according to claim 1, characterized in that: In step S4, the specific method for determining image abnormality of the current image is as follows: The image classification algorithm VisionTransformer is used to perform image classification and recognition on the current image. The image classification includes: normal image 0, video packet loss 1, camera occlusion 2, lens damage 3, image blur 4.
6. The method for identifying the density of floating objects on the water surface based on images according to claim 1, characterized in that: In step S4, the specific method for performing abnormality verification of the monitoring position based on the current image is: The current image and the initial image are compared by feature matching, and grayscale conversion, feature point extraction, feature point matching, and pixel deviation calculation are performed in sequence to obtain the pixel deviation value. When the pixel deviation value is greater than 10, the monitoring position is considered inconsistent and an abnormal warning is issued.
7. The method for identifying the density of floating objects on the water surface based on images according to claim 1, characterized in that: In step S8, the specific method for handling the abnormality is: For image anomalies, we conduct on-site inspections of the network, equipment, and surrounding environment for video packet loss, camera occlusion, lens damage, and image blur to ensure that images at the monitoring location are normal. For position abnormalities, the camera is pan-tilt controlled and the feature matching method is used for identification to obtain the pixel deviation value between the current image and the initial image. When the pixel deviation value is less than or equal to 2, it is determined that the monitoring position has returned to the original position, and the monitoring position correction is completed.
Citation Information
Patent Citations
Unmanned aerial vehicle-based water surface floater detection method and unmanned aerial vehicle
CN106780598A
Near-ultraviolet image processing based detection and early-warning method for hazardous chemical substances in off-shore marine site
CN108257119A
Cited By
Water surface floating object adaptive identification and tracking method and system
CN120355753B