River surface velocity identification method and device based on multi-directional collaborative adaptive search

By employing a multi-directional collaborative adaptive search method, the problems of low automation and insufficient measurement accuracy in river flow velocity measurement were solved, achieving high-precision and low-cost identification of river surface flow velocity.

CN118823651BActive Publication Date: 2024-11-15WUHAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411302544.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2024-11-15
Estimated Expiration
2044-09-18

AI Technical Summary

Technical Problem

Existing methods for measuring river flow velocity have low automation levels, high labor costs, and difficulty in meeting the needs of multi-point synchronous measurement. Furthermore, the fixed direction of traditional velocity lines causes measurement accuracy to be affected by changes in the riverbed and water flow direction, and noise interference leads to large identification errors.

Method used

A multi-directional collaborative adaptive search method is adopted. By acquiring river channel video and converting it into images, the length and distribution of velocity measurement lines are determined. Spatiotemporal image maps are formed by traversing all directions. Enhancement processing and Fourier transform are performed to identify multiple main texture directions. Combined with Hough transform and fan filter, the optimal spatiotemporal image map is determined and the surface velocity of the river channel is calculated.

Benefits of technology

It improves the accuracy and stability of river flow velocity measurement, reduces costs, and provides high-precision flow velocity identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118823651B_ABST
    Figure CN118823651B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for identifying the surface velocity of a river channel based on multi-directional collaborative adaptive search. The method includes: obtaining a video of the river channel to be measured, converting the video of the river channel to be measured into a river channel image; determining the length of the speed measurement line and the distribution of the speed measurement points of the river channel to be measured; traversing the pixels on the speed measurement lines in each direction to form a space-time image map of each speed measurement line direction; performing enhancement processing on multiple space-time image maps; performing Fourier transform to obtain multiple frequency spectra respectively, and obtaining corresponding multiple main texture directions based on the multiple frequency spectra; checking texture consistency, and obtaining the first cumulative frequency of each main texture direction; determining the optimal space-time image map based on the first cumulative frequency of each main texture direction; calculating the main texture direction of the optimal space-time image map based on the optimal space-time image map, and calculating the surface velocity of the river channel based on the main texture direction of the optimal space-time image map. The river channel velocity identification method provided by the present application is reliable and easy to implement, with low cost and high recognition accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method, device, storage medium and electronic device for identifying river surface flow velocity based on multi-directional collaborative adaptive search. Background Art

[0002] River flow velocity measurement is an important part of hydrological monitoring. It plays an important role in flood prediction, flood control scheduling, water project construction, etc., and is of great significance to the assessment of water resources, water environment, and water ecological conditions.

[0003] The current meter measurement method is currently the most widely used method for measuring river flow velocity. It can achieve relatively accurate in-situ measurements and is a standard instrument for evaluating the accuracy of new flow measurement instruments. However, this method has a low degree of automation, high labor costs, and cannot achieve multi-point synchronous measurement, making it difficult to meet the growing demand for river surface flow velocity measurement.

[0004] Spatial-Temporal Imaging Video (STIV) is a commonly used video flow measurement method. This method assumes that the target motion meets the continuity condition. By setting speed measurement lines, the pixel information of the speed measurement lines at each moment is extracted, and the time scale is stacked to form a spatial-temporal imaging video (STI). Then, the velocity displacement formula is used to construct the transformation relationship between the STI main texture angle and the pixel displacement to solve the velocity field. Under the condition of stable flow field, a high-precision one-dimensional time-averaged flow field can be obtained.

[0005] However, the selection of velocity lines in STIV will significantly affect the measurement accuracy of river flow velocity. The direction of the traditional velocity line is fixed to be parallel to the river direction, while under natural conditions, the flow direction is complex and changeable due to the influence of riverbed, bank slope, flow state changes, etc. When the actual flow direction of the water flow deviates greatly from the preset velocity line direction, the flow measurement method will directly fail. In addition, the recognition of the main texture angle of STI is easily disturbed by factors such as imaging noise, water surface reflection, and light changes, which often causes large recognition errors. Summary of the invention

[0006] The embodiments of the present application provide a method, device, storage medium and electronic device for identifying river surface flow velocity based on multi-directional collaborative adaptive search, which can improve the measurement accuracy of river flow velocity.

[0007] The present application embodiment provides a method for identifying river surface flow velocity based on multi-directional collaborative adaptive search, including:

[0008] Acquire a video of a river channel to be measured, and convert the video of the river channel to be measured into a river channel image;

[0009] Determine the speed measurement line length and speed measurement point distribution of the river to be measured according to the river channel image;

[0010] Traverse the pixels on the speed measurement lines in each direction, stack them in time scales, and form a spatiotemporal image map in the direction of each speed measurement line;

[0011] Performing enhancement processing on the plurality of spatiotemporal image graphs;

[0012] Performing Fourier transformation on the enhanced multiple spatiotemporal image images to obtain multiple frequency spectrograms respectively, and obtaining corresponding multiple main texture directions based on the multiple frequency spectrograms;

[0013] respectively checking the texture consistency of the plurality of spatiotemporal image graphs after the main texture direction is enhanced, and obtaining the first cumulative frequency of each of the main texture directions;

[0014] Determining an optimal spatiotemporal image map based on the first accumulated frequencies of each of the main texture directions;

[0015] The main texture direction of the optimal space-time image map is calculated according to the optimal space-time image map, and the surface flow velocity of the river channel is calculated according to the main texture direction of the optimal space-time image map.

[0016] Furthermore, in the above-mentioned river surface velocity identification method based on multi-directional collaborative adaptive search, the step of enhancing the plurality of spatiotemporal image graphs comprises:

[0017] Adjusting the grayscale distribution of the spatiotemporal image by histogram equalization;

[0018] The noise of the spatiotemporal image after adjusting the grayscale distribution is filtered by Gaussian filtering;

[0019] The space-time image after noise filtering is subjected to STD filtering.

[0020] Furthermore, in the above-mentioned river surface velocity identification method based on multi-directional collaborative adaptive search, the Fourier transform is performed on the multiple spatiotemporal image images after enhancement processing to obtain multiple frequency spectra respectively, and the corresponding multiple main texture directions are obtained based on the multiple frequency spectra, including:

[0021] Processing the pixels of the spatiotemporal image using a Hanning window function;

[0022] Performing Fourier transform to convert the processed space-time image graph into a frequency spectrum graph;

[0023] Centering the spectrum graph;

[0024] The centralized spectrum graph is represented in a polar coordinate system, and a multi-directional collaborative search algorithm is constructed to determine the main texture direction of the spectrum graph;

[0025] Constructing a sector filter to perform sector filtering on the spectrum graph;

[0026] The spectrum image after the sector filtering is restored to a space-time image image after the main texture direction is enhanced.

[0027] Furthermore, in the above-mentioned river surface velocity identification method based on multi-directional collaborative adaptive search, the texture consistency of the plurality of spatiotemporal image maps after the main texture direction enhancement is respectively checked, and the first cumulative frequency of each main texture direction is obtained, including:

[0028] Performing image edge detection on the spatiotemporal image after the main texture direction enhancement by using a Canny operator to obtain an edge detection image;

[0029] Converting the edge detection image into a curve in Hough space based on a Hough space conversion function;

[0030] An array accumulator is constructed, and the curve of the Hough space is screened based on the array accumulator to obtain a plurality of points;

[0031] Based on the multiple points after screening, the cumulative frequency at each angle corresponding to each point is calculated, the angle with the largest cumulative frequency is taken as the first angle, and the cumulative frequency of the first angle is taken as the first cumulative frequency of the main texture direction.

[0032] Furthermore, in the above-mentioned river surface velocity identification method based on multi-directional collaborative adaptive search, the optimal spatiotemporal image map is determined based on the first cumulative frequency of each main texture direction, including:

[0033] Repeat the steps of enhancing the multiple space-time image graphs, performing Fourier transform on the multiple space-time image graphs after the enhancement to obtain multiple spectrum graphs respectively, and obtaining the corresponding multiple main texture directions based on the multiple spectrum graphs, and the step of respectively checking the texture consistency of the multiple space-time image graphs after the main texture directions are enhanced and obtaining the first cumulative frequency of each main texture direction, calculate the first cumulative frequencies corresponding to the space-time image graphs corresponding to each speed measurement angle condition, and determine the space-time image graph with the largest first cumulative frequency as the optimal space-time image graph.

[0034] Furthermore, the above-mentioned river surface velocity identification method based on multi-directional collaborative adaptive search, wherein the main texture direction of the optimal space-time image map is calculated based on the optimal space-time image map, includes:

[0035] Updating parameters of the array accumulator, calculating a second cumulative frequency corresponding to the optimal spatiotemporal image graph, and determining a second angle corresponding to the second cumulative frequency;

[0036] The main texture direction of the optimal spatiotemporal image is calculated based on the second angle.

[0037] Furthermore, in the above-mentioned river surface velocity identification method based on multi-directional collaborative adaptive search, the step of calculating the main texture direction of the optimal spatiotemporal image based on the second angle includes:

[0038] The main texture direction of the optimal spatiotemporal image is calculated by a first formula, wherein the first formula is:

[0039]

[0040] in, is the main texture direction of the optimal spatiotemporal image, The second angle.

[0041] The embodiment of the present application also provides a river surface flow velocity identification device based on multi-directional collaborative adaptive search, comprising:

[0042] An acquisition module, used for acquiring a video of a river channel to be measured, and converting the video of the river channel to be measured into a river channel image;

[0043] A determination module, used to determine the speed measurement line length and speed measurement point distribution of the river to be measured according to the river channel image;

[0044] The first processing module is used to traverse the pixels on the speed measurement lines in each direction, and perform time scale stacking respectively to form a spatiotemporal image map in the direction of each speed measurement line;

[0045] A second processing module, used for performing enhancement processing on the plurality of spatiotemporal image graphs;

[0046] A third processing module is used to perform Fourier transform on the multiple spatiotemporal image images after enhancement processing to obtain multiple frequency spectra respectively, and obtain corresponding multiple main texture directions based on the multiple frequency spectra;

[0047] A fourth processing module, for respectively checking the texture consistency of the plurality of spatiotemporal image images after the main texture direction is enhanced, and obtaining the first cumulative frequency of each main texture direction;

[0048] A fifth processing module, configured to determine an optimal spatiotemporal image map based on the first accumulated frequencies of the respective main texture directions;

[0049] The sixth processing module is used to calculate the main texture direction of the optimal space-time image map according to the optimal space-time image map, and calculate the surface flow velocity of the river channel according to the main texture direction of the optimal space-time image map.

[0050] An embodiment of the present application also provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions are suitable for being loaded by a processor to execute any of the above-mentioned river surface flow velocity identification methods based on multi-directional collaborative adaptive search.

[0051] An embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the processor is electrically connected to the memory, the memory is used to store instructions and data, and the processor is used for the steps in the river surface flow velocity identification method based on multi-directional collaborative adaptive search as described in any of the above items.

[0052] The present application provides a method, device, storage medium and electronic device for identifying the surface velocity of a river channel based on multi-directional collaborative adaptive search. The present application improves the error caused by the fixed direction of the velocity measurement line by constructing a velocity measurement line angle transformation mechanism, and proposes a multi-cooperative direction search algorithm in the main texture direction search of the spectrum graph to enhance the stability of energy direction recognition. The present application proposes a new method for detecting the main texture direction of an image, which significantly improves the recognition effect of the surface velocity of a river. The river velocity recognition method provided by the present application is reliable and easy to implement, with low cost and high recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The technical solution and other beneficial effects of the present application will be made apparent by describing in detail the specific implementation methods of the present application in conjunction with the accompanying drawings.

[0054] Figure 1 A schematic flow chart of a method for identifying river surface flow velocity based on multi-directional collaborative adaptive search provided in an embodiment of the present application.

[0055] Figure 2 Another flow chart of the method for identifying river surface flow velocity based on multi-directional collaborative adaptive search provided in an embodiment of the present application.

[0056] Figure 3 A schematic diagram of coordinate transformation provided for an embodiment of the present application.

[0057] Figure 4 A schematic diagram of the structure of a river surface flow velocity identification device based on multi-directional collaborative adaptive search provided in an embodiment of the present application.

[0058] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0059] Figure 6 Another schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0061] The embodiment of the present application provides a method, device, storage medium and electronic device for identifying the surface flow velocity of a river channel based on multi-directional collaborative adaptive search. The embodiment of the present application provides a device for identifying the surface flow velocity of a river channel based on multi-directional collaborative adaptive search, which can be integrated in an electronic device, which can be a terminal, a server and other devices, wherein the terminal can include a tablet computer, a laptop computer, a personal computer (PC, Personal Computer), a micro processing box, or other devices.

[0062] See also Figure 1 and Figure 2 , Figure 1 A flow chart of a method for identifying river surface velocity based on multi-directional collaborative adaptive search provided in an embodiment of the present application, Figure 2 Another flow chart of a method for identifying a river surface velocity based on multi-directional collaborative adaptive search provided in an embodiment of the present application, which is applied to an electronic device, and the method for identifying a river surface velocity based on multi-directional collaborative adaptive search includes the following steps:

[0063] S1, obtaining a video of the river channel to be measured, and converting the video of the river channel to be measured into a river channel image.

[0064] Specifically, basic data should be collected first, including video image data, image calibration information, and river surface velocity ratio measurement data of the same period. The video image should be able to completely cover the river channel and should be arranged in a straight river channel without backwater impact area. At the same time, the surrounding environment should be relatively open, without high-rise buildings or tall trees blocking the view. The resolution of the video image should be able to ensure clear reflection of the water surface texture information. In addition, the video image frame rate (fps) should be ≥25 frames / s, which can more accurately reflect the change process of water ripples.

[0065] Secondly, a video frame image extraction algorithm is constructed to convert continuous videos into frame-by-frame river images.

[0066] Furthermore, an image projection transformation method is constructed to transform each frame of river channel image from the image space coordinate system to the geographic space coordinate system.

[0067] In one embodiment, an image projection transformation method is constructed to transform each frame of river channel image from an image space coordinate system to a geographic space coordinate system, specifically comprising the following steps:

[0068] S11, setting no less than 6 groups of calibration points in the river channel image, and recording their position information in the geographic coordinate system and their position information in the image coordinate system.

[0069] S12, in order to better correct the nonlinear distortion of the spectrum image, a second-order polynomial is used for coordinate transformation, which can be expressed by the following formula:

[0070]

[0071] Where x, y represent the location information in the image; X, Y, Z represent the location information in the corresponding geographic space coordinate system; , … are the unknown coordinate system transformation parameters, which can be solved by the least squares method.

[0072] S2, determining the speed measurement line length and speed measurement point distribution of the river to be measured according to the river channel image.

[0073] Specifically, the length of the speed measurement line should be close to the total number of frames of the river video to be measured and should not exceed the image range. The speed measurement points should be evenly distributed on the measurement section.

[0074] As an example, the fps of the river video is 25 frames / s, and 300 frames of video images are taken in 12 seconds. The length of the speed measurement line is correspondingly set to 300 pixels.

[0075] S3, traverse the pixels on the speed measurement lines in each direction, stack them on a time scale, and form a spatiotemporal image STI in the direction of each speed measurement line.

[0076] In one embodiment, the speed angle is measured using Indicates that the value range is 0~180°. In a straight river, in order to reduce the amount of calculation, The resolution is set to 1°, and the traversal interval is set to within ±30° along the flow direction of the main river channel, which can be adjusted appropriately according to the flow characteristics of the target area.

[0077] S4, performing enhancement processing on multiple spatiotemporal image maps.

[0078] Specifically, STI enhancement processing is performed to reduce interference such as imaging noise and light changes and to enhance texture information.

[0079] In one embodiment, step S4 may include the following steps:

[0080] S41, adjusting the grayscale distribution of the spatiotemporal image through histogram equalization.

[0081] Specifically, histogram equalization is used to highlight the texture features of the space-time image map, make the grayscale distribution of the space-time image map more uniform, enhance the contrast of the space-time image map, and make the light and dark features of the space-time image map clearer. The specific processing process includes the following steps:

[0082] S411, traverse all pixels of the spatiotemporal image, count the number of pixels of each gray value, calculate the cumulative distribution function CDF (Cumulative Distribution Function), and perform interval conversion on the cumulative histogram, which can be expressed by the following formula:

[0083]

[0084] in, is the cumulative distribution function, which indicates the percentage of pixels whose grayscale value is less than or equal to k, where k ranges from 0 to 255. It represents the number of pixels with gray value i, M and N represent the horizontal and vertical pixel numbers of the spatiotemporal image respectively.

[0085] S412, gray value mapping is performed based on the cumulative distribution function, which can be expressed by the following formula:

[0086]

[0087] Among them, k is the gray value of the original image, is the grayscale value of the image after histogram equalization mapping, L is the total number of grayscale values, which is 256, and the function of round is to round the calculated value to an integer.

[0088] S42, filtering the noise of the spatiotemporal image after adjusting the grayscale distribution through Gaussian filtering.

[0089] Specifically, Gaussian filtering is used to filter the noise of the spatiotemporal image and further smooth the image. The kernel function adopts a size of 3×3, a central value of 5 / 13, and a surrounding value of 1 / 13.

[0090] S43, performing STD filtering on the space-time image after the noise is filtered.

[0091] Specifically, the spatial temporal image after filtering the noise is subjected to STD filtering (Spatial Temporal Denoising), which can be expressed as follows:

[0092]

[0093] in, is the gray value after STD filtering, g(k) is the pixel value obtained by Gaussian filtering, is the mean gray value of the image after Gaussian filtering; is the variance of the image grayscale value after Gaussian filtering.

[0094] S5, performing Fourier transform on the multiple spatiotemporal image images after the enhancement processing to obtain multiple frequency spectrograms respectively, and obtaining multiple corresponding main texture directions based on the multiple frequency spectrograms.

[0095] In the spectrum obtained by Fourier transform, the energy value represents the rate of grayscale change in the image, and the texture direction of the image is perpendicular to the texture direction of the frequency domain. In addition, the high energy value area in the spectrum is low-frequency information, which is the relatively stable background information in the image, and the low energy value area represents other high-frequency information such as edges and noise where the image changes dramatically. Filtering the low energy value area information in the spectrum and retaining the high energy value area information in the spectrum will help enhance the overall characteristics of the image.

[0096] In one embodiment, step S5 may include the following steps:

[0097] S51, processing pixels of the spatiotemporal image map by using a Hanning window function.

[0098] Specifically, before performing the image transformation of the space-time image graph, a Hanning window is added to reduce the spectrum leakage effect during Fourier transform. Two one-dimensional vectors with the same size M and N as the original space-time image graph are generated according to the Hanning window function, which can be expressed by the following formula:

[0099]

[0100] Afterwards, the two one-dimensional vectors are combined into a two-dimensional Hanning window function based on matrix multiplication. :

[0101]

[0102] in, represents the two-dimensional Hanning window function, and Represent the horizontal and vertical one-dimensional Hanning window functions, is the serial number of the window function, starting from 1 and going to M and N respectively. is the window length, respectively the number of horizontal and vertical pixels of the image, is transposed. The original spatiotemporal image is processed by multiplying the pixel value of the image position by the Hanning window value of the corresponding position.

[0103] S52, performing Fourier transform to convert the processed spatiotemporal image graph into a spectrum graph.

[0104] Through Fourier transform, STI is converted from image domain to frequency domain. The Fourier transform of the image can be defined as:

[0105]

[0106] in, is the spectrum image obtained by Fourier transform, is the frequency parameter; M and N are the image sizes, The image is The pixel value at is the base of natural logarithms, and j is an imaginary number.

[0107] S53, centers the spectrogram and transfers the low-frequency information to the center of the image.

[0108] S54, the polar coordinate system is expressed in the centralized spectrum graph, and a multi-directional collaborative search algorithm is constructed to determine the main texture direction of the spectrum graph.

[0109] The spectrum graph is represented by a polar coordinate system, and a multi-directional collaborative search algorithm is constructed to determine the main texture direction of the spectrum graph. When searching for directions with high energy values, in order to reduce the excessive horizontal and vertical energy in the Fourier frequency domain due to the discreteness of the image pixels, the main texture direction of the image is misestimated. This application proposes a multi-directional collaborative search algorithm, in which the recognition line no longer works in isolation, but performs a multi-directional collaborative search, and uses the accumulated data on multiple direction lines as the recognition result of the central angle to improve the robustness of the algorithm. It can be specifically expressed by the following formula:

[0110]

[0111] in, It is the main texture direction with the highest energy value identified. To ensure computational efficiency, its resolution is usually set to 1°. Radius is the shortest radius of the spectrum graph, which can be expressed as radius=min(N / 2,M / 2), where N and M represent the number of horizontal and vertical pixels, respectively. For multi-angle recognition threshold range, it can be set to 3~5°.

[0112] S55, constructing a fan-shaped filter, and performing fan-shaped filtering on the spectrum graph.

[0113] Based on the main texture direction of the determined spectrum graph, a sector filter is constructed to retain low-frequency information and filter high-frequency information to enhance the main texture information within the sector. is the centerline direction, in degrees is the changing space, and the coverage area is constructed as ( ), construct a fan-shaped image with a radius of radius, where It can be set to 5~10°. Then, set the value inside the fan-shaped area to 1, and the value outside the fan-shaped area to 0. Use matrix multiplication to perform fan-shaped filtering on the spectrum graph, that is, retain the low-frequency information in the fan-shaped area and filter the high-frequency information outside the fan-shaped area.

[0114] S56, restoring the fan-shaped filtered spectrum image to a space-time image image enhanced in the main texture direction.

[0115] Specifically, the spectrum graph after sector filtering is subjected to inverse centralization processing, that is, the information in the spectrum graph is restored to the original distribution, and an inverse Fourier transform is performed to restore the image from the frequency domain to the image domain to obtain the STI after the main texture direction is enhanced.

[0116] S6, respectively checking the texture consistency of the plurality of spatiotemporal image images after the main texture direction is enhanced, and obtaining the first cumulative frequency of each main texture direction.

[0117] In one embodiment, step S6 may include the following steps:

[0118] S61, performing image edge detection on the spatiotemporal image after the main texture direction enhancement through the Canny operator to obtain an edge detection image.

[0119] Specifically, the Canny operator is used for image edge detection to identify the binary edge information of the spatiotemporal image after the main texture direction enhancement, where the parameters to be determined are the Sobel operator size and the bilateral detection threshold parameter. In order to reduce the complexity of the calculation and retain the complete boundary information as much as possible, the Sobel operator size is set to 3.

[0120] This application proposes a dual threshold adaptive setting method to reduce the recognition error caused by using fixed bilateral monitoring threshold parameters under different light intensity and texture characteristics. The high threshold of bilateral detection is approximately determined by the grayscale cumulative curve of the image and is set to 90% of the grayscale cumulative curve. The low threshold of bilateral detection is determined by the high threshold and is set to 5% of the high threshold of bilateral detection. The parameters can be adjusted appropriately according to actual conditions.

[0121] S62, converting the edge detection image into a Hough space curve based on a Hough space conversion function.

[0122] Construct a Hough space transformation function, specifically using the following transformation function:

[0123]

[0124] in, is the distance from the origin to the point (x, y), where x and y are the horizontal and vertical distances from the point (x, y) to the origin in the Cartesian coordinate system, respectively. It represents the angle between the straight line formed by the origin and (x, y) and the positive direction of the x-axis, with the counterclockwise direction being positive.

[0125] Figure 3 A schematic diagram of coordinate conversion provided in the embodiment of the present application, such as Figure 3 As shown, in one embodiment, a point in the Cartesian coordinate system is mapped to a curve in the Hough space through the above conversion function. In addition, the curve formed by the collinear points in the Cartesian coordinate system in the Hough space will pass through the same point. , the angle corresponding to the intersection position Perpendicular to the direction of collinear points in the Cartesian coordinate system.

[0126] Taking the center (M / 2, N / 2) of the edge detection image as the center of the circle, all boundary points within the radius of min (M / 2, N / 2) are converted into Hough space curves through the constructed Hough space conversion function.

[0127] S63, constructing an array accumulator, and screening the curve of the Hough space based on the array accumulator to obtain multiple points.

[0128] The angle The resolution is set to 1°, The resolution is set to 1, and an array accumulator is constructed to count the number of points passing through the Hough space. The number of curves is set, and a threshold L is set for screening. The points where the number of curves converging exceeds L are retained. The physical meaning of L is that in the Cartesian coordinate system, at least L points are collinear to be considered a characteristic straight line. To make the algorithm more stable, it is recommended that L ≥ 1 / 2 × min (N / 2, M / 2).

[0129] S64, based on the screened multiple points, calculate the cumulative frequency at each angle corresponding to each point, take the angle with the largest cumulative frequency as the first angle, and take the cumulative frequency of the first angle as the first cumulative frequency of the main texture direction.

[0130] After the statistical step S63, the points obtained by screening are The angle with the largest number of points under the cumulative frequency can represent the main texture direction of the current STI, which is recorded as the first angle At the same time, record the cumulative frequency count of the first angle ( ).

[0131] S7, determining an optimal spatiotemporal image map based on the first cumulative frequencies of each main texture direction.

[0132] Specifically, repeat steps S4-S6 to calculate the first cumulative frequencies of the space-time image graphs corresponding to each speed measurement angle condition, and determine the space-time image graph with the largest first cumulative frequency as the optimal space-time image graph. The characteristic angle corresponding to STI under the condition and its cumulative frequency count( ), cumulative frequency count( ) The maximum STI is the optimal STI for the current measurement point, and its corresponding speed measurement angle That is the optimal flow velocity direction of the current measuring point.

[0133] S8, calculating the main texture direction of the optimal space-time image map according to the optimal space-time image map, and calculating the surface flow velocity of the river channel according to the main texture direction of the optimal space-time image map.

[0134] In one embodiment, step S8 includes the following steps:

[0135] S81, update the parameters of the array accumulator, calculate the second cumulative frequency corresponding to the optimal spatiotemporal image diagram, and determine the second angle corresponding to the second cumulative frequency.

[0136] Specifically, update the array accumulator parameters, set the angle resolution to 0.1°, calculate the array accumulator results under the optimal STI condition, and find the maximum second cumulative frequency. .

[0137] In Hough space It is perpendicular to the main texture angle direction of STI. Therefore, it is necessary to make necessary transformations on the calculated texture angle, as shown in the formula:

[0138]

[0139] in, is the main texture direction of the optimal STI, with clockwise rotation along the positive direction of the x-axis as positive. It is the angle with the largest cumulative frequency in the array accumulator in the Hough space, that is, the second angle.

[0140] S82, calculating the main texture direction of the optimal spatiotemporal image based on the second angle.

[0141] In STI, the horizontal direction is the change of pixels along the velocity measurement line, and the vertical direction is the change of pixels along the time scale. According to the velocity displacement formula, the time-averaged flow velocity can be expressed as:

[0142]

[0143] in, is the main texture direction of the optimal spatiotemporal image, d is the number of pixels of brightness motion in the X direction of the spatial speed measurement line, k is the total number of frames used for motion in the time T direction, dx is the pixel resolution, the unit is m / pixel, dt is the time interval between each frame of the image, the unit is s / frame, and the corresponding fps is the frame rate of the video, which is the reciprocal of dt, the unit is frame / s.

[0144] Furthermore, the points to be measured are traversed, and steps S4-S8 are repeated to obtain the surface flow velocity information of each position to be measured.

[0145] Furthermore, based on the measured data, the flow velocity identification results are calibrated and verified.

[0146] Aiming at the high measurement cost and difficulty of the traditional river flow measurement method, the present invention constructs a velocity line angle transformation mechanism based on the STIV method to improve the error caused by the fixed velocity line direction, and proposes a multi-cooperative direction search algorithm in the main texture direction search of the spectrum graph to enhance the stability of energy direction recognition. Then, combined with the Hough transform principle, a new image main texture direction detection method is proposed, which significantly improves the recognition effect of river surface velocity, and provides a reliable, low-cost, high-precision river surface velocity measurement method.

[0147] According to the method described in the above embodiment, this embodiment will be further described from the perspective of a river surface flow velocity identification device based on multi-directional collaborative adaptive search. The river surface flow velocity identification device based on multi-directional collaborative adaptive search can be implemented as an independent entity, or it can be integrated in an electronic device, which can be a terminal, server and other devices, wherein the terminal can include a tablet computer, a laptop computer, a personal computer (PC, Personal Computer), a micro processing box, or other devices.

[0148] See also Figure 4 , Figure 4 The present invention specifically describes a river surface flow velocity identification device based on multi-directional collaborative adaptive search provided in an embodiment of the present invention, which is applied to an electronic device. The river surface flow velocity identification device based on multi-directional collaborative adaptive search may include:

[0149] An acquisition module is used to acquire the video of the river channel to be measured and convert the video of the river channel to be measured into a river channel image;

[0150] A determination module is used to determine the length of the speed measurement line and the distribution of speed measurement points of the river to be measured;

[0151] The first processing module is used to traverse the pixels on the speed measurement lines in each direction, and perform time scale stacking respectively to form a spatiotemporal image map in the direction of each speed measurement line;

[0152] The second processing module is used to enhance the multiple spatiotemporal image graphs;

[0153] A third processing module is used to perform Fourier transform on the multiple spatiotemporal image images after enhancement processing to obtain multiple frequency spectra respectively, and obtain corresponding multiple main texture directions based on the multiple frequency spectra;

[0154] The fourth processing module is used to respectively check the texture consistency of the plurality of spatiotemporal image images after the main texture direction is enhanced, and obtain the first cumulative frequency of each main texture direction;

[0155] A fifth processing module, configured to determine an optimal spatiotemporal image map based on the first cumulative frequency of each main texture direction;

[0156] The sixth processing module is used to calculate the main texture direction of the optimal space-time image map according to the optimal space-time image map, and calculate the surface flow velocity of the river channel according to the main texture direction of the optimal space-time image map.

[0157] During specific implementation, the above modules and / or units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above modules and / or units can refer to the previous method embodiments. The specific beneficial effects that can be achieved can also refer to the beneficial effects in the previous method embodiments, which will not be repeated here.

[0158] In addition, the embodiment of the present application also provides an electronic device, which may be a computer, a tablet computer, or other device. Figure 5 As shown, the electronic device 400 includes a processor 401 and a memory 402. The processor 401 is electrically connected to the memory 402.

[0159] The processor 401 is the control center of the electronic device 400. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or loading applications stored in the memory 402 and calling data stored in the memory 402, thereby monitoring the electronic device as a whole.

[0160] In this embodiment, the processor 401 in the electronic device 400 loads instructions corresponding to the processes of one or more application programs into the memory 402 according to the following steps, and the processor 401 runs the application programs stored in the memory 402 to implement various functions:

[0161] Acquire a video of a river channel to be measured, and convert the video of the river channel to be measured into a river channel image;

[0162] Determine the speed measurement line length and speed measurement point distribution of the river to be measured according to the river channel image;

[0163] Traverse the pixels on the speed measurement lines in each direction, stack them in time scales, and form a spatiotemporal image map in the direction of each speed measurement line;

[0164] Performing enhancement processing on the plurality of spatiotemporal image graphs;

[0165] Performing Fourier transformation on the enhanced multiple spatiotemporal image images to obtain multiple frequency spectrograms respectively, and obtaining corresponding multiple main texture directions based on the multiple frequency spectrograms;

[0166] respectively checking the texture consistency of the plurality of spatiotemporal image graphs after the main texture direction is enhanced, and obtaining the first cumulative frequency of each main texture direction;

[0167] Determining an optimal spatiotemporal image map based on the first accumulated frequencies of each of the main texture directions;

[0168] The main texture direction of the optimal space-time image map is calculated according to the optimal space-time image map, and the surface flow velocity of the river channel is calculated according to the main texture direction of the optimal space-time image map.

[0169] The electronic device can implement the steps in any embodiment of the river surface flow velocity identification method based on multi-directional collaborative adaptive search provided in the embodiments of the present application. Therefore, it can achieve the beneficial effects that can be achieved by any river surface flow velocity identification method based on multi-directional collaborative adaptive search provided in the embodiments of the present application. For details, please see the previous embodiments and will not be repeated here.

[0170] Figure 6 The specific structural block diagram of the electronic device provided in the embodiment of the present invention is shown, and the electronic device can be used to implement the river surface flow velocity identification method based on multi-directional collaborative adaptive search provided in the above embodiment. The electronic device 500 can be a terminal, a server and other devices, wherein the terminal can include a tablet computer, a notebook computer, a personal computer (PC, Personal Computer), a micro processing box, or other devices.

[0171] The RF circuit 510 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, and thus communicate with a communication network or other devices. The RF circuit 510 may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity module (SIM) cards, memories, etc. The RF circuit 510 can communicate with various networks such as the Internet, corporate intranets, wireless networks, or communicate with other devices through wireless networks. The above-mentioned wireless networks may include cellular telephone networks, wireless local area networks, or metropolitan area networks. The above-mentioned wireless networks may use various communication standards, protocols and technologies, including but not limited to Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (WCDMA), Code Division Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wi-Fi) (such as Institute of Electrical and Electronics Engineers standards IEEE 802.11a, IEEE 802.11b, IEEE802.11g and / or IEEE802.11n), Voice over Internet Protocol (VoIP), Worldwide Interoperability for Microwave Access (Wi-Max), other protocols for email, instant messaging and short messages, and any other suitable communication protocols, even those that have not yet been developed.

[0172] The memory 520 can be used to store software programs and modules, such as the corresponding program instructions / modules in the above embodiments. The processor 580 executes various functional applications and data processing by running the software programs and modules stored in the memory 520, that is, realizing the functions of taking pictures with the front camera, processing the captured images, and switching the display color of the display content on the display screen. The memory 520 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 520 may further include a memory remotely arranged relative to the processor 580, and these remote memories may be connected to the electronic device 500 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0173] The input unit 530 may be used to receive input digital or character information, and generate a keyboard and a mouse related to user settings and function control.

[0174] The display unit 540 may be used to display information input by the user or information provided to the user and various graphical user interfaces, which may be composed of graphics, text, icons, videos, and any combination thereof. The display unit 540 may include a display panel 541, which may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like.

[0175] Video circuit 560 , video circuit 560 may provide a video interface between a user and electronic device 500 .

[0176] The electronic device 500 can help the user receive requests, send information, etc. through the transmission module 570 (such as a Wi-Fi module), which provides the user with wireless broadband Internet access. Although the transmission module 570 is shown in the figure, it can be understood that it is not a necessary component of the electronic device 500 and can be omitted as needed without changing the essence of the invention.

[0177] The processor 580 is the control center of the electronic device 500. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 520, and calling data stored in the memory 520, it executes various functions of the electronic device 500 and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 580 may include one or more processing cores; in some embodiments, the processor 580 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 580.

[0178] The electronic device 500 also includes a power supply 590 (such as a battery) for supplying power to various components. In some embodiments, the power supply can be logically connected to the processor 580 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 590 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0179] Although not shown, the electronic device 500 also includes a camera (such as a front camera, a rear camera), a Bluetooth module, etc., which will not be described in detail here. Specifically in this embodiment, the display unit of the electronic device is a touch screen display, and the mobile terminal also includes a memory, and one or more programs, wherein one or more programs are stored in the memory, and are configured to be executed by one or more processors. One or more programs include instructions for performing the following operations:

[0180] Acquire a video of a river channel to be measured, and convert the video of the river channel to be measured into a river channel image;

[0181] Determine the speed measurement line length and speed measurement point distribution of the river to be measured according to the river channel image;

[0182] Traverse the pixels on the speed measurement lines in each direction, stack them in time scales, and form a spatiotemporal image map in the direction of each speed measurement line;

[0183] Performing enhancement processing on the plurality of spatiotemporal image graphs;

[0184] Performing Fourier transformation on the enhanced multiple spatiotemporal image images to obtain multiple frequency spectrograms respectively, and obtaining corresponding multiple main texture directions based on the multiple frequency spectrograms;

[0185] respectively checking the texture consistency of the plurality of spatiotemporal image graphs after the main texture direction is enhanced, and obtaining the first cumulative frequency of each main texture direction;

[0186] Determining an optimal spatiotemporal image map based on the first accumulated frequencies of each of the main texture directions;

[0187] The main texture direction of the optimal space-time image map is calculated according to the optimal space-time image map, and the surface flow velocity of the river channel is calculated according to the main texture direction of the optimal space-time image map.

[0188] In specific implementation, the above modules can be implemented as independent entities, or can be arbitrarily combined and implemented as the same or several entities. The specific implementation of the above modules can be found in the previous method embodiments, which will not be repeated here.

[0189] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling related hardware through instructions, and the instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present invention provides a storage medium, which stores a plurality of instructions, and the instructions can be loaded by a processor to execute the steps of any embodiment of the river surface velocity identification method based on multi-directional collaborative adaptive search provided by the embodiment of the present invention.

[0190] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0191] Since the instructions stored in the storage medium can execute the steps in any embodiment of the river surface flow velocity identification method based on multi-directional collaborative adaptive search provided in the embodiments of the present invention, the beneficial effects that can be achieved by any river surface flow velocity identification method based on multi-directional collaborative adaptive search provided in the embodiments of the present invention can be achieved. For details, please see the previous embodiments and will not be repeated here.

[0192] The above is a detailed introduction to a river surface flow velocity identification method, device, storage medium and electronic device based on multi-directional collaborative adaptive search provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for identifying river surface velocity based on multi-directional collaborative adaptive search, characterized in that: The method comprises: Acquire a video of a river channel to be measured, and convert the video of the river channel to be measured into a river channel image; Determine the speed measurement line length and speed measurement point distribution of the river to be measured according to the river channel image; Traverse the pixels on the speed measurement lines in each direction, stack them in time scales, and form a spatiotemporal image map in the direction of each speed measurement line; Performing enhancement processing on the plurality of spatiotemporal image graphs; Performing Fourier transformation on the enhanced multiple spatiotemporal image images to obtain multiple frequency spectrograms respectively, and obtaining corresponding multiple main texture directions based on the multiple frequency spectrograms; The texture consistency of the plurality of space-time image graphs after the main texture direction is enhanced is respectively checked, and the first cumulative frequency of each of the main texture directions is obtained; the texture consistency of the plurality of space-time image graphs after the main texture direction is enhanced is respectively checked, and the first cumulative frequency of each of the main texture directions is obtained, including: performing image edge detection on the space-time image graph after the main texture direction is enhanced by using a Canny operator to obtain an edge detection image; converting the edge detection image into a curve in Hough space based on a Hough space conversion function; constructing an array accumulator, and filtering the curve in Hough space based on the array accumulator to obtain a plurality of points; based on the filtered plurality of points, calculating the cumulative frequency at each angle corresponding to each point, taking the angle with the largest cumulative frequency as the first angle, and taking the cumulative frequency of the first angle as the first cumulative frequency of the main texture direction; Determining an optimal spatiotemporal image map based on the first accumulated frequencies of each of the main texture directions; Calculating the main texture direction of the optimal space-time image map according to the optimal space-time image map, and calculating the surface flow velocity of the river channel according to the main texture direction of the optimal space-time image map; wherein, calculating the main texture direction of the optimal space-time image map according to the optimal space-time image map comprises: updating the parameters of the array accumulator, calculating the second cumulative frequency corresponding to the optimal space-time image map, and determining the second angle corresponding to the second cumulative frequency; calculating the main texture direction of the optimal space-time image map based on the second angle; The step of calculating the main texture direction of the optimal space-time image map based on the second angle includes: calculating the main texture direction of the optimal space-time image map by a first formula, wherein the first formula is: in, is the main texture direction of the optimal spatiotemporal image, The second angle.

2. The method for identifying river surface velocity based on multi-directional collaborative adaptive search according to claim 1 is characterized in that: The step of performing enhancement processing on the plurality of spatiotemporal image graphs includes: Adjusting the grayscale distribution of the spatiotemporal image by histogram equalization; The noise of the spatiotemporal image after adjusting the grayscale distribution is filtered by Gaussian filtering; The space-time image after noise filtering is subjected to STD filtering.

3. The method for identifying river surface velocity based on multi-directional collaborative adaptive search according to claim 1 is characterized in that: The method of performing Fourier transform on the enhanced multiple spatiotemporal image images to obtain multiple frequency spectra respectively, and obtaining corresponding multiple main texture directions based on the multiple frequency spectra includes: Processing the pixels of the spatiotemporal image using a Hanning window function; Performing Fourier transform to convert the processed space-time image graph into a frequency spectrum graph; Centering the spectrum graph; The centralized spectrum graph is represented in a polar coordinate system, and a multi-directional collaborative search algorithm is constructed to determine the main texture direction of the spectrum graph; Constructing a sector filter to perform sector filtering on the spectrum graph; The spectrum image after the sector filtering is restored to a space-time image image after the main texture direction is enhanced.

4. The method for identifying river surface velocity based on multi-directional collaborative adaptive search according to claim 1 is characterized in that: Determining an optimal spatiotemporal image map based on the first cumulative frequencies of the main texture directions includes: Repeat the steps of enhancing the multiple space-time image graphs, performing Fourier transform on the multiple space-time image graphs after the enhancement to obtain multiple spectrum graphs respectively, and obtaining the corresponding multiple main texture directions based on the multiple spectrum graphs, and the step of respectively checking the texture consistency of the multiple space-time image graphs after the main texture directions are enhanced and obtaining the first cumulative frequency of each main texture direction, calculate the first cumulative frequencies corresponding to the space-time image graphs corresponding to each speed measurement angle condition, and determine the space-time image graph with the largest first cumulative frequency as the optimal space-time image graph.

5. A river surface velocity identification device based on multi-directional collaborative adaptive search, characterized in that: include: An acquisition module, used for acquiring a video of a river channel to be measured, and converting the video of the river channel to be measured into a river channel image; A determination module, used to determine the speed measurement line length and speed measurement point distribution of the river to be measured according to the river channel image; The first processing module is used to traverse the pixels on the speed measurement lines in each direction, and perform time scale stacking respectively to form a spatiotemporal image map in the direction of each speed measurement line; A second processing module, used for performing enhancement processing on the plurality of spatiotemporal image graphs; A third processing module is used to perform Fourier transform on the multiple spatiotemporal image images after enhancement processing to obtain multiple frequency spectra respectively, and obtain corresponding multiple main texture directions based on the multiple frequency spectra; A fourth processing module, for respectively checking the texture consistency of the plurality of spatiotemporal image images after the main texture direction is enhanced, and obtaining the first cumulative frequency of each main texture direction; The method of respectively checking the texture consistency of the plurality of space-time image graphs after the main texture direction is enhanced and obtaining the first cumulative frequency of each of the main texture directions includes: performing image edge detection on the space-time image graph after the main texture direction is enhanced by a Canny operator to obtain an edge detection image; converting the edge detection image into a curve in a Hough space based on a Hough space conversion function; constructing an array accumulator, and filtering the curve in the Hough space based on the array accumulator to obtain a plurality of points; calculating the cumulative frequency at each angle corresponding to each point based on the filtered multiple points, taking the angle with the largest cumulative frequency as the first angle, and taking the cumulative frequency of the first angle as the first cumulative frequency of the main texture direction; A fifth processing module, configured to determine an optimal spatiotemporal image map based on the first accumulated frequencies of the respective main texture directions; The sixth processing module is used to calculate the main texture direction of the optimal space-time image map according to the optimal space-time image map, and calculate the surface flow velocity of the river according to the main texture direction of the optimal space-time image map; wherein, the main texture direction of the optimal space-time image map is calculated according to the optimal space-time image map, including: updating the parameters of the array accumulator, calculating the second cumulative frequency corresponding to the optimal space-time image map, and determining the second angle corresponding to the second cumulative frequency; calculating the main texture direction of the optimal space-time image map based on the second angle; The step of calculating the main texture direction of the optimal space-time image map based on the second angle includes: calculating the main texture direction of the optimal space-time image map by a first formula, wherein the first formula is: in, is the main texture direction of the optimal spatiotemporal image, The second angle.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the river surface flow velocity identification method based on multi-directional collaborative adaptive search as described in any one of claims 1 to 4.

7. An electronic device, characterized in that: It includes a processor and a memory, the processor is electrically connected to the memory, the memory is used to store instructions and data, and the processor is used to execute the steps in the river surface flow velocity identification method based on multi-directional collaborative adaptive search as described in any one of claims 1 to 4.