River surface flow velocity detection method and device based on AI unmanned aerial vehicle vision technology
By using AI drone vision technology and computer vision algorithms to process river surface velocity images, the problems of complex operation and poor safety in river velocity measurement under harsh environments have been solved, enabling efficient and widespread velocity measurement, reducing costs and improving accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NORTH CHINA UNIV OF WATER RESOURCES & ELECTRIC POWER
- Filing Date
- 2022-01-28
- Publication Date
- 2026-07-10
AI Technical Summary
Existing methods for measuring river flow velocity are complex to operate in harsh environments, have poor safety, and are limited in scope, making it difficult to meet the needs of flood prevention and early warning in remote areas.
Using AI-based drone vision technology, images of river surface flow velocity are captured by drones. Computer vision technology and intelligent algorithms are then used to process the images, identify different flow velocities, and generate histogram trend curves to determine the flow velocity.
It enables efficient, safe, and wide-ranging flow rate measurement in harsh environments, reducing costs and improving measurement accuracy.
Smart Images

Figure CN115601664B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of water flow velocity detection technology, and relates to a method and device for detecting river surface flow velocity based on AI drone vision technology. Background Technology
[0002] Flow velocity data is one of the most fundamental data in hydrological research and forms the basis of all hydrological studies. Due to the complex flow characteristics of natural rivers and the harsh outdoor testing environment, measuring the flow velocity of natural rivers has always been a challenging task in hydrological testing. This is especially true during frequent extreme events such as floods and droughts, when the need for timely acquisition of key information such as changes in river flow velocity and runoff is even more urgent. Therefore, developing a flow velocity measurement method applicable to various harsh environments is of great significance for flood prevention and early warning work in remote areas.
[0003] Currently, river velocity measurement methods have certain limitations in practical applications. For example, traditional manual flow velocity measurement methods lack convenience during high flood seasons and cannot guarantee the safety of measurement personnel. Modern contact-based river velocity measurement methods, such as tracer-based image measurement methods and non-contact acoustic Doppler or radar velocity measurement methods, generally suffer from poor measurement safety and difficulties in system deployment when conducting detection tasks in the field under complex conditions such as flash floods.
[0004] Artificial intelligence (AI) is a new technological science that studies and develops theories, methods, technologies, and application systems to simulate, extend, and expand human intelligence. Drones, often called "flying cameras," can perform tasks in many complex scenarios. Simultaneously, with the development of computer vision technology and the massive increase in multimedia data such as video and images, people can further inform decision-making by extracting information from video images. Summary of the Invention
[0005] To address the aforementioned issues, this invention provides a method and apparatus for detecting river surface flow velocity based on AI drone vision technology. First, a drone is used to acquire real-time images of water flow velocity. Then, computer vision technology is applied to process the images, and AI intelligent algorithms are combined to classify and identify images of different river flow velocities. This solves the technical problems of existing flow velocity measurement methods being complex to operate and having a small measurement area.
[0006] The technical solution adopted in this invention is: a method for detecting river surface flow velocity based on AI drone vision technology, comprising the following steps:
[0007] Step 1: Use a drone to capture images of the surface flow velocity of the river in the monitoring area with known flow velocity, extract the water flow portion from the image frame sequence of the monitoring area, and perform image preprocessing;
[0008] Step 2: Extract the grayscale values of the preprocessed image and calculate the direction and gradient magnitude corresponding to each pixel;
[0009] Step 3: Place the pixels into different directional blocks according to their orientation, collect the directional block information corresponding to all image pixels, generate a statistical histogram, and generate a trend curve based on the histogram;
[0010] Step 4: Determine the flow velocity in the area to be measured by comparing the trend curves of the histogram.
[0011] Furthermore, in step 1, the monitoring area is a river section where the water flow velocity is uniformly distributed in the range of 0-10m / s at [1-101], with a velocity interval of 0.1m / s. The monitoring frame sequence is generated by the video frame sequence and photos of the water flow monitoring area taken by the UAV.
[0012] Furthermore, in step 1, the image preprocessing involves scaling, gamma transformation, and grayscale conversion of the image.
[0013] Furthermore, the grayscale value extraction method is gamma correction.
[0014] Furthermore, in step 3, the direction corresponding to the pixel is calculated by calling the kernel function to process the top, bottom, left, and right pixels of the target pixel, and is obtained through the modulus and inverse trigonometric function.
[0015] Furthermore, in step 3, the pixels are placed in different regions, with the pixel direction divided into 36 regions ranging from 1 to 360 degrees. Pixels with a direction less than 1 degree at the boundary of a region are rounded to the nearest integer. At the same time, the gradient corresponding to the target pixel is accumulated.
[0016] Furthermore, all image orientation information is statistically stored in the database, i.e., all images are batch-processed to train and obtain orientation information for various types of images; then, each type of image is normalized to obtain the proportion of each orientation in each type of image; finally, the captured two-dimensional images are reduced to one-dimensional by statistically saving the histogram trend curves of each orientation of each type of image.
[0017] Furthermore, by comparing and determining the flow velocity in the monitoring area to be measured, the database of saved image histogram trend curves is tested. By comparing the trend curves of various image histograms with the trend curves of the test image histograms, the same test points are selected, the corresponding variances are calculated, and the label corresponding to the minimum value is the identified flow velocity classification.
[0018] This invention also provides a river surface flow velocity detection device based on AI drone vision technology, including a main control module and a power supply module installed on the drone; the main control module includes a microcontroller U1, which is connected to a 4G communication module G1 and an image acquisition module P1 respectively; the PC14 and PC15 serial ports of the microcontroller U1 are connected to a low-speed clock module, in which a crystal oscillator X3 is connected in parallel with capacitors C18 and C19 connected in series; the VDD and VSS interfaces of the microcontroller U1 are connected to VCC2 and the ground wire respectively; the microcontroller U1 is powered through a VBAT interface, which is connected to diode D7, diode D8 and capacitor C23 respectively; the two ends of the battery B2 are connected between capacitor C23 and diode D8; the microcontroller U1 is powered through RESET The interface is connected to the set module, which includes a resistor R7, a switch K2, and a capacitor C20. The switch K2 and capacitor C20 are connected in parallel, and the two ends of the resistor R7 are connected to VCC2 and capacitor C20, respectively. The Vref-, OSC-IN, and OSC-OUT interfaces of the microcontroller U1 are connected to an external high-speed clock module. The high-speed clock module uses an 8MHz crystal oscillator X4, which is connected in parallel with a resistor R9. The two ends of the resistor R9 are connected to capacitors C25 and C24, respectively. The Vref+, VDDA, and VSSA interfaces of the microcontroller U1 are connected to an analog voltage module. Both Vref+ and VDDA are connected to the VSSA interface with capacitors C21 and C22 connected in parallel. The two ends of the resistor R8 are connected to the VCC2 and Vref+ and VDDA interfaces, respectively.
[0019] The power module includes four diodes D1, D2, D3, and D4 connected in parallel. Two wires are led out from diodes D1, D3, D2, and D4. One wire is connected to capacitor C1, resistor R1, and the bases of transistors Q1 and Q2, respectively. The other wire is connected to the other end of capacitor C1, capacitor C2, Zener diode LED1, resistor R5, capacitor C3, variable resistor RP1, and the negative terminal of VCC2, respectively. The two wires are connected together through capacitor C1, and a series circuit consisting of resistor R1 and capacitor C2 is connected in parallel. At the connection point of resistor R1 and capacitor C2, a wire is led out to transistor Q1. The base of transistor Q1 and the collector of transistor Q2 are connected to resistor R1 and the collector of transistor Q2. The emitter of transistor Q1 is connected to the base of transistor Q2. The emitter of transistor Q2 is connected to resistor R2. The other end of resistor R2 is connected to resistor R3, Zener diode LED2, resistor R4, capacitor C3, and variable resistor RP1. The other end of resistor R3 is connected to Zener diode LED1 and the emitter of transistor Q3. The collector of transistor Q3 is connected to resistor R1, the base of transistor Q1, capacitor C2, and Zener diode LED2. The base of transistor Q3 is connected to resistor R4 and resistor R5.
[0020] The beneficial effects of this invention are as follows: It provides a novel technical method for flow velocity measurement, which can be cross-checked with traditional flow velocity measurement methods, improving the accuracy of flow velocity measurement. This invention uses a non-contact measurement method to replace traditional contact-based instruments for river velocity measurement, significantly reducing measurement costs. Furthermore, the river surface flow velocity detection method and system based on AI drone vision technology of this invention do not require the deployment of additional detection equipment, making it more widely applicable and simpler to apply than traditional flow measurement methods. Attached Figure Description
[0021] Figure 1 This is a flowchart of the detection process of the present invention;
[0022] Figure 2 This is a flowchart of the process for acquiring water flow attitude images by a UAV in this invention;
[0023] Figure 3 This is a flowchart of the image preprocessing process in this invention;
[0024] Figure 4 This is a flowchart of the histogram trend curve generation process in this invention;
[0025] Figure 5 This is a flowchart of the test image recognition process in this invention;
[0026] Figure 6 This is a schematic diagram of the target pixel distribution in this invention;
[0027] Figure 7a This is a schematic diagram of the target pixel processing kernel function in this invention. Figure 1 ;
[0028] Figure 7b This is a schematic diagram of the target pixel processing kernel function in this invention. Figure 2 ;
[0029] Figure 8 This is a schematic diagram illustrating the placement of image orientation information into the orientation interval in this invention;
[0030] Figure 9 This is a schematic diagram of the generation of statistical histograms of image orientation information according to an embodiment of the present invention;
[0031] Figure 10 This is a schematic diagram of the trend curve of the image orientation histogram in an embodiment of the present invention;
[0032] Figure 11 This is a schematic diagram of test image comparison under an embodiment of the present invention;
[0033] Figure 12 This is a schematic diagram of images acquired by a drone in this invention;
[0034] Figure 13 This is a schematic diagram of the main control module structure in this invention;
[0035] Figure 14 This is a schematic diagram of the 220V / 5V power supply in this invention. Detailed Implementation
[0036] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0037] It should be noted that, unless otherwise specified, the embodiments and some steps in the embodiments of this invention may be appropriately varied. The invention will be further described in detail below with reference to specific embodiments.
[0038] This invention combines artificial intelligence and computer vision technology to automatically detect the surface flow velocity of the Yellow River. The invention employs a non-contact measurement method, reducing the impact of water flow on instrument measurements and offering advantages such as low detection cost and stable results.
[0039] like Figure 1 As shown, the detection method in this invention includes four parts: acquisition of known water flow attitude images, image preprocessing, generation of image histogram trend curves, and recognition of test images.
[0040] like Figure 2 As shown, the acquisition of water flow attitude images can be divided into two steps:
[0041] The first step is the detection of the water flow attitude. This invention uses the average offset between water streamlines for detection, which can be expressed as:
[0042]
[0043] In equation (1), △h (j,j+1) This represents the average offset between the j-th and (j+1)-th streamlines within the image; is the x-coordinate of the i-th segment within the j-th water flow line in the image; z is the number of segments into which the water flow line is divided, which changes depending on the drone and the camera it is equipped with.
[0044] The second step is to adjust the drone's attitude, based on the offset and determination between the various water flow lines:
[0045]
[0046] In equation (2), s is the offset between each streamline; m is the total number of streamlines; if s>0, it indicates that the image is tilted clockwise and the UAV needs to be adjusted clockwise; if s<m, it indicates that the image is tilted counterclockwise and the UAV needs to be adjusted counterclockwise; if s=m, it indicates that the image is basically untilted and no adjustment is needed.
[0047] The attitude adjustment of a drone includes adjustments in six directions: forward, backward, left, right, up, and down, which can be represented as follows.
[0048]
[0049] In the formula, θ and γ are the heading angle, pitch angle and roll angle of the UAV, respectively, which control the forward, backward, up and down and left and right directions of the UAV. T θ T γ These are the periods of change of the drone's heading angle, pitch angle, and roll angle, respectively. θ m γ m These are the amplitudes of the drone's heading angle, pitch angle, and roll angle, respectively. It is a hypothetical fixed heading angle.
[0050] The water streamlines can be generated using equation (4).
[0051] M(x,y)=|d x (x,y)|+|d y (x,y)| (4)
[0052] In the formula, M(x,y) represents the image gradient magnitude, used to identify edge features; d x (x,y) represents the horizontal gradient magnitude of the image; d y (x,y) represents the vertical gradient magnitude of the image, and the calculation method is shown in equations (5) and (6).
[0053]
[0054]
[0055] In equations (5) and (6), f(x,y) represents the pixel points corresponding to the flow velocity image. It can be collected from high altitude using a drone, and can be a photo or a video. To ensure the accuracy of the test image, the collected image must have good exposure, be clear, and have no obstructions.
[0056] like Figure 3 As shown, after the original image is acquired, a series of processes such as cutting, copying, and pasting will cause changes in the image size, resolution, orientation, and exposure. If these changes are not controlled or processed, they will affect subsequent image testing.
[0057] During image acquisition, some categories have fewer images than others. Too few images result in a small database, which is detrimental to subsequent image testing. Therefore, in image preprocessing, importing the images to be processed and performing operations such as image rotation, gamma transformation, and equalization can fill in the categories with fewer images, synthesizing the image database and expanding its size.
[0058] like Figure 4 As shown, after importing the image to be processed, the generation of the image histogram trend curve can be divided into five steps:
[0059] The first step is to extract the grayscale values of the image. Preferably, the present invention uses the gamma correction method to extract the grayscale values of the image, as shown in equation (7).
[0060]
[0061] In the formula, Gr is the extracted gray value; R is the red component of the flow velocity image; G is the green component of the flow velocity image; and B is the blue component of the flow velocity image.
[0062] The second step is to calculate the gradient and direction of the image pixels. The pixel gradient is the magnitude value obtained by calculating the gradient in the horizontal direction and the gradient in the vertical direction. The calculation method is shown in Equation (8).
[0063]
[0064] The direction of a pixel is calculated by using the inverse trigonometric function of the horizontal and vertical gradients, as shown in equation (9).
[0065]
[0066] In equations (2) and (3), g x Let g be the horizontal gradient of the target pixel. y The vertical gradient of the target pixel. x With g y The calculation methods are shown in equations (10) and (11) respectively:
[0067] g x = (1)*C+(-1)*D (10)
[0068] g y = (1)*A+(-1)*B (11)
[0069] In the formula, C is the gray value of the pixel to the right of the target pixel; D is the gray value of the pixel to the left of the target pixel; A is the gray value of the pixel below the target pixel; and B is the gray value of the pixel above the target pixel. A, B, C, and D are calculated according to formula (7), and their logical relationship is as follows: Figure 6 As shown.
[0070] In equation (10), the kernel function used is illustrated as follows: Figure 7a As shown; in equation (11), the kernel function used is illustrated as follows. Figure 7b As shown.
[0071] The third step is to place the pixels into regions with different orientations.
[0072] In this invention, the direction from 1 to 360 degrees is divided into 36 equal parts, namely 1-10 degrees, 11-20 degrees, 21-30 degrees, 31-40 degrees, 41-50 degrees, 51-60 degrees, 61-70 degrees, 71-80 degrees, 81-90 degrees, 91-100 degrees, 101-110 degrees, 111-120 degrees, 121-130 degrees, 131-140 degrees, 141-150 degrees, 151-160 degrees, 161-170 degrees, 171-180 degrees, 181... -190 degrees, 191-200 degrees, 201-210 degrees, 211-220 degrees, 221-230 degrees, 231-240 degrees, 241-250 degrees, 251-260 degrees, 261-270 degrees, 271-280 degrees, 281-290 degrees, 291-300 degrees, 301-310 degrees, 311-320 degrees, 321-330 degrees, 331-340 degrees, 341-350 degrees, and 351-360 degrees are respectively designated as regions 1-36.
[0073] Depending on the direction, pixels are placed in different regions, and gradient values are superimposed, such as... Figure 8 As shown.
[0074] The fourth step is to generate the statistical histogram. The statistical histogram is essentially a statistical display of the directional regions from the third step, such as... Figure 9 As shown in the figure, the horizontal axis represents the directional region, and there are 36 regions in total; the vertical axis represents the cumulative gradient value of pixels in the same direction.
[0075] The fifth step is to generate the image histogram trend curve. The histogram trend curve is a curve that describes the form of the histogram, such as... Figure 10 As shown.
[0076] From this point on, the original image can be represented by a curve, greatly simplifying the subsequent testing process. Adding labels to the images in the training database results in equation (12):
[0077]
[0078] In the formula, F represents the image training library; T represents the category label, which has 101 types and the value range is [1-101]; i is the direction region number, and the value range is [1-36]; j is the vertical coordinate corresponding to the direction region of the histogram trend curve, and the value range is [0-1].
[0079] The image recognition test was performed based on the histogram trend curve, and its processing flowchart is as follows: Figure 5 As shown, it can be divided into two parts: curve variance calculation and curve variance comparison.
[0080] In this invention, to avoid excessive data computation, the regions in each direction are first normalized before calculating the curve variance. A comparison of the histogram trend curves of the example image and the test image is shown below. Figure 11 As shown.
[0081] During the calculation process, considering that there are a total of 36 directional regions, the average value of each region is taken for difference calculation, and the calculation method is shown in Equation (13).
[0082]
[0083] In the formula, S is the variance of the histogram trend curve of the database images and the histogram trend curve of the test images, and f1, f2, ..., f 36 These represent the average values of data points from the training library images in the first, second, and 36th direction regions, respectively. These represent the average values of data points in the test image in the first, second, and 36th direction regions, respectively.
[0084] Variance comparison is the process of finding the highest similarity probability, and the calculation method is shown in Equation (14).
[0085]
[0086] In the formula, P represents the highest similarity probability between the histogram trend curves of various image types and the histogram trend curve of the test image; when P ranges from [0.5 to 1], the test image recognition effect is considered good, and the current recognition result is adopted; when P ranges from [0 to 0.5], the test image recognition effect is considered poor, indicating that the existing image database is insufficient, and images need to be added to each image database for retraining and testing again; S1, S2, ..., S N Let N be the variance of the histogram trend curves of various images and the histogram trend curve of the test image; N is numerically equal to the number of images in the training library, i.e., N = n1 + n2 + ... + n 101 n1, n2, ..., n 101The number of images in the 101 categories; k represents the test image number, which is equal to the number of test images.
[0087] Take the label T corresponding to P to obtain the recognition category of the test image, and thus obtain the flow rate of the test image. This can be expressed as equation (15):
[0088]
[0089] In the formula, F is the image training library set in formula (12); C is the measured flow velocity, which has the same range as T, i.e. [0-10], and the unit is m / s.
[0090] A flow velocity value can be obtained at all three flight angles, so the flow velocity needs to be compensated by the UAV attitude, which can be expressed as Equation (16):
[0091]
[0092] In the formula Water surface velocity measured after drone attitude compensation; V is the surface velocity measured under heading angle control. θ V is the surface velocity of the water measured under pitch angle control. θ The water surface velocity is measured under roll angle control.
[0093] like Figure 13As shown, the main control module structure of the UAV in this invention is as follows: the microcontroller U1 uses an STM32F1032ET6 chip to provide control and data transmission for this invention. The microcontroller U1 is connected to the 4G communication module G1 and the image acquisition module P1, respectively. The 4G communication module G1 sends the acquired images to the computer in a timely manner for real-time processing. The PC14 and PC15 serial ports of microcontroller U1 are connected to an external low-speed clock module. This low-speed clock module uses a 32.768kHz crystal oscillator X3, which is connected in parallel with two 22pF capacitors C18 and C19 connected in series. The VDD and VSS interfaces of microcontroller U1 are connected to VCC2 and ground, respectively. Microcontroller U1 is powered through the VBAT interface, which is connected to 1N4148 diodes D7 and D8 and a 10KpF capacitor C23. A 3.3V battery B2 is used, with its two ends connected between capacitor C23 and diode D4. Microcontroller U1 is connected to a set module through the RESET interface. This module includes a 10K ohm resistor R7, a switch K2, and a 10KpF capacitor C20. The circuit consists of a switch K2 and a capacitor C20 connected in parallel, with resistor R7 connected to VCC and capacitor C20 respectively. The Vref-, OSC-IN, and OSC-OUT interfaces of microcontroller U1 are connected to an external high-speed clock module. This high-speed clock module uses an 8MHz crystal oscillator X4, which is connected in parallel with a 1MΩ resistor R9. 22pF capacitors C24 and C25 are connected to both ends of resistor R9. The Vref+, VDDA, and VSSA interfaces of microcontroller U1 are connected to an analog voltage module. A 10µF capacitor C21 and a 10kpF capacitor C22 are connected in parallel between Vref+ and VDDA and the VSSA interface. The 10Ω resistor R8 is connected to VCC2 and the Vref+ and VDDA interfaces respectively. This circuit completes the data acquisition and transmission functions.
[0094] To ensure the smooth operation of the system, the power supply system of the present invention is as follows: Figure 14As shown in the figure. From left to right, VCC1 is a 220V household AC power supply. Four 1N4001GP diodes D1, D2, D3 and D4 are connected in parallel at both ends. Diodes D1, D2, D3 and D4 function as rectifiers in terms of structure and function. Two wires are drawn from diodes D1 and D3 and diodes D2 and D4. One wire connects to a 470uF capacitor C1, a 1K ohm resistor R1, and the bases of two 2N2222A transistors Q1 and Q2. The other wire connects to the other end of capacitor C1, a 22uF capacitor C2, a Zener diode LED1, a 220 ohm resistor R5, a 100uF capacitor C3, a 1000 ohm range variable resistor RP1, and the negative terminal of VCC2. The two wires are connected by capacitor C1, and a series circuit consisting of resistor R1 and capacitor C2 is connected in parallel. At the connection point of resistor R1 and capacitor C2, a wire is drawn to the base of transistor Q1. The collector of transistor Q1 is connected to the collectors of resistor R1 and transistor Q2. The emitter of transistor Q1 is connected to the base of transistor Q2, and the emitter of transistor Q2 is connected to a 1K ohm resistor R2. The other end of resistor R2 is connected to a 1K ohm resistor R3, a Zener diode LED2, a 255 ohm resistor R4, a 100uF capacitor C3, and a 1000 ohm range variable resistor RP1. The other end of resistor R3 is connected to the Zener diode LED1 and the emitter of 2N2222A type transistor Q3. The collector of transistor Q3 is connected to resistor R1, the base of transistor Q1, capacitor C2, and the Zener diode LED2. The base of transistor Q3 is connected to resistors R4 and R5. Moving the sliding end of variable resistor RP1 to 10% and connecting the sliding contact to the positive terminal of VCC2 yields a 5V DC power supply for this invention.
[0095] This invention obtains UAV attitude information based on the attitude adjustment characteristics of UAVs and uses the UAV to acquire corresponding river surface water flow situation images. Based on the characteristics of river surface water flow situation images, a method is proposed to replace the river surface flow velocity situation image with a fusion feature curve of image pixel gray values and directions. Based on the characteristics of the fusion feature curve, a probability mapping function relationship between river surface flow velocity and different gray values and directions is established, and the measured flow velocity is compensated using UAV attitude information.
Claims
1. A method for detecting river surface flow velocity based on AI drone vision technology, characterized in that, Includes the following steps: Step 1: Use a drone to capture images of the surface flow velocity of the river in the monitoring area with known flow velocity, extract the water flow portion from the image frame sequence of the monitoring area, and perform image preprocessing. Step 2: Extract the grayscale values of the preprocessed image and calculate the direction and gradient magnitude corresponding to each pixel. Step 3: Place the pixels into different directional blocks according to their orientation, collect the directional block information corresponding to all image pixels, generate a statistical histogram, and generate a trend curve based on the histogram; Step 4: Determine the flow velocity in the area to be measured by comparing the trend curves of the histogram; The specific steps include: Step 4-1: Label the images in the training database, as follows: (12) In the formula Represents the image training library; There are 101 types of labels representing categories, with values ranging from [1 to 101]. This is the directional region number, with a value range of [1-36]. The vertical coordinate is the area corresponding to the trend curve direction of the histogram, and its value ranges from [0 to 1]. Step 4-2, histogram trend curve calculation: (13) In the formula, S represents the variance between the trend curve of the image histogram of the training database and the trend curve of the histogram of the test image. These represent the average values of data points from the training library images in the first direction region, the second direction region, and the 36th direction region, respectively. These represent the average values of data points in the test image in the first direction region, the second direction region, and the 36th direction region, respectively. Step 4-3, comparing the variance of the histogram trend curve, the process is as follows: (14) In the formula, when When the value range is [0.5-1], the current recognition result is used; when... When the value range is [0-0.5], images need to be added to each category of the image library in the training database for retraining and testing again; The variance of the histogram trend curves of various images and the histogram trend curve of the test image; The number of images in the training library. Number the test images; Pick Corresponding tags The recognition category to which the test image belongs is obtained, and the flow rate of the test image is thus derived, expressed as Equation (15): (15) In the formula The image training library set in equation (12); The measured flow velocity has a range of values and Same, unit is m / s; Step 4-4: Compensate for the flow velocity using the drone's attitude. The process is as follows: (16) In the formula Water surface velocity measured after drone attitude compensation; The surface velocity of the water flow measured under heading angle control; The water surface velocity measured under pitch angle control; The water surface velocity is measured under roll angle control.
2. The method for detecting river surface velocity based on AI drone vision technology according to claim 1, characterized in that: In step 1, the monitoring area is a river section where the water flow velocity is uniformly distributed in the range of 0-10m / s at [1-101], with a velocity interval of 0.1m / s. The monitoring frame sequence is generated by the video frame sequence and photos of the water flow monitoring area taken by the UAV.
3. The method for detecting river surface velocity based on AI drone vision technology according to claim 1, characterized in that: In step 1, the image preprocessing involves scaling, gamma transformation, and grayscale conversion of the image.
4. The method for detecting river surface velocity based on AI UAV vision technology according to claim 1, characterized in that: The grayscale value extraction method is gamma correction.
5. The method for detecting river surface velocity based on AI UAV vision technology according to claim 1, characterized in that: In step 3, the direction corresponding to the image pixel is calculated by calling the kernel function to process the target pixel's top, bottom, left, and right pixels, and then using the modulus and inverse trigonometric function.
6. The method for detecting river surface velocity based on AI drone vision technology according to claim 1, characterized in that: In step 3, the pixels are placed in different regions, with the pixel direction ranging from 1 to 360 degrees, and divided into 36 regions. Pixels with a direction less than 1 degree at the boundary of a region are rounded to the nearest integer. At the same time, the gradient corresponding to the target pixel is accumulated.
7. The method for detecting river surface velocity based on AI UAV vision technology according to claim 1, characterized in that: The process involves batch processing all images by storing the orientation information of each image in a database, training the images to obtain orientation information for each type of image, normalizing each type of image, and then reducing the dimensionality of the captured two-dimensional images to one-dimensional by statistically saving the histogram trend curves of each type of image for each orientation.