Image recognition-based water flow measurement method and system

CN122989804APending Publication Date: 2026-10-27SICHUAN YUHONG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611128445.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0003]有鉴于此,本申请的目的在于提供一种基于图像识别的水流测量方法及系统,以改善现有技术中存在的水流测量的可靠度相对不高的问题

Benefits of technology

[0014]本申请提供的基于图像识别的水流测量方法及系统,首先,对水流表面图像进行梯度计算,以及,基于梯度计算的结果,构建水流纹理表征矩阵;其次,基于水流纹理表征矩阵,对水流表面图像的语义抽取过程进行引导,得到水流纹理全局特征;然后,基于两帧水流表面图像对应的两个水流纹理全局特征,通过进行语义还原操作,得到水流纹理变化距离;最后,基于水流纹理变化距离和两帧水流表面图像之间的采集时间间隔长度,确定出水面区域的水流速度。基于上述内容,一方面,由于水流纹理表征矩阵不仅包括水流纹理在两个方向分别具有的强度,而且还包括在两个方向具有的交叉强度,使得水流纹理表征矩阵对于水流纹理的表征能力更强,使得对于较弱的纹理特征也能够得到较好的表征,另一方面,得到水流纹理表征矩阵之后,并不是直接对水流纹理表征矩阵进行语义的抽取和还原,而是,将水流纹理表征矩阵作为语义抽取的引导依据,原因在于,水流纹理表征矩阵的语义表征指向性较高,但是,语义的丰富性较弱,若直接进行语义的抽取和还原,难以保障得到的水流纹理变化距离的可靠度,因此,将这种指向性较高的语义作为引导依据,以对语义丰富性较高的水流表面图像的语义抽取过程进行引导,使得得到的水流纹理全局特征能够兼顾对水流纹理表征的指向性和丰富性,从而充分保障得到的水流纹理变化距离的可靠度,进而保障得到的水流速度的可靠度。如此,基于本申请提供的方案,可以改善现有技术中存在的水流测量的可靠度相对不高的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122989804A_ABST
    Figure CN122989804A_ABST
Patent Text Reader

Abstract

The application provides an image recognition-based water flow measurement method and system, and relates to the technical field of image analysis.In the application, first, gradient calculation is performed on a water flow surface image, and a water flow texture representation matrix is constructed based on the result of the gradient calculation.Second, the semantic extraction process of the water flow surface image is guided based on the water flow texture representation matrix, and a water flow texture global feature is obtained.Then, based on two water flow texture global features corresponding to two water flow surface images, a water flow texture change distance is obtained by performing a semantic restoration operation.Finally, based on the water flow texture change distance and the length of the time interval between the two water flow surface images, the water flow velocity of the water surface area is determined.Based on the above, the problem of relatively low reliability of water flow measurement in the prior art can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image analysis technology, and more specifically, to a water flow measurement method and system based on image recognition. Background Technology

[0002] The STIV method (Surface Texture Image Velocimetry) does not rely on discrete tracers but extracts continuous texture features of the water surface (such as ripples, flow textures, and scum textures). It calculates flow velocity by analyzing the offset of the texture. Its core assumption is that the water surface texture is continuous; in two adjacent image frames, the shape and grayscale features of the same texture region remain unchanged, only undergoing translational motion. However, the inventors have found that the STIV method is rapidly disrupted by high flow velocities (>5 m / s) or strong turbulence, making matching impossible. Furthermore, it completely fails on smooth, textureless water surfaces (such as mirror-like reservoirs) and has weak resistance to light interference. In other words, extracting only texture features is insufficient to effectively reflect the actual changes in the water surface, making effective flow measurement impossible in complex situations. Summary of the Invention

[0003] In view of this, the purpose of this application is to provide a water flow measurement method and system based on image recognition, so as to improve the problem of relatively low reliability of water flow measurement in the prior art.

[0004] To achieve the above objectives, this application adopts the following technical solution: A water flow measurement method based on image recognition includes: Gradient calculation is performed on the acquired water flow surface image, and a water flow texture representation matrix is ​​constructed based on the gradient calculation result. The water flow texture representation matrix includes at least the intensity of the water flow texture in two directions and the cross intensity in two directions. Based on the water flow texture representation matrix, the semantic extraction process of the water flow surface image is guided to obtain the global features of the water flow texture corresponding to the water flow surface image; Based on the two global features of water flow texture corresponding to the two frames of water flow surface images, the distance of water flow texture change is obtained by performing semantic restoration operation. The two frames of water flow surface images are formed by the same image acquisition device acquiring images of the same water surface area at the same location and at different times based on the same device parameters. The water flow velocity in the water surface area is determined based on the distance of the water flow texture change and the acquisition time interval between the two frames of water flow surface images.

[0005] In a preferred embodiment of this application, the steps of performing gradient calculation on the acquired water flow surface image and constructing a water flow texture representation matrix based on the gradient calculation result in the above-described image-based water flow measurement method include: The acquired water flow surface image is converted to grayscale to form a grayscale image of the water flow surface. Based on the water flow direction in the water flow surface image, the grayscale image of the water flow surface is subjected to convolution filtering to form a filtered water flow surface image. The water flow direction is used to guide the preservation of water flow texture and suppress noise from non-water flow directions during the convolution filtering process. Gradient calculation is performed on the filtered image of the water flow surface, and a water flow texture representation matrix is ​​constructed based on the result of the gradient calculation.

[0006] In a preferred embodiment of this application, in the above-described image recognition-based water flow measurement method, the steps of performing gradient calculation on the filtered water flow surface image and constructing a water flow texture representation matrix based on the gradient calculation result include: The gradients of each pixel in the filtered water surface image in two directions are determined to obtain the first original gradient and the second original gradient of each pixel. The water flow surface filtered image is sampled at multiple scales to form water flow surface sampled images at multiple scales. For each water flow surface sampled image, the gradient of each pixel in the water flow surface sampled image in two directions is determined to obtain the first sampling gradient and the second sampling gradient of each pixel in the water flow surface sampled image. For the filtered water surface image, the sum of the squares of the first original gradient and the second original gradient of each pixel is calculated to obtain the first original intensity and the second original intensity. The sum of the product of the first original gradient and the second original gradient of each pixel is calculated to obtain the original cross intensity. Based on the first original intensity, the second original intensity and the original cross intensity, the original texture representation matrix corresponding to the filtered water surface image is determined. For each of the water flow surface sampling images, the sum of the squares of the first sampling gradient and the second sampling gradient of each pixel is calculated to obtain the first sampling intensity and the second sampling intensity. The sum of the products of the first sampling gradient and the second sampling gradient of each pixel is calculated to obtain the sampling cross intensity. Based on the first sampling intensity, the second sampling intensity and the sampling cross intensity, the sampling texture representation matrix corresponding to the water flow surface sampling image is determined. The original texture representation matrix and the sampled texture representation matrix corresponding to each of the water flow surface sample images are spliced ​​together to form a water flow texture representation matrix.

[0007] In a preferred embodiment of this application, in the above-described image recognition-based water flow measurement method, the step of guiding the semantic extraction process of the water flow surface image based on the water flow texture representation matrix to obtain the global features of the water flow texture corresponding to the water flow surface image includes: The water flow texture representation matrix and the water flow surface image are respectively mapped into the semantic space to form water flow texture semantic features and water flow image semantic features; Based on the semantic features of the water flow texture, the semantic extraction focusing parameters of the semantic features of the water flow image are determined, and based on the feature granularity to be focused in the semantic extraction of the semantic features of the water flow image, the focusing hole parameters corresponding to the feature granularity are determined. Then, based on the semantic extraction focusing parameters and the focusing hole parameters, the semantic features of the water flow image are semantically extracted and focused to form the global features of the water flow texture corresponding to the water flow surface image.

[0008] In a preferred embodiment of this application, in the above-described image recognition-based water flow measurement method, the steps of determining the semantic extraction focusing parameters of the water flow image semantic features based on the water flow texture semantic features, determining the focusing hole parameters corresponding to the feature granularity to be focused in the semantic extraction of the water flow image semantic features, and performing semantic extraction focusing on the water flow image semantic features based on the semantic extraction focusing parameters and the focusing hole parameters to form the global water flow texture features corresponding to the water flow surface image, include: In the first level of semantic extraction focusing, based on the semantic features of the water flow texture, the semantic extraction focusing parameters of this level are determined, and the focusing hole parameters corresponding to this level are obtained. Based on the semantic extraction focusing parameters and the focusing hole parameters, semantic extraction focusing is performed on the semantic features of the water flow image to form the water flow texture focusing features of the first level. The focusing hole parameters of the first level have a minimum value, and the focusing hole parameters of the last level have a maximum value. In the second level of semantic extraction and focusing, based on at least one local semantic feature in the water flow texture semantic features, the semantic extraction and focusing parameters of this level are determined, and the focusing hole parameters corresponding to this level are obtained. Based on the semantic extraction and focusing parameters and the focusing hole parameters, the water flow texture focusing features of the first level are semantically extracted and focused to form the water flow texture focusing features of the second level. In the third level of semantic extraction focusing, based on at least one local semantic feature in the water flow texture semantic features, the semantic extraction focusing parameters of this level are determined, and the focusing hole parameters corresponding to this level are obtained. Based on the semantic extraction focusing parameters and the focusing hole parameters, semantic extraction focusing is performed on the water flow texture focusing features of the second level to form the water flow texture focusing features of the third level. In the process of determining the semantic extraction focusing parameters, the number of local semantic features in the later level is greater than the number of local semantic features in the earlier level, and the feature granularity of the local semantic features in the later level is smaller than the feature granularity of the local semantic features in the earlier level. At least based on the water flow texture focus features of the last level, a global water flow texture feature corresponding to the water flow surface image is formed.

[0009] In a preferred embodiment of this application, in the above-described image recognition-based water flow measurement method, the step of determining the semantic extraction focusing parameters for the second level of semantic extraction focusing based on at least one local semantic feature in the water flow texture semantic features, obtaining the focusing hole parameters corresponding to that level, and performing semantic extraction focusing on the water flow texture focusing features of the first level based on the semantic extraction focusing parameters and the focusing hole parameters to form the water flow texture focusing features of the second level, includes: In the second level of semantic extraction focusing, based on the feature granularity corresponding to this level, the semantic features of the water flow texture are truncated to obtain at least one local semantic feature. Then, each local semantic feature is linearly mapped and nonlinearly activated to obtain the corresponding feature importance representation parameter. Finally, the feature importance representation parameters corresponding to each local semantic feature are fused to obtain the semantic extraction focusing parameter of this level. Obtain the focusing hole parameters for the second level; Based on the semantic extraction focusing parameters and the focusing hole parameters of the second level, semantic extraction focusing is performed on the water flow texture focusing features of the first level to form the water flow texture focusing features of the second level.

[0010] In a preferred embodiment of this application, in the above-described image recognition-based water flow measurement method, the step of semantically extracting and focusing the first-level water flow texture focusing features based on the second-level semantic extraction focusing parameters and the second-level focusing hole parameters to form the second-level water flow texture focusing features includes: Based on the focusing hole parameters of the second level, the focusing features of the water flow texture of the first level are subjected to hole convolution to form the water flow texture hole features of the second level. Based on the semantic extraction focusing parameters of the second level, the water flow texture hole features of the second level are weighted and focused to form the water flow texture focusing features of the second level.

[0011] In a preferred embodiment of this application, in the above-mentioned image recognition-based water flow measurement method, the step of obtaining the water flow texture change distance by performing semantic reconstruction based on two global features of water flow texture corresponding to two frames of water flow surface images includes: The difference between two global features of water flow texture corresponding to two frames of water flow surface images is determined to obtain water flow texture difference features; The two global features of water flow texture and the difference features of water flow texture are spliced ​​together to form the target feature, and the semantic restoration operation is performed on the target feature to obtain the water flow texture change distance.

[0012] In a preferred embodiment of this application, in the above-described image recognition-based water flow measurement method, the step of determining the difference between two global features of water flow texture corresponding to two frames of water flow surface images to obtain water flow texture difference features includes: The two global features of water flow texture corresponding to two frames of water flow surface images are subtracted to obtain the original texture difference features. Then, the original texture difference features are linearly mapped and nonlinearly activated to obtain the feature importance characterization parameters. The two global features of water flow texture and the feature importance representation parameters are compressed to form two compressed features of water flow texture and compressed feature importance parameters. The two water flow texture compression features are subtracted to obtain compressed texture difference features. Based on the feature importance compression parameters, the compressed texture difference features are weighted and focused to form focused texture difference features. Based on the original texture difference features, the compressed texture difference features, and the focused texture difference features, the water flow texture difference features are determined.

[0013] Based on the above, this application also provides a water flow measurement system based on image recognition, comprising: Memory, used to store computer programs; A processor connected to the memory is used to execute the computer program stored in the memory to implement the above-described image recognition-based water flow measurement method.

[0014] The water flow measurement method and system based on image recognition provided in this application firstly calculates the gradient of the water flow surface image and constructs a water flow texture representation matrix based on the gradient calculation result; secondly, based on the water flow texture representation matrix, the semantic extraction process of the water flow surface image is guided to obtain global features of the water flow texture; then, based on the two global features of the water flow texture corresponding to two frames of water flow surface images, the water flow texture change distance is obtained by performing a semantic restoration operation; finally, based on the water flow texture change distance and the acquisition time interval between two frames of water flow surface images, the water flow velocity in the water surface area is determined. Based on the above, on the one hand, since the water flow texture representation matrix includes not only the intensity of the water flow texture in both directions but also the intersection intensity in both directions, the water flow texture representation matrix has a stronger representation ability for water flow textures, enabling even weaker texture features to be represented well. On the other hand, after obtaining the water flow texture representation matrix, semantic extraction and restoration are not performed directly on it. Instead, the water flow texture representation matrix is ​​used as a guiding basis for semantic extraction. This is because the semantic representation of the water flow texture representation matrix has high directionality but weak semantic richness. If semantic extraction and restoration are performed directly, it is difficult to guarantee the reliability of the obtained water flow texture change distance. Therefore, this highly directional semantic is used as a guiding basis to guide the semantic extraction process of the semantically rich water flow surface image, so that the obtained global features of the water flow texture can take into account both the directionality and richness of the water flow texture representation, thereby fully guaranteeing the reliability of the obtained water flow texture change distance, and thus ensuring the reliability of the obtained water flow velocity. Thus, based on the solution provided in this application, the problem of relatively low reliability of water flow measurement in the prior art can be improved. Attached Figure Description

[0015] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings.

[0016] Figure 1 This is a structural block diagram of an image recognition-based water flow measurement system provided in an embodiment of this application.

[0017] Figure 2 This is a flowchart illustrating the water flow measurement method based on image recognition provided in an embodiment of this application.

[0018] Figure 3 This is a schematic diagram of semantic extraction focusing provided in an embodiment of this application. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0020] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0021] like Figure 1 As shown in the figure, this application provides an image recognition-based water flow measurement system. The image recognition-based water flow measurement system may include a memory, a processor, and an image recognition-based water flow measurement device.

[0022] In detail, the memory and the processor are electrically connected directly or indirectly to enable data transmission or interaction. For example, the memory and the processor can be electrically connected via one or more communication buses or signal lines. The image recognition-based water flow measurement device includes at least one software functional module stored in the memory in the form of software or firmware. The processor is used to execute executable computer programs stored in the memory, such as the software functional modules and computer programs included in the image recognition-based water flow measurement device, to implement the image recognition-based water flow measurement method provided in this application embodiment.

[0023] Optionally, the memory may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.

[0024] Optionally, the processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a system on chip (SoC), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0025] Optionally, the image recognition-based water flow measurement device may include: A matrix construction module is used to perform gradient calculation on the acquired water flow surface image, and to construct a water flow texture representation matrix based on the gradient calculation result, wherein the water flow texture representation matrix includes at least the intensity of the water flow texture in two directions and the cross intensity in two directions. The semantic guidance module is used to guide the semantic extraction process of the water flow surface image based on the water flow texture representation matrix, so as to obtain the global features of the water flow texture corresponding to the water flow surface image. The semantic restoration module is used to obtain the distance of water flow texture change by performing semantic restoration operation on two global features of water flow texture corresponding to two frames of water flow surface images. The two frames of water flow surface images are formed by the same image acquisition device acquiring images of the same water surface area at the same location and at different times based on the same device parameters. The flow velocity determination module is used to determine the water flow velocity in the water surface area based on the water flow texture change distance and the acquisition time interval between the two frames of water flow surface images.

[0026] Understandable Figure 1 The structure shown is for illustrative purposes only; the image recognition-based water flow measurement system may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown may include, for example, a communication unit for exchanging information with other devices, such as image acquisition devices.

[0027] Combination Figure 2 This application also provides an image recognition-based water flow measurement method applicable to the aforementioned image recognition-based water flow measurement system. The method steps defined in the process of the image recognition-based water flow measurement method can be implemented by the image recognition-based water flow measurement system. The following will describe... Figure 2 The specific process shown will be explained in detail.

[0028] Step S110: Perform gradient calculation on the acquired water flow surface image, and construct a water flow texture representation matrix based on the gradient calculation results.

[0029] In this embodiment of the invention, the image recognition-based water flow measurement system can perform gradient calculation on the acquired water flow surface image, and construct a water flow texture representation matrix based on the gradient calculation result. The water flow texture representation matrix includes at least the intensity of the water flow texture in two directions and the cross intensity in the two directions. It should be noted that the image recognition-based water flow measurement system can be connected to an image acquisition device or a database storing water flow surface images to acquire the water flow surface images. Furthermore, the two directions corresponding to the intensity of the water flow texture can refer to the horizontal direction (row direction) and the vertical direction (column direction) of the water flow surface image. Additionally, it should be noted that, to facilitate the capture of the water flow texture, the direction of the water flow when acquiring and forming the water flow surface image can be either the vertical direction or the horizontal direction of the water flow surface image.

[0030] Step S120: Based on the water flow texture representation matrix, guide the semantic extraction process of the water flow surface image to obtain the global features of the water flow texture corresponding to the water flow surface image.

[0031] In this embodiment of the invention, after obtaining the water flow texture representation matrix, the image recognition-based water flow measurement system can guide the semantic extraction process of the water flow surface image based on the water flow texture representation matrix to obtain the global features of the water flow texture corresponding to the water flow surface image. That is, guided by the water flow texture representation matrix, the semantic extraction process of the water flow surface image can focus on or tend to capture the potential semantics related to the water flow texture in the water flow surface image, thereby improving the accuracy of the obtained global features of the water flow texture in the semantic space related to the water flow texture.

[0032] Step S130: Based on the two global features of water flow texture corresponding to the two frames of water flow surface images, the distance of water flow texture change is obtained by performing semantic restoration operation.

[0033] In this embodiment of the invention, after obtaining the global features of the water flow texture, the image recognition-based water flow measurement system can obtain the water flow texture change distance by performing semantic restoration operations based on the two global features of the water flow texture corresponding to two frames of water flow surface images. The two frames of water flow surface images are formed by the same image acquisition device acquiring images of the same water surface area at the same location and at different times using the same device parameters. For example, the two types of water flow surface images can be two consecutive frames acquired by the same image acquisition device at the same location and using the same device parameters for the same water surface area.

[0034] Step S140: Determine the water flow velocity in the water surface area based on the water flow texture change distance and the acquisition time interval between the two frames of water flow surface images.

[0035] In this embodiment of the invention, after obtaining the water flow texture change distance, the image recognition-based water flow measurement system can determine the water flow velocity in the water surface area based on the water flow texture change distance and the acquisition time interval between two frames of water flow surface images. For example, the ratio between the water flow texture change distance and the acquisition time interval can be calculated to obtain the speed of water flow texture change, which is taken as the water flow velocity.

[0036] Based on the above, on the one hand, since the water flow texture representation matrix includes not only the intensity of the water flow texture in both directions but also the intersection intensity in both directions, the water flow texture representation matrix has a stronger representation ability for water flow textures, enabling even weaker texture features to be represented well. On the other hand, after obtaining the water flow texture representation matrix, semantic extraction and restoration are not performed directly on it. Instead, the water flow texture representation matrix is ​​used as a guiding basis for semantic extraction. This is because the semantic representation of the water flow texture representation matrix has high directionality but weak semantic richness. If semantic extraction and restoration are performed directly, it is difficult to guarantee the reliability of the obtained water flow texture change distance. Therefore, this highly directional semantic is used as a guiding basis to guide the semantic extraction process of the semantically rich water flow surface image, so that the obtained global features of the water flow texture can take into account both the directionality and richness of the water flow texture representation, thereby fully guaranteeing the reliability of the obtained water flow texture change distance, and thus ensuring the reliability of the obtained water flow velocity. Thus, based on the solution provided in this application, the problem of relatively low reliability of water flow measurement in the prior art can be improved.

[0037] Firstly, regarding step S110, it should be noted that the specific method for constructing the water flow texture representation matrix is ​​not limited and can be selected according to actual needs.

[0038] For example, in an alternative implementation, in order to improve the accuracy of the constructed water flow texture representation matrix, the above step S110 may further include steps S111, S112 and S113, wherein the specific contents of each step are as follows.

[0039] Step S111: The acquired water flow surface image is converted to grayscale to form a grayscale image of the water flow surface.

[0040] In this embodiment, the acquired water surface image can be converted to grayscale to form a grayscale water surface image. That is, the water surface image, which is an RGB image, can be converted into a grayscale image to obtain the grayscale water surface image. The grayscale image conversion method can refer to relevant prior art and is not specifically limited here.

[0041] Step S112: Based on the water flow direction in the water flow surface image, perform convolution filtering on the grayscale image of the water flow surface to form a filtered image of the water flow surface.

[0042] In this embodiment, after obtaining the grayscale image of the water flow surface, convolution filtering can be performed on the grayscale image based on the water flow direction in the water flow surface image to form a filtered water flow surface image. The water flow direction is used to guide the preservation of water flow texture and suppress noise from non-flow directions during the convolution filtering process. For example, a 1×5 convolution kernel aligned with the main water flow direction can be used to preserve texture features and suppress vertical noise (such as wind ripples and reflections). That is, the direction of the convolution kernel for directional filtering can be adjusted according to the actual water flow direction (e.g., if the water flow is along the x-direction, the convolution kernel can be [1,2,3,2,1]), otherwise, effective texture will be filtered out. Additionally, in some embodiments, texture enhancement can be performed, such as using the Retinex algorithm to eliminate the influence of uneven lighting and improve texture contrast.

[0043] Step S113: Perform gradient calculation on the filtered image of the water flow surface, and construct a water flow texture representation matrix based on the gradient calculation result.

[0044] In this embodiment of the application, after obtaining the water flow surface filtered image, gradient calculation can be performed on the water flow surface filtered image, and a water flow texture representation matrix can be constructed based on the result of the gradient calculation.

[0045] It is understood that the specific method of constructing the water flow texture representation matrix based on the gradient calculation result in step S113 is not limited. For example, in an alternative implementation, in order to improve the representation ability of the constructed water flow texture representation matrix for water flow texture, step S113 may further include steps S113a, S113b, S113c, S113d and S113e, wherein the specific contents of each step are as follows.

[0046] Step S113a: Determine the gradient of each pixel in the water flow surface filtered image in two directions, and obtain the first original gradient and the second original gradient of each pixel.

[0047] In this embodiment, the gradients of each pixel in the filtered water surface image in two directions can be determined, resulting in a first original gradient and a second original gradient for each pixel. For example, a 3×3 Sobel operator can be used to calculate the gradients in the x and y directions, thereby obtaining the first original gradient and the second original gradient.

[0048] Step S113b: Perform multi-scale sampling on the water flow surface filtered image to form multiple scale water flow surface sampled images; and for each water flow surface sampled image, determine the gradient of each pixel in the water flow surface sampled image in two directions, and obtain the first sampling gradient and the second sampling gradient of each pixel in the water flow surface sampled image.

[0049] In this embodiment, the water flow surface filtered image can also be sampled at multiple scales (multiple scales of sampling can all be downsampling, or all can be upsampling, or a combination of downsampling and upsampling, depending on the actual situation; in addition, the upsampling and downsampling methods can also be selected according to the actual situation) to form multiple scale water flow surface sampling images. Furthermore, for each of the water flow surface sampling images, the gradients of each pixel in the water flow surface sampling image in the two directions can be determined (referring to the determination methods of the first original gradient and the second original gradient), to obtain the first sampling gradient and the second sampling gradient of each pixel in the water flow surface sampling image.

[0050] Step S113c: For the water flow surface filtered image, calculate the sum of squares of the first original gradient and the second original gradient of each pixel to obtain the first original intensity and the second original intensity, and calculate the sum of the product of the first original gradient and the second original gradient of each pixel to obtain the original cross intensity. Based on the first original intensity, the second original intensity and the original cross intensity, determine the original texture representation matrix corresponding to the water flow surface filtered image.

[0051] In this embodiment, after obtaining the first original gradient and the second original gradient, for the filtered water surface image, the sum of the squares of the first original gradient and the second original gradient of each pixel can be calculated to obtain the first original intensity and the second original intensity. The sum of the products of the first original gradient and the second original gradient of each pixel can be calculated to obtain the original cross intensity. Based on the first original intensity, the second original intensity, and the original cross intensity, the original texture representation matrix corresponding to the filtered water surface image is determined. For example, the original texture representation matrix can be as follows: ; in, , , where represent the sum of squares of the gradients in the x and y directions, respectively, describing the intensity of the texture in the two directions; , represents the sum of the products of gradients in the x and y directions, and describes the cross intensity of the texture; , These represent the gradients in the x and y directions, respectively.

[0052] Step S113d: For each of the water flow surface sampling images, calculate the sum of the squares of the first sampling gradient and the second sampling gradient of each pixel to obtain the first sampling intensity and the second sampling intensity, and calculate the sum of the products of the first sampling gradient and the second sampling gradient of each pixel to obtain the sampling cross intensity. Based on the first sampling intensity, the second sampling intensity and the sampling cross intensity, determine the sampling texture representation matrix corresponding to the water flow surface sampling image.

[0053] In this embodiment of the application, after obtaining the first sampling gradient and the second sampling gradient, for each of the water flow surface sampling images, the sum of the squares of the first sampling gradient and the second sampling gradient of each pixel can be calculated to obtain the first sampling intensity and the second sampling intensity, and the sum of the products of the first sampling gradient and the second sampling gradient of each pixel can be calculated to obtain the sampling cross intensity. Based on the first sampling intensity, the second sampling intensity and the sampling cross intensity, the sampling texture representation matrix corresponding to the water flow surface sampling image is determined.

[0054] Step S113e: Concatenate the original texture representation matrix and the sampled texture representation matrix corresponding to each of the water flow surface sample images to form a water flow texture representation matrix.

[0055] In this embodiment of the application, after obtaining the original texture representation matrix and the sampling texture representation matrix corresponding to each of the water flow surface sampling images, the original texture representation matrix and the sampling texture representation matrix corresponding to each of the water flow surface sampling images can be spliced ​​together to form a water flow texture representation matrix. In this way, the water flow texture representation matrix can represent water flow textures at various scales (resolutions), and the representation capability is greatly improved.

[0056] Secondly, regarding step S120, it should be noted that the specific method for obtaining the global features of the water flow texture corresponding to the water flow surface image is not limited and can be selected according to actual needs.

[0057] For example, in an alternative implementation, in order to improve the accuracy of guidance during the semantic extraction process and make the globality of the resulting water flow texture global features better, the above step S120 may further include steps S121 and S122, wherein the specific contents of each step are as follows.

[0058] Step S121: Map the water flow texture representation matrix and the water flow surface image into the semantic space respectively to form water flow texture semantic features and water flow image semantic features.

[0059] In this embodiment, the water flow texture representation matrix and the water flow surface image can be mapped into a semantic space to form water flow texture semantic features and water flow image semantic features. For example, a convolutional neural network can be used to perform convolution processing on the water flow texture representation matrix and the water flow surface image (the specific processing procedure can refer to relevant prior art) to form water flow texture semantic features (used to represent the semantic information in the water flow texture representation matrix) and water flow image semantic features (used to represent the semantic information in the water flow surface image).

[0060] Step S122: Based on the semantic features of the water flow texture, determine the semantic extraction focusing parameters of the semantic features of the water flow image, and based on the feature granularity to be focused in the semantic extraction of the semantic features of the water flow image, determine the focusing hole parameters corresponding to the feature granularity, and perform semantic extraction focusing on the semantic features of the water flow image based on the semantic extraction focusing parameters and the focusing hole parameters to form the global features of the water flow texture corresponding to the water flow surface image.

[0061] In this embodiment, after obtaining the water flow texture semantic features and the water flow image semantic features, the semantic extraction focusing parameters of the water flow image semantic features can be determined based on the water flow texture semantic features. Furthermore, based on the feature granularity to be focused on in the semantic extraction of the water flow image semantic features, the focusing hole parameters corresponding to that feature granularity are determined. Finally, semantic extraction focusing is performed on the water flow image semantic features based on the semantic extraction focusing parameters and the focusing hole parameters, forming the global water flow texture features corresponding to the water flow surface image. In other words, an air conditioning mechanism is introduced during the semantic extraction focusing process, making it easier to capture global semantics with a larger field of view. Moreover, the focusing hole parameters are matched to the feature granularity, allowing for the capture of larger and different fields of global semantics through multiple focusing hole parameters, further improving the semantic capture capability.

[0062] It is understood that the specific method of semantic extraction focusing in step S122 above is not limited. For example, in an alternative implementation, in order to further improve the accuracy of semantic extraction focusing, step S122 above may further include steps S122a, S122b, S122c and S122d, wherein the specific contents of each step are as follows.

[0063] Step S122a: In the first level of semantic extraction focusing, based on the semantic features of the water flow texture, the semantic extraction focusing parameters of the level are determined, and the focusing hole parameters corresponding to the level are obtained. Based on the semantic extraction focusing parameters and the focusing hole parameters, semantic extraction focusing is performed on the semantic features of the water flow image to form the water flow texture focusing features of the first level.

[0064] In the embodiments of this application, combined with Figure 3 In the first level of semantic extraction focusing, the semantic extraction focusing parameters for that level can be determined based on the semantic features of the water flow texture, and the corresponding focusing hole parameters can be obtained. Furthermore, based on these semantic extraction focusing parameters and focusing hole parameters, semantic extraction focusing is performed on the semantic features of the water flow image to form the water flow texture focusing features of the first level. The focusing hole parameter of the first level has a minimum value, while the focusing hole parameter of the last level has a maximum value. That is, as the level of semantic extraction focusing increases, the focusing hole parameter gradually increases, i.e., semantic capture progresses from a smaller field of view to a larger field of view. It should also be noted that the focusing hole parameters for each level can be formed during the training process of the corresponding neural network model, and the specific values ​​are not limited. Initially, they can be randomly set; for example, the minimum focusing hole parameter (i.e., the hole rate) can be 2.

[0065] Step S122b: In the second level of semantic extraction focusing, based on at least one local semantic feature in the water flow texture semantic features, the semantic extraction focusing parameters of this level are determined, and the focusing hole parameters corresponding to this level are obtained. Based on the semantic extraction focusing parameters and the focusing hole parameters, semantic extraction focusing is performed on the water flow texture focusing features of the first level to form the water flow texture focusing features of the second level.

[0066] In this embodiment, in the second level of semantic extraction focusing, the semantic extraction focusing parameters for that level can be determined based on at least one local semantic feature in the water flow texture semantic features, and the focusing hole parameters corresponding to that level can be obtained. Furthermore, based on the semantic extraction focusing parameters and the focusing hole parameters, semantic extraction focusing is performed on the water flow texture focusing features of the first level to form the water flow texture focusing features of the second level. Step S122c: In the third level of semantic extraction and focusing, based on at least one local semantic feature in the water flow texture semantic features, the semantic extraction and focusing parameters of this level are determined, and the focusing hole parameters corresponding to this level are obtained. Based on the semantic extraction and focusing parameters and the focusing hole parameters, semantic extraction and focusing are performed on the water flow texture focusing features of the second level to form the water flow texture focusing features of the third level.

[0067] In this embodiment, in the third level of semantic extraction focusing, the semantic extraction focusing parameters for that level can be determined based on at least one local semantic feature among the water flow texture semantic features, and the focusing hole parameters corresponding to that level can be obtained. Furthermore, based on the semantic extraction focusing parameters and the focusing hole parameters, semantic extraction focusing is performed on the water flow texture focusing features of the second level to form the water flow texture focusing features of the third level. In determining the semantic extraction focusing parameters, the number of local semantic features in the later level is greater than the number of local semantic features in the earlier level, and the feature granularity of the local semantic features in the later level is smaller than the feature granularity of the local semantic features in the earlier level. That is, as the level increases, the feature granularity gradually decreases, and the size of the corresponding local semantic features decreases. It should be noted that as the level increases, that is, as the semantic extraction focus progresses, the semantics of the water flow texture focus features become increasingly abstract. Therefore, at lower levels, a smaller focus hole parameter is used to better capture detailed information, while at higher levels, a larger focus hole parameter is used to capture advanced abstract semantics and complex relationships from a broader perspective.

[0068] Step S122d: Based at least on the water flow texture focus features of the last level, form the global water flow texture features corresponding to the water flow surface image.

[0069] In this embodiment, after obtaining the water flow texture focus feature of the last level, a global water flow texture feature corresponding to the water flow surface image is formed based on at least the water flow texture focus feature of the last level. For example, the water flow texture focus feature of the last level can be determined as the global water flow texture feature corresponding to the water flow surface image; or, the global water flow texture feature can be obtained by concatenating the water flow texture focus features of each level.

[0070] It is understood that in the above steps S122a, S122b, and S122c, semantic extraction focuses on the same processing method at each level. In this embodiment, the specific processing procedure of step S122b is used as an example for explanation. That is, step S122b may further include steps b1, b2, and b3, the specific contents of each step are as follows.

[0071] Step b1: In the second level of semantic extraction focusing, based on the feature granularity corresponding to this level, feature truncation is performed on the water flow texture semantic features to obtain at least one local semantic feature. Then, linear mapping and nonlinear activation are performed on each local semantic feature to obtain the corresponding feature importance representation parameters. Finally, the feature importance representation parameters corresponding to each local semantic feature are fused to obtain the semantic extraction focusing parameters for this level.

[0072] In this embodiment, in the second level of semantic extraction focusing, the semantic features of the water flow texture can be truncated based on the feature granularity corresponding to the level to obtain at least one local semantic feature (for example, each feature granularity can correspond to a rectangle with a corresponding size, so that the semantic features of the water flow texture can be truncated through the rectangle to obtain a local semantic feature, or multiple feature truncations can be performed to obtain multiple local semantic features). Furthermore, each local semantic feature is subjected to linear mapping (e.g., implemented through a multilayer perceptron) and nonlinear activation (e.g., implemented through a sigmoid function) to obtain the corresponding feature importance representation parameters. Finally, the feature importance representation parameters corresponding to each local semantic feature are fused (e.g., mean calculation) to obtain the semantic extraction focusing parameters for that level.

[0073] Step b2: Obtain the focusing hole parameters for the second level.

[0074] In this embodiment of the application, the focusing cavity parameters of the second level can be obtained.

[0075] Step b3: Based on the semantic extraction focusing parameters and the focusing hole parameters of the second level, semantic extraction focusing is performed on the water flow texture focusing features of the first level to form the water flow texture focusing features of the second level.

[0076] In this embodiment, after obtaining the second-level semantic extraction focusing parameters and the second-level focusing hole parameters, semantic extraction focusing can be performed on the first-level water flow texture focusing features based on these parameters to form the second-level water flow texture focusing features. It should be noted that since the local semantic features mapped to the semantic extraction focusing parameters are formed by feature truncation, their size is generally smaller than the first-level water flow texture focusing features. Therefore, during semantic extraction focusing, the first-level water flow texture focusing features can be compressed using convolution, pooling, etc., so that the size of the compressed features is the same as the size of the second-level semantic extraction focusing parameters.

[0077] It is understood that the specific method of semantic extraction and focusing in step b3 above is not limited. For example, in an alternative implementation, step b3 includes: First, based on the focusing hole parameter of the second level, dilated convolution can be performed on the focusing features of the water flow texture of the first level to form the water flow texture hole features of the second level. That is, the focusing hole parameter is used as the hole rate of the dilated convolution. In addition, parameters such as the stride of the dilated convolution can be configured according to actual needs, so that while capturing abstract semantics with a larger field of view through dilated convolution, feature size compression can also be achieved, so that the size of the water flow texture hole features of the second level is equal to the semantic extraction focusing of the second level. Secondly, based on the semantic extraction focusing parameters of the second level, the water flow texture hole features of the second level can be weighted and focused (i.e., multiplied bitwise) to form the water flow texture focusing features of the second level.

[0078] Thirdly, regarding step S130, it should be noted that the specific method for obtaining the water flow texture change distance is not limited and can be selected according to actual needs.

[0079] For example, in an alternative implementation, in order to improve the reliability of semantic reconstruction, the above step S130 may further include steps S131 and S132, wherein the specific contents of each step are as follows.

[0080] Step S131: Determine the difference between the two global features of water flow texture corresponding to the two frames of water flow surface images to obtain the water flow texture difference features.

[0081] In this embodiment, the difference between two global features of water flow texture corresponding to two frames of water flow surface images can be determined to obtain water flow texture difference features. That is, the semantic information of water flow texture changes can be characterized by the water flow texture difference features.

[0082] Step S132: Concatenate the two global features of water flow texture and the difference features of water flow texture to form a target feature, and perform semantic restoration operation on the target feature to obtain the water flow texture change distance.

[0083] In this embodiment, after obtaining the water flow texture difference features, the two global water flow texture features and the water flow texture difference features can be concatenated to form a target feature. Then, a semantic restoration operation is performed on the target feature to obtain the water flow texture change distance. For example, the target feature can be mapped using a fully connected network layer to form a target fully connected feature. The size of this target fully connected feature can be 1*1, meaning it includes one feature parameter. Then, a linear mapping or an identity mapping can be performed on this feature parameter to obtain the water flow texture change distance. The linear mapping can be implemented using the function y=Ax+b, and the identity mapping is y=x.

[0084] It is understood that the specific method of obtaining the water flow texture difference features in step S131 above is not limited. For example, in an alternative embodiment, in order to improve the full representation of the semantics of water flow texture changes by the obtained water flow texture difference features, step S131 above may further include steps S131a, S131b, S131c and S131d, wherein the specific contents of each step are as follows.

[0085] Step S131a: The two global features of water flow texture corresponding to the two frames of water flow surface images are subtracted to obtain the original texture difference features. Then, the original texture difference features are linearly mapped and nonlinearly activated to obtain the feature importance representation parameters.

[0086] In this embodiment of the application, the two global features of water flow texture corresponding to two frames of water flow surface images can be subtracted to obtain the original texture difference features. Then, the original texture difference features can be linearly mapped and nonlinearly activated (as described above) to obtain the feature importance characterization parameters.

[0087] Step S131b: Compress the two global features of the water flow texture and the feature importance representation parameters respectively to form two compressed features of the water flow texture and compressed features of the feature importance.

[0088] In this embodiment of the application, after obtaining the feature importance representation parameters, the two global features of water flow texture and the feature importance representation parameters can be compressed to form two compressed features of water flow texture and compressed features of feature importance. It should be noted that the compression methods of the two global features of water flow texture and the feature importance representation parameters are the same, such as compression by mean pooling. In this way, compressed features of water flow texture at other scales and corresponding compressed features of feature importance can be formed.

[0089] Step S131c: The two water flow texture compression features are subtracted to obtain compressed texture difference features. Based on the feature importance compression parameters, the compressed texture difference features are weighted and focused to form focused texture difference features.

[0090] In this embodiment, after obtaining the two compressed water flow texture features, the two compressed water flow texture features can be subtracted to obtain compressed texture difference features. Furthermore, based on the feature importance compression parameters, the compressed texture difference features are weighted and focused to form focused texture difference features. That is, after obtaining compressed texture difference features at other scales, weighted and focused features can be formed based on the feature importance compression parameters of the corresponding size, thus achieving further difference focusing and making the formed focused texture difference features more focused on representing the semantic information of differences.

[0091] Step S131d: Based on the original texture difference features, the compressed texture difference features, and the focused texture difference features, the water flow texture difference features are determined.

[0092] In this embodiment of the application, after obtaining the compressed texture difference feature and the focused texture difference feature, the water flow texture difference feature can be determined based on the original texture difference feature, the compressed texture difference feature and the focused texture difference feature. For example, the original texture difference feature, the compressed texture difference feature and the focused texture difference feature can be spliced, averaged and other processed to achieve the aggregation of water flow texture change semantics at multiple scales.

[0093] In summary, the image recognition-based water flow measurement method and system provided in this application firstly calculates the gradient of the water flow surface image and constructs a water flow texture representation matrix based on the gradient calculation result; secondly, based on the water flow texture representation matrix, the semantic extraction process of the water flow surface image is guided to obtain global features of the water flow texture; then, based on the two global features of the water flow texture corresponding to two frames of water flow surface images, the water flow texture change distance is obtained by performing a semantic restoration operation; finally, based on the water flow texture change distance and the acquisition time interval between two frames of water flow surface images, the water flow velocity in the water surface area is determined. Based on the above, on the one hand, since the water flow texture representation matrix includes not only the intensity of the water flow texture in both directions but also the intersection intensity in both directions, the water flow texture representation matrix has a stronger representation ability for water flow textures, enabling even weaker texture features to be represented well. On the other hand, after obtaining the water flow texture representation matrix, semantic extraction and restoration are not performed directly on it. Instead, the water flow texture representation matrix is ​​used as a guiding basis for semantic extraction. This is because the semantic representation of the water flow texture representation matrix has high directionality but weak semantic richness. If semantic extraction and restoration are performed directly, it is difficult to guarantee the reliability of the obtained water flow texture change distance. Therefore, this highly directional semantic is used as a guiding basis to guide the semantic extraction process of the semantically rich water flow surface image, so that the obtained global features of the water flow texture can take into account both the directionality and richness of the water flow texture representation, thereby fully guaranteeing the reliability of the obtained water flow texture change distance, and thus ensuring the reliability of the obtained water flow velocity. Thus, based on the solution provided in this application, the problem of relatively low reliability of water flow measurement in the prior art can be improved.

[0094] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A water flow measurement method based on image recognition, characterized in that, include: Gradient calculation is performed on the acquired water flow surface image, and a water flow texture representation matrix is ​​constructed based on the gradient calculation result. The water flow texture representation matrix includes at least the intensity of the water flow texture in two directions and the cross intensity in two directions. Based on the water flow texture representation matrix, the semantic extraction process of the water flow surface image is guided to obtain the global features of the water flow texture corresponding to the water flow surface image; Based on the two global features of water flow texture corresponding to the two frames of water flow surface images, the distance of water flow texture change is obtained by performing semantic restoration operation. The two frames of water flow surface images are formed by the same image acquisition device acquiring images of the same water surface area at the same location and at different times based on the same device parameters. The water flow velocity in the water surface area is determined based on the distance of the water flow texture change and the acquisition time interval between the two frames of water flow surface images.

2. The water flow measurement method based on image recognition according to claim 1, characterized in that, The steps of performing gradient calculation on the acquired water flow surface image and constructing a water flow texture representation matrix based on the gradient calculation results include: The acquired water flow surface image is converted to grayscale to form a grayscale image of the water flow surface. Based on the water flow direction in the water flow surface image, the grayscale image of the water flow surface is subjected to convolution filtering to form a filtered water flow surface image. The water flow direction is used to guide the preservation of water flow texture and suppress noise from non-water flow directions during the convolution filtering process. Gradient calculation is performed on the filtered image of the water flow surface, and a water flow texture representation matrix is ​​constructed based on the result of the gradient calculation.

3. The water flow measurement method based on image recognition according to claim 2, characterized in that, The steps of performing gradient calculation on the filtered image of the water flow surface and constructing a water flow texture representation matrix based on the gradient calculation results include: The gradients of each pixel in the filtered water surface image in two directions are determined to obtain the first original gradient and the second original gradient of each pixel. The filtered water flow surface image is sampled at multiple scales to form multiple scale water flow surface sample images. For each water flow surface sample image, the gradient of each pixel in the water flow surface sample image in two directions is determined to obtain the first sampling gradient and the second sampling gradient of each pixel in the water flow surface sample image. For the filtered water surface image, the sum of the squares of the first original gradient and the second original gradient of each pixel is calculated to obtain the first original intensity and the second original intensity. The sum of the product of the first original gradient and the second original gradient of each pixel is calculated to obtain the original cross intensity. Based on the first original intensity, the second original intensity and the original cross intensity, the original texture representation matrix corresponding to the filtered water surface image is determined. For each of the water flow surface sampling images, the sum of the squares of the first sampling gradient and the second sampling gradient of each pixel is calculated to obtain the first sampling intensity and the second sampling intensity. The sum of the products of the first sampling gradient and the second sampling gradient of each pixel is calculated to obtain the sampling cross intensity. Based on the first sampling intensity, the second sampling intensity and the sampling cross intensity, the sampling texture representation matrix corresponding to the water flow surface sampling image is determined. The original texture representation matrix and the sampled texture representation matrix corresponding to each of the water flow surface sample images are spliced ​​together to form a water flow texture representation matrix.

4. The water flow measurement method based on image recognition according to claim 1, characterized in that, The step of guiding the semantic extraction process of the water flow surface image based on the water flow texture representation matrix to obtain the global features of the water flow texture corresponding to the water flow surface image includes: The water flow texture representation matrix and the water flow surface image are respectively mapped into the semantic space to form water flow texture semantic features and water flow image semantic features; Based on the semantic features of the water flow texture, the semantic extraction focusing parameters of the semantic features of the water flow image are determined, and based on the feature granularity to be focused in the semantic extraction of the semantic features of the water flow image, the focusing hole parameters corresponding to the feature granularity are determined. Then, based on the semantic extraction focusing parameters and the focusing hole parameters, the semantic features of the water flow image are semantically extracted and focused to form the global features of the water flow texture corresponding to the water flow surface image.

5. The water flow measurement method based on image recognition according to claim 4, characterized in that, The steps of determining the semantic extraction focusing parameters of the semantic features of the water flow image based on the semantic features of the water flow texture, determining the focusing hole parameters corresponding to the feature granularity to be focused in the semantic extraction of the semantic features of the water flow image, and performing semantic extraction focusing on the semantic features of the water flow image based on the semantic extraction focusing parameters and the focusing hole parameters to form the global features of the water flow texture corresponding to the water flow surface image include: In the first level of semantic extraction focusing, based on the semantic features of the water flow texture, the semantic extraction focusing parameters of this level are determined, and the focusing hole parameters corresponding to this level are obtained. Based on the semantic extraction focusing parameters and the focusing hole parameters, semantic extraction focusing is performed on the semantic features of the water flow image to form the water flow texture focusing features of the first level. The focusing hole parameters of the first level have a minimum value, and the focusing hole parameters of the last level have a maximum value. In the second level of semantic extraction and focusing, based on at least one local semantic feature in the water flow texture semantic features, the semantic extraction and focusing parameters of this level are determined, and the focusing hole parameters corresponding to this level are obtained. Based on the semantic extraction and focusing parameters and the focusing hole parameters, the water flow texture focusing features of the first level are semantically extracted and focused to form the water flow texture focusing features of the second level. In the third level of semantic extraction focusing, based on at least one local semantic feature in the water flow texture semantic features, the semantic extraction focusing parameters of this level are determined, and the focusing hole parameters corresponding to this level are obtained. Based on the semantic extraction focusing parameters and the focusing hole parameters, semantic extraction focusing is performed on the water flow texture focusing features of the second level to form the water flow texture focusing features of the third level. In the process of determining the semantic extraction focusing parameters, the number of local semantic features in the later level is greater than the number of local semantic features in the earlier level, and the feature granularity of the local semantic features in the later level is smaller than the feature granularity of the local semantic features in the earlier level. At least based on the water flow texture focus features of the last level, a global water flow texture feature corresponding to the water flow surface image is formed.

6. The water flow measurement method based on image recognition according to claim 5, characterized in that, The step of determining the semantic extraction focusing parameters for the second level of semantic extraction focusing based on at least one local semantic feature in the water flow texture semantic features, obtaining the focusing hole parameters corresponding to the level, and performing semantic extraction focusing on the water flow texture focusing features of the first level based on the semantic extraction focusing parameters and the focusing hole parameters to form the water flow texture focusing features of the second level includes: In the second level of semantic extraction focusing, based on the feature granularity corresponding to this level, the semantic features of the water flow texture are truncated to obtain at least one local semantic feature. Then, each local semantic feature is linearly mapped and nonlinearly activated to obtain the corresponding feature importance representation parameter. Finally, the feature importance representation parameters corresponding to each local semantic feature are fused to obtain the semantic extraction focusing parameter of this level. Obtain the focusing hole parameters for the second level; Based on the semantic extraction focusing parameters and the focusing hole parameters of the second level, semantic extraction focusing is performed on the water flow texture focusing features of the first level to form the water flow texture focusing features of the second level.

7. The water flow measurement method based on image recognition according to claim 6, characterized in that, The step of semantically extracting and focusing the first-level water flow texture focusing features based on the second-level semantic extraction focusing parameters and the second-level focusing hole parameters to form the second-level water flow texture focusing features includes: Based on the focusing hole parameters of the second level, the focusing features of the water flow texture of the first level are subjected to hole convolution to form the water flow texture hole features of the second level. Based on the semantic extraction focusing parameters of the second level, the water flow texture hole features of the second level are weighted and focused to form the water flow texture focusing features of the second level.

8. The water flow measurement method based on image recognition according to any one of claims 1-7, characterized in that, The step of obtaining the distance of water flow texture change by performing semantic restoration operation on two global features of water flow texture corresponding to two frames of water flow surface images includes: The difference between two global features of water flow texture corresponding to two frames of water flow surface images is determined to obtain water flow texture difference features; The two global features of water flow texture and the difference features of water flow texture are spliced ​​together to form the target feature, and the semantic restoration operation is performed on the target feature to obtain the water flow texture change distance.

9. The water flow measurement method based on image recognition according to claim 8, characterized in that, The step of determining the difference between two global features of water flow texture corresponding to two frames of water flow surface images to obtain water flow texture difference features includes: The two global features of water flow texture corresponding to two frames of water flow surface images are subtracted to obtain the original texture difference features. Then, the original texture difference features are linearly mapped and nonlinearly activated to obtain the feature importance characterization parameters. The two global features of water flow texture and the feature importance representation parameters are compressed to form two compressed features of water flow texture and compressed feature importance parameters. The two water flow texture compression features are subtracted to obtain compressed texture difference features. Based on the feature importance compression parameters, the compressed texture difference features are weighted and focused to form focused texture difference features. Based on the original texture difference features, the compressed texture difference features, and the focused texture difference features, the water flow texture difference features are determined.

10. A water flow measurement system based on image recognition, characterized in that, include: Memory, used to store computer programs; A processor connected to the memory is used to execute the computer program stored in the memory to implement the image recognition-based water flow measurement method according to any one of claims 1-9.