Method, device and storage medium for measuring speed of two-dimensional space-time image of river surface in the wild
Through the two-dimensional space-time image speed measurement method, the rotating speed measurement line and rotary line segment technology is adopted to solve the problem of flow velocity measurement with large changes in the flow direction of the field river, and simultaneous measurement of the flow direction and size is realized, avoiding the deployment of artificial tracers.
Patent Information
- Application Number
- CN202311290168.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-08
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2043-10-08
AI Technical Summary
The flow velocity measurement of the surface of a field river is difficult to achieve when the flow direction changes greatly, and traditional methods require the use of artificial tracers, which is time-consuming and labor-intensive, and difficult to ensure uniformity.
The two-dimensional space-time image speed measurement method is used, without prespecifying the flow velocity direction of the measurement point, by collecting the flow images on the river surface, performing image preprocessing and grid division, setting the rotation speed measurement line and the rotation line segment, and calculating the self-correlation coefficient to determine the flow velocity direction and size.
Simultaneous measurement of the flow velocity direction and size of the surface of the field river is achieved, and the application of artificial tracers is avoided, and it is suitable for field river environments with large changes in the flow direction.
Smart Images

Figure CN117452021B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of surface velocity measurement of wild rivers, and in particular to a two-dimensional spatiotemporal image velocity measurement method, device and storage medium for measuring the surface velocity of wild rivers. Background Art
[0002] River velocity is an important hydrological parameter. Among the many current measurement methods, image-based methods are increasingly being used in river measurement due to their advantages such as non-contact and large-scale measurement. Traditional space-time image velocimetry (STIV) requires artificially presetting the flow direction of the river and calculating the surface velocity of the river based on the movement of the river surface texture. Because rivers in the wild are generally curved due to factors such as topography, climate, geology, and Coriolis force, and the flow direction varies greatly, it is difficult to determine the direction of the river, or even impossible to determine the direction of the river in advance. Therefore, STIV is limited when applied to field river measurements.
[0003] In addition, existing technologies that use tracer particles to calculate river surface velocity all require the presence of significant tracers on the river surface. However, placing artificial tracers on a large river surface in the wild is time-consuming and labor-intensive, and it is difficult to spread them evenly, making them basically impossible to use in large-area measurements. The time and location of natural tracers, such as floating branches, are highly random, and it is difficult to guarantee their quantity and density. Therefore, there are significant limitations in field applications. Summary of the invention
[0004] The present disclosure aims to solve at least one of the technical problems existing in the prior art.
[0005] To this end, the first aspect of the present disclosure provides a two-dimensional space-time image velocity measurement method for the surface of a wild river. The method does not require pre-specification of the flow velocity direction of the measuring point, thereby solving the problem of measuring flow velocity on the surface of a wild river with large changes in flow direction, avoiding the time-consuming and labor-intensive problem of placing artificial tracers on the surface of a large river in the wild, and realizing the simultaneous measurement of the size and direction of the flow velocity on the surface of a wild river.
[0006] The first aspect of the present disclosure provides a method for measuring the velocity of a wild river surface using a two-dimensional spatiotemporal image, comprising:
[0007] Step S1, collecting surface flow images at the cross-section to be measured in a wild river, thereby constructing an original image sequence;
[0008] Step S2, preprocessing each original image in the original image sequence to obtain a preprocessed image sequence;
[0009] Step S3: for each image in the preprocessed image sequence, firstly divide the image into grids, then set a horizontal speed measurement line on each grid node, and obtain a series of speed measurement lines with the grid node as the center and in the range of [0, 2π] by rotating the speed measurement line at equal intervals. The series of speed measurement lines are recorded as the rotation speed measurement lines of the grid node, and a plurality of space-time images of each grid node are synthesized according to the texture change of the rotation speed measurement lines of each grid node, and the autocorrelation coefficient of each space-time image is calculated. The space-time image with the largest autocorrelation coefficient is selected to obtain the optimal space-time image of each grid node. Image; for each of the preferred space-time images, set a line segment whose midpoint is located at the center of the preferred space-time image, the length of the line segment is the shorter length of the side lengths of the preferred space-time image, and obtain a series of rotated line segments with the center of the preferred space-time image as the center and in the range of [0,2π] by rotating the line segments at equal intervals, calculate the autocorrelation coefficient of each rotated line segment, add the autocorrelation coefficients of each rotated line segment, take the angle between the autocorrelation coefficient and the rotated line segment where the maximum value is located as the direction of river flow velocity, and take the tangent value of the direction of river flow velocity as the magnitude of river flow velocity.
[0010] In some embodiments, in step S1, the section to be measured should be located at a river bank that is convenient for placing a marker point and has a stable flow state on the river surface.
[0011] In some embodiments, in step S1, a surface flow video at a section to be measured in a wild river is obtained by using a drone carrying a high-definition camera, and images are extracted frame by frame from the surface flow video to obtain a number of surface flow images.
[0012] In some embodiments, in step S2, the preprocessing of each original image includes sequentially performing image correction and image enhancement on each original image.
[0013] In some embodiments, the image correction comprises the following steps:
[0014] Taking the first original image in the original image sequence as a reference, selecting a plurality of non-moving feature areas of the bank in the original image;
[0015] Performing cross-correlation operations on the grayscale images in the feature regions of the remaining original images in the original image sequence with the first original image to obtain rotations and displacements of the feature regions in each original image;
[0016] According to the rotation and displacement of each feature area in each original image, the matrix of the affine transformation corresponding to each original image and the first original image is obtained;
[0017] Each original image is inversely transformed according to the affine transformation matrix corresponding to each original image and the first original image, so that the corresponding points of each original image have the same coordinates, forming a corrected image sequence.
[0018] In some embodiments, in step S3, the angle between two adjacent speed measurement lines ranges from 0.1° to 10°.
[0019] In some embodiments, in step S3, the angle between two adjacent rotation line segments ranges from 0.1° to 10°.
[0020] In some embodiments, in step S3, the autocorrelation coefficients of the spatiotemporal image and the preferred spatiotemporal image are calculated according to the following steps:
[0021] Performing edge detection on the spatiotemporal image or the preferred spatiotemporal image to reduce noise in the image;
[0022] The characteristic gradient R(τ) of the spatiotemporal image or the preferred spatiotemporal image is calculated according to the following formula x ,τ y ):
[0023]
[0024] Where f(x,y) is the grayscale distribution of the pixel with coordinates (x,y) in the spatiotemporal image or preferably in the spatiotemporal image, (τ x ,τ y ) is the texture displacement parameter of the pixel point with coordinates (x, y) in the spatiotemporal image or the preferred spatiotemporal image;
[0025] The characteristic gradient of the space-time image or the preferred space-time image is normalized to obtain the autocorrelation coefficient of the space-time image or the preferred space-time image.
[0026] The second aspect of the present disclosure provides a two-dimensional spatiotemporal image velocity measuring device for a wild river surface, comprising:
[0027] An image acquisition module is used to acquire surface flow images at the cross-section of a river to be tested in the wild, so as to construct an original image sequence;
[0028] An image preprocessing module, used for preprocessing each original image in the original image sequence to obtain a preprocessed image sequence;
[0029] The velocity and flow direction calculation module is used to first grid each image in the preprocessed image sequence, then set a horizontal velocity line on each grid node, and obtain a series of velocity lines with the grid node as the center and in the range of [0, 2π] by rotating the velocity line at equal intervals. The series of velocity lines are recorded as the rotation velocity lines of the grid node, and a plurality of space-time images of each grid node are synthesized according to the texture changes of the rotation velocity lines of each grid node, and the autocorrelation coefficient of each space-time image is calculated. The space-time image with the largest autocorrelation coefficient is selected to obtain the preferred image of each grid node. space-time image; for each of the preferred space-time images, a line segment whose midpoint is located at the center of the preferred space-time image is set, and the length of the line segment is the shorter length of the side lengths of the preferred space-time image, and a series of rotated line segments with the center of the preferred space-time image as the center and in the range of [0,2π] are obtained by rotating the line segments at equal intervals, and the autocorrelation coefficient of each rotated line segment is calculated, and the autocorrelation coefficient of each rotated line segment is added, and the angle between the autocorrelation coefficient and the rotated line segment where the maximum value is located is used as the direction of river flow velocity, and the tangent value of the direction of river flow velocity is used as the magnitude of river flow velocity.
[0030] A third aspect of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to measure the speed of a wild river surface using two-dimensional space-time images according to any embodiment of the first aspect of the present disclosure.
[0031] Compared with the prior art, the present invention has the following characteristics:
[0032] The disclosed embodiment uses a correlation coefficient comparison method to identify the angle of the velocity line with the clearest image texture, thereby realizing simultaneous measurement of the direction and magnitude of flow velocity on the surface of a wild river. Specifically, by constructing a rotating velocity line / rotating line segment, when the velocity line / rotating line segment is consistent with the flow direction of the river, the texture in the formed space-time image is clear and the autocorrelation coefficient is the largest. According to the principle of maximum correlation coefficient, the direction of the velocity line is determined to represent the flow direction, and the magnitude of the flow velocity is obtained at the same time, thereby obtaining a two-dimensional flow velocity field on the surface of the wild river.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] 1. The disclosed embodiment utilizes the large-scale light and dark changes produced by the ripples on the river surface to replace the traditional tracer particles for calculating the surface flow velocity of the river, thereby solving the problems of being unable to artificially spread tracer particles and poor tracking performance of tracer particles under extreme conditions such as floods and dam breaches.
[0035] 2. The embodiment of the present disclosure does not require the flow direction of the river surface to be determined in advance, and can well solve the problem of flow velocity measurement on the surface of a wild river where the flow direction varies greatly.
[0036] 3. The disclosed embodiment, in conjunction with a high-definition camera mounted on a drone, can achieve remote measurement of the surface velocity field of a wild river. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a flow chart of a method for measuring velocity of a wild river surface using two-dimensional space-time images provided in an embodiment of the first aspect of the present disclosure.
[0038] Figure 2 It is a schematic diagram of a rotating speed measurement line generated by the two-dimensional space-time image speed measurement method provided in the embodiment of the first aspect of the present disclosure.
[0039] Figure 3 These are space-time images of different angles synthesized by the two-dimensional space-time image speed measurement method provided in the first aspect of the present disclosure, wherein (a) to (f) correspond to angles of 12.5°, 45°, 50°, 102.5°, 120° and 150°, respectively.
[0040] Figure 4 It is a space-time image of a certain angle synthesized by the two-dimensional space-time image speed measurement method provided by the embodiment of the first aspect of the present disclosure.
[0041] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the third aspect of the present disclosure. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present application more clear, the present application is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application.
[0043] On the contrary, the present application covers any substitution, modification, equivalent method and scheme made on the essence and scope of the present application as defined by the claims. Further, in order to make the public have a better understanding of the present application, some specific details are described in detail in the detailed description of the present application below. Those skilled in the art can fully understand the present application without the description of these details.
[0044] See also Figure 1 The first aspect of the present disclosure provides a method for measuring the velocity of a river surface using a two-dimensional spatiotemporal image, comprising the following steps:
[0045] Step S1, collecting surface flow images at the cross-section to be measured in a wild river, thereby constructing an original image sequence;
[0046] Step S2, preprocessing each original image in the constructed original image sequence to obtain a preprocessed image sequence;
[0047] Step S3, for each image in the preprocessed image sequence, firstly mesh the image, then set a horizontal speed measurement line on each grid node, and obtain a series of speed measurement lines with the grid node as the center and in the range of [0,2π] by rotating the speed measurement line at equal intervals, record the series of speed measurement lines as the rotation speed measurement lines of the grid node, synthesize several space-time images of each grid node according to the texture change of the rotation speed measurement lines of each grid node (each grid node will generate several corresponding space-time images), calculate the autocorrelation coefficient of each space-time image, select the space-time image with the largest autocorrelation coefficient, and obtain the preferred space-time image of each grid node (each grid node The node corresponds to a preferred space-time image); for the preferred space-time image of each grid node, a line segment whose midpoint is located at the center of the preferred space-time image is set, and the length of the line segment is the shorter length of the side lengths of the preferred space-time image. The line segment is rotated at equal intervals to obtain a series of rotated line segments with the center of the preferred space-time image as the center and in the range of [0,2π]. The autocorrelation coefficient of each rotated line segment is calculated, and the autocorrelation coefficient of each rotated line segment is summed. The angle between the autocorrelation coefficient and the rotated line segment where the maximum value is located is taken as the direction of the river flow velocity corresponding to the preferred space-time image, and the tangent value of the river flow velocity direction is taken as the magnitude of the river flow velocity corresponding to the preferred space-time image.
[0048] In some embodiments, in step S1, a drone carrying a high-definition camera is used to collect surface flow images of wild rivers. At the same time, the drone can locate itself through its own satellite positioning module and realize wireless communication through a wireless transceiver module.
[0049] Furthermore, when collecting the surface flow images of wild rivers, the section position to be measured in the wild river is first selected. The selection of the section should follow the requirements of the river bank position with convenient placement of landmarks and the river surface with stable flow state. Reflective tapes are laid on both sides to accurately determine the section position. The river flow video at the section position is collected by drone. The video is required to be stable and contain enough effective information. Then, the collected river flow video is extracted frame by frame to obtain several surface flow images of wild rivers, so as to construct the original image sequence.
[0050] In some embodiments, in step S2, due to the inevitable problems of lens jitter, noise interference, etc. when the drone shoots video, the collected original video image cannot meet the calculation requirements well and cannot be used directly. Therefore, it is necessary to perform image correction and image enhancement on the constructed original image sequence in sequence to eliminate interference in the acquisition process, so that the subsequent flow velocity calculation is more accurate.
[0051] Furthermore, the purpose of image correction is to make the coordinates of the landmark points in the world coordinates correspond to the coordinate points in the image remain unchanged during the shooting process, so that the river in the processed image sequence can maintain a fixed position, eliminate the error caused by image jitter, and measure the flow rate of the river more accurately. The specific steps are as follows:
[0052] Step S21, taking the first original image collected by the drone as a reference, manually selecting some non-moving feature areas on the shore, wherein the principle of selecting the feature areas is that the feature areas have distinct features and their positions, shapes, colors, etc. remain unchanged during the entire shooting process;
[0053] Step S22, performing cross-correlation operation on the grayscale images in the feature area of each original image in the original image sequence except the first original image, respectively, with the first original image, to obtain the rotation and displacement of each feature area in each original image;
[0054] Step S23, according to the rotation and displacement of each feature area in each original image, obtain the matrix of the affine transformation corresponding to each original image and the first original image;
[0055] Step S24, inversely transform each original image according to the affine transformation matrix corresponding to each original image and the first original image, so that corresponding points of each original image have the same coordinates, forming a stable image sequence.
[0056] Furthermore, image enhancement is to emphasize some features in the image, such as the image's outline and edges, to enhance the area of interest, making it easier for the human eye to recognize and the computer to process. The disclosed embodiment uses a histogram equalization method to enhance the changes in the image surface texture of each image after image correction, making it clearer and easier to recognize. After completing the image correction and image enhancement processing, the flow velocity size and direction can be calculated.
[0057] In some embodiments, step S3 needs to calculate the flow velocity magnitude and direction for each image in the processed image sequence according to the same operation. Now, any one of the images is taken as an example for description. The specific steps are as follows:
[0058] Step S31, gridding any image in the processed image sequence, the size of the grid is determined according to the number of required flow velocity vectors, the more flow velocity vectors are required, the denser the grid division is, and a horizontal speed measurement line is set on each grid node, the length of which is determined by the number of consecutive images of the synthesized spatiotemporal image; as an embodiment of the present application, the length of the horizontal speed measurement line is taken as the length corresponding to 150 pixels, that is, it is synthesized by the speed measurement lines at the same position in 150 images;
[0059] Step S32: With the grid node as the center and α as the step length, the set horizontal speed measurement line is rotated in the range of [0, 2π], so that n = 1 + 2π / α speed measurement lines can be formed on the grid node, α is preferably 0.1° to 10°, and 2π should be divisible by α, so as to obtain speed measurement lines of various angles passing through the grid node, ensuring that each speed measurement line contains the same amount of information, and the formed series of speed measurement lines are recorded as the rotation speed measurement lines of the grid node, see Figure 2 In one embodiment of the present application, α=1° is taken, thereby generating n=361 speed measurement lines;
[0060] Step S33: for each speed measurement line of each grid node, synthesize the spatiotemporal image of each grid node according to the texture change of each speed measurement line in the image sequence, see Figure 3 In (a) to (f), the space-time images at different angles are shown, and the synthesized space-time images are all square. It can be found that the space-time images at some angles have clear textures, such as Figure 3 (a) in the figure, while the spatiotemporal image textures at some angles are messy and no clear straight lines are formed, such as Figure 3 (d)
[0061] Step S34: for each grid node, determine the optimal spatiotemporal image corresponding to it, the steps are as follows:
[0062] In order to determine the flow velocity and the clarity of the texture, edge detection is first performed on each spatiotemporal image to significantly reduce the noise in the image, thereby making the texture more prominent. Then, the characteristic gradient R(τ x ,τ y ):
[0063]
[0064] Among them, f(x,y) is the grayscale distribution of the pixel with coordinates (x,y) in the spatiotemporal image, (τ x ,τ y ) represents the texture displacement parameter of the pixel with coordinates (x, y) in the spatiotemporal image;
[0065] Then, the characteristic gradients of each spatiotemporal image are normalized to obtain the autocorrelation coefficient of each spatiotemporal image;
[0066] Finally, the space-time image with the largest autocorrelation coefficient is selected as the preferred space-time image of the corresponding grid node;
[0067] Step S35, for each preferred space-time image, set the shorter length of the side lengths of the preferred space-time image as the segment length, set the center of the preferred space-time image as the center of the circle, make the midpoint of the segment pass through the center of the circle, and rotate the segment with β as the step length, β is preferably 0.1°~10°, 2π should be divisible by β, in this embodiment β=0.1°, obtain the rotated line segments at various angles, calculate the autocorrelation coefficient of each rotated line segment (the specific calculation steps are the same as the calculation steps of the autocorrelation coefficient of the speed measurement line, which will not be repeated here), add the autocorrelation coefficients of each rotated line segment to obtain the sum of the correlation coefficients of each rotated straight line, compare the maximum value of the sum of the autocorrelation coefficients of each space-time image, wherein the angle of the rotating line segment where the maximum value of the sum of the autocorrelation coefficients is located is the direction of the river flow velocity corresponding to the preferred space-time image, and the tangent value of the angle is the magnitude of the river flow velocity corresponding to the preferred space-time image.
[0068] See also Figure 4 , is the preferred spatiotemporal image synthesized at a certain angle in this embodiment, where the vertical axis of the image represents the displacement X of the texture on the speed measurement line, and the horizontal axis represents the time t when the speed measurement line is collected. The light and dark changes of the river form textures in the spatiotemporal image, and these textures are roughly parallel, representing the displacement of each bright spot on the surface of the river over time. Therefore, the average of the tangent values of the angles θ between each straight line generated by the bright spot and the t-axis is the magnitude of the average flow velocity on the surface of the river at the speed measurement line during this period. Most wild rivers are curved. By rotating the speed measurement line on the surface of the river, the autocorrelation coefficient of the spatiotemporal image at each angle is calculated, and the autocorrelation coefficient and the maximum angle are solved. In the case of an unknown river flow direction, the mainstream direction is obtained, and the slope of the corresponding preferred spatiotemporal image is the magnitude of the river surface flow velocity.
[0069] Therefore, this embodiment uses the large-scale light and dark changes generated by the ripples on the river surface to replace the traditional tracer particles to calculate the surface velocity of the river, solving the problems of artificially spreading tracer particles and poor tracking of tracer particles under extreme conditions such as floods and dam breaks. In addition, there is no need to know the flow direction of the river surface in advance, which can well solve the problem of measuring the surface velocity of rivers in the wild where the flow direction changes greatly.
[0070] The second aspect of the present disclosure provides a two-dimensional spatiotemporal image velocity measuring device for a wild river surface, comprising:
[0071] An image acquisition module is used to acquire the surface flow image of a wild river at the position of the section to be measured, so as to construct an original image sequence;
[0072] An image preprocessing module is used to preprocess each original image in the constructed original image sequence to obtain a preprocessed image sequence;
[0073] The velocity and flow direction calculation module is used to first grid each image in the preprocessed image sequence, then set a horizontal velocity line on each grid node, and obtain a series of velocity lines with the grid node as the center and in the range of [0,2π] by rotating the velocity line at equal intervals. The series of velocity lines are recorded as the rotation velocity lines of the grid node, and several space-time images of each grid node are synthesized according to the texture changes of the rotation velocity lines of each grid node. The autocorrelation coefficient of each space-time image is calculated, and the space-time image with the largest autocorrelation coefficient is selected to obtain the space-time image of each grid node. a preferred space-time image of a point; for each of the preferred space-time images, a line segment whose midpoint is located at the center of the preferred space-time image is set, and the length of the line segment is the shorter length of the side lengths of the preferred space-time image; a series of rotated line segments with the center of the preferred space-time image as the center and in the range of [0,2π] are obtained by rotating the line segment at equal intervals; the autocorrelation coefficient of each rotated line segment is calculated, the autocorrelation coefficient of each rotated line segment is added, the angle between the autocorrelation coefficient and the rotated line segment where the maximum value is located is taken as the direction of river flow velocity, and the tangent value of the direction of river flow velocity is taken as the magnitude of river flow velocity.
[0074] It should be noted that the above-mentioned explanation of the embodiment of the method for measuring speed of a wild river surface using two-dimensional space-time images is also applicable to the device for measuring speed of a wild river surface using two-dimensional space-time images in this embodiment, and will not be repeated here.
[0075] In order to implement the above embodiment, the embodiment of the present disclosure also proposes a computer-readable storage medium on which a computer program is stored. The program is executed by a processor to execute the two-dimensional spatiotemporal image speed measurement method of the wild river surface in the above embodiment.
[0076] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. It should be noted that the electronic device in the embodiments of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, servers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0077] like Figure 5As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 102 or a program loaded from a storage device 108 to a random access memory (RAM) 103. In the RAM 103, various programs and data required for the operation of the electronic device are also stored. The processing device 101, the ROM 102, and the RAM 103 are connected to each other via a bus 104. An input / output (I / O) interface 105 is also connected to the bus 104.
[0078] Typically, the following devices may be connected to the I / O interface 105: an input device 106 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, etc.; an output device 107 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 108 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 109. The communication device 109 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Figure 5 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0079] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the present embodiment includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 109, or installed from the storage device 108, or installed from the ROM 102. When the computer program is executed by the processing device 101, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0080] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0081] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0082] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the two-dimensional spatiotemporal image velocity measurement method of the wild river surface.
[0083] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, python, and conventional procedural programming languages, such as "C-" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0084] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0085] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0086] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0087] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.
[0088] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0089] A person of ordinary skill in the art may understand that all or part of the steps carried out in the above-mentioned embodiment method may be implemented by instructing the relevant hardware through a program, and the developed program may be stored in a computer-readable storage medium, which, when executed, includes one of the steps of the method embodiment or a combination thereof.
[0090] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0091] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A method for measuring the velocity of a river surface using two-dimensional space-time images in the wild, characterized in that: The following steps are involved: Step S1, collecting surface flow images at the cross-section to be measured in a wild river, thereby constructing an original image sequence; Step S2, preprocessing each original image in the original image sequence to obtain a preprocessed image sequence; Step S3: for each image in the preprocessed image sequence, firstly divide the image into grids, then set a horizontal speed measurement line on each grid node, and obtain a series of speed measurement lines with the grid node as the center and in the range of [0, 2π] by rotating the speed measurement line at equal intervals. The series of speed measurement lines are recorded as the rotation speed measurement lines of the grid node, and a plurality of space-time images of each grid node are synthesized according to the texture change of the rotation speed measurement lines of each grid node, and the autocorrelation coefficient of each space-time image is calculated. The space-time image with the largest autocorrelation coefficient is selected to obtain the optimal space-time image of each grid node. Image; for each of the preferred space-time images, set a line segment whose midpoint is located at the center of the preferred space-time image, the length of the line segment is the shorter length of the side lengths of the preferred space-time image, and obtain a series of rotated line segments with the center of the preferred space-time image as the center and in the range of [0,2π] by rotating the line segments at equal intervals, calculate the autocorrelation coefficient of each rotated line segment, add the autocorrelation coefficients of each rotated line segment, take the angle between the autocorrelation coefficient and the rotated line segment where the maximum value is located as the direction of river flow velocity, and take the tangent value of the direction of river flow velocity as the magnitude of river flow velocity.
2. The two-dimensional space-time image velocity measurement method according to claim 1, characterized in that: In step S1, the section to be measured should be located at a river bank where the marking point can be conveniently placed and the river surface has a stable flow state.
3. The two-dimensional space-time image velocity measurement method according to claim 1, characterized in that: In step S1, a surface flow video at a section to be measured in a wild river is obtained by using a drone carrying a high-definition camera, and images are extracted frame by frame from the surface flow video to obtain a plurality of surface flow images.
4. The two-dimensional space-time image velocity measurement method according to claim 1, characterized in that: In step S2, the preprocessing performed on each original image includes sequentially performing image correction and image enhancement on each original image.
5. The two-dimensional space-time image velocity measurement method according to claim 4, characterized in that: The image correction comprises the following steps: Taking the first original image in the original image sequence as a reference, selecting a plurality of non-moving feature areas of the bank in the original image; Performing cross-correlation operations on the grayscale images in the feature regions of the remaining original images in the original image sequence with the first original image to obtain rotations and displacements of the feature regions in each original image; According to the rotation and displacement of each feature area in each original image, the matrix of the affine transformation corresponding to each original image and the first original image is obtained; Each original image is inversely transformed according to the affine transformation matrix corresponding to each original image and the first original image, so that the corresponding points of each original image have the same coordinates, forming a corrected image sequence.
6. The two-dimensional space-time image velocity measurement method according to claim 1, characterized in that: In step S3, the angle between two adjacent speed measurement lines ranges from 0.1° to 10°.
7. The two-dimensional space-time image velocity measurement method according to claim 1, characterized in that: In step S3, the angle between two adjacent rotation line segments ranges from 0.1° to 10°.
8. The two-dimensional space-time image velocity measurement method according to claim 1, characterized in that: In step S3, the autocorrelation coefficients of the space-time image and the preferred space-time image are calculated according to the following steps: Performing edge detection on the spatiotemporal image or the preferred spatiotemporal image to reduce noise in the image; The characteristic gradient R(τ) of the spatiotemporal image or the preferred spatiotemporal image is calculated according to the following formula x ,τ y ): Where f(x,y) is the grayscale distribution of the pixel with coordinates (x,y) in the spatiotemporal image or preferably in the spatiotemporal image, (τ x ,τ y ) is the texture displacement parameter of the pixel point with coordinates (x, y) in the spatiotemporal image or the preferred spatiotemporal image; The characteristic gradient of the space-time image or the preferred space-time image is normalized to obtain the autocorrelation coefficient of the space-time image or the preferred space-time image.
9. A two-dimensional spatiotemporal image velocity measuring device for a wild river surface, characterized in that: include: An image acquisition module is used to acquire surface flow images at the cross-section of a river to be tested in the wild, so as to construct an original image sequence; An image preprocessing module, used for preprocessing each original image in the original image sequence to obtain a preprocessed image sequence; The velocity and flow direction calculation module is used to first grid each image in the preprocessed image sequence, then set a horizontal velocity line on each grid node, and obtain a series of velocity lines with the grid node as the center and in the range of [0, 2π] by rotating the velocity line at equal intervals. The series of velocity lines are recorded as the rotation velocity lines of the grid node, and a plurality of space-time images of each grid node are synthesized according to the texture changes of the rotation velocity lines of each grid node, and the autocorrelation coefficient of each space-time image is calculated. The space-time image with the largest autocorrelation coefficient is selected to obtain the preferred image of each grid node. space-time image; for each of the preferred space-time images, a line segment whose midpoint is located at the center of the preferred space-time image is set, and the length of the line segment is the shorter length of the side lengths of the preferred space-time image, and a series of rotated line segments with the center of the preferred space-time image as the center and in the range of [0,2π] are obtained by rotating the line segments at equal intervals, and the autocorrelation coefficient of each rotated line segment is calculated, and the autocorrelation coefficient of each rotated line segment is added, and the angle between the autocorrelation coefficient and the rotated line segment where the maximum value is located is used as the direction of river flow velocity, and the tangent value of the direction of river flow velocity is used as the magnitude of river flow velocity.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the two-dimensional spatiotemporal image velocity measurement method for the surface of a wild river according to any one of claims 1 to 8.
Citation Information
Patent Citations
Non-contact river surface flow field imaging measuring method
CN102866260A
3D-3C particle image velocity measurement system and method based on integrated imaging technology
CN107525945A