CN115359028A - Liquid flow velocity detection method, detection device and storage medium - Google Patents
Liquid flow velocity detection method, detection device and storage medium Download PDFInfo
- Publication number
- CN115359028A CN115359028A CN202211057508.6A CN202211057508A CN115359028A CN 115359028 A CN115359028 A CN 115359028A CN 202211057508 A CN202211057508 A CN 202211057508A CN 115359028 A CN115359028 A CN 115359028A
- Authority
- CN
- China
- Prior art keywords
- target
- flow velocity
- image
- optical flow
- liquid
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/11—Complex mathematical operations for solving equations, e.g. nonlinear equations, general mathematical optimization problems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10016—Video; Image sequence
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Mathematical Physics (AREA)
- Mathematical Optimization (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Pure & Applied Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Geometry (AREA)
- Operations Research (AREA)
- Algebra (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Indicating Or Recording The Presence, Absence, Or Direction Of Movement (AREA)
Abstract
本申请实施例公开了一种液体的流速检测方法、检测装置以及存储介质,用于速度检测技术领域,本申请实施例方法包括:获取拍摄流动液体的视频流,将视频流中的多帧视频图像转换为多帧灰度图像;根据液体中同一粒子在任意相邻两帧灰度图像之间的像素点位置偏移量,确定不满足预设差异条件的目标粒子,并删除目标粒子在多帧灰度图像中对应的像素点,得到多帧目标灰度图像;将同一粒子的像素点位置偏移量以及间隔时长代入稀疏光流算法,得到目标光流速度;根据视频流对应的尺寸缩放比例,将目标光流速度进行缩放处理得到液体的目标流速,能够测得较为精准的液体流速。
The embodiment of the present application discloses a liquid flow velocity detection method, detection device, and storage medium, which are used in the technical field of velocity detection. The method in the embodiment of the application includes: acquiring a video stream of the flowing liquid, and converting the multi-frame video in the video stream to The image is converted into a multi-frame grayscale image; according to the pixel position offset of the same particle in the liquid between any two adjacent grayscale images, the target particles that do not meet the preset difference conditions are determined, and the target particles are deleted. Multi-frame target grayscale images are obtained from the corresponding pixels in the frame grayscale image; the pixel position offset and interval time of the same particle are substituted into the sparse optical flow algorithm to obtain the target optical flow velocity; scaling according to the corresponding size of the video stream Ratio, the target optical flow velocity is scaled to obtain the target flow velocity of the liquid, which can measure a more accurate liquid flow velocity.
Description
技术领域technical field
本申请实施例涉及速度检测技术领域,尤其涉及一种液体的流速检测方法、检测装置以及存储介质。The embodiments of the present application relate to the technical field of speed detection, and in particular, to a liquid flow speed detection method, detection device, and storage medium.
背景技术Background technique
河流流速测量是天然河道与人工渠道中水流监测的重要任务之一,准确的监测水流状况有利于防范山洪等地质灾害。液体流速是液体行为的重要描述量,也是研究流体动力学的重要参数之一,流速检测是流量检测的基础,只有准确检测了流速才可准确测量流量,对流速的有效检测十分重要。River flow velocity measurement is one of the important tasks of water flow monitoring in natural rivers and artificial channels. Accurate monitoring of water flow conditions is conducive to preventing geological disasters such as mountain torrents. Liquid velocity is an important description of liquid behavior and one of the important parameters in the study of fluid dynamics. Flow velocity detection is the basis of flow detection. Only when the flow velocity is accurately detected can the flow be accurately measured. Effective detection of flow velocity is very important.
现有的检测流速的方法一般包括转子式流速仪和超声雷达流速仪。转子式流速仪需要置于流场中,会对液体的流场本体形成干扰,从而改变其局部流速,且一般用于单点的流速检测;超声雷达流速仪则是基于超声波原理,利用多普勒效应,在和被测液体接触过程中,利用多普勒频移测出被测液体的流速,超声波在液体传输过程中存在不稳定性,传输距离不宜过远,一般对局部进行测速,测量的范围具有限局限性。Existing methods for detecting flow velocity generally include rotameters and ultrasonic radar flowmeters. The rotor-type flow meter needs to be placed in the flow field, which will interfere with the flow field body of the liquid, thereby changing its local flow velocity, and is generally used for single-point flow velocity detection; the ultrasonic radar flow meter is based on the ultrasonic principle, using Doppler In the process of contact with the measured liquid, the flow velocity of the measured liquid is measured by using Doppler frequency shift. The ultrasonic wave is unstable during the liquid transmission process, and the transmission distance should not be too far. Generally, the local speed measurement and measurement range is limited.
因此,现有的流速检测方法一般用于单点的流速检测或对局部进行测速,测量的液体流速不够精准。Therefore, the existing flow velocity detection methods are generally used for single-point flow velocity detection or local velocity measurement, and the measured liquid flow velocity is not accurate enough.
发明内容Contents of the invention
本申请实施例提供了一种液体的流速检测方法、检测装置以及存储介质,能够测得较为精准的液体流速。Embodiments of the present application provide a liquid flow rate detection method, a detection device, and a storage medium, capable of measuring a relatively accurate liquid flow rate.
本申请实施例提供了一种液体的流速检测方法,包括:The embodiment of the present application provides a liquid flow rate detection method, including:
获取拍摄流动液体的视频流,将所述视频流中的多帧视频图像转换为多帧灰度图像;Obtaining a video stream for capturing a flowing liquid, and converting multiple frames of video images in the video stream into multiple frames of grayscale images;
根据所述液体中同一粒子在任意相邻两帧灰度图像之间的像素点位置偏移量,确定不满足预设差异条件的目标粒子,并删除所述目标粒子在多帧所述灰度图像中对应的像素点,得到多帧目标灰度图像;According to the pixel position offset of the same particle in the liquid between any two adjacent frames of grayscale images, determine the target particles that do not meet the preset difference conditions, and delete the target particles in the grayscale of multiple frames corresponding pixels in the image to obtain multiple frames of target grayscale images;
确定所述多帧目标灰度图像中相邻两帧目标灰度图像中同一粒子的像素点位置偏移量,确定所述相邻两帧目标灰度图像的间隔时长;将所述同一粒子的像素点位置偏移量以及所述间隔时长代入稀疏光流算法,得到目标光流速度;Determine the pixel point offset of the same particle in two adjacent frames of the target gray image in the multiple frames of the target gray image, and determine the interval between the two adjacent frames of the target gray image; Substituting the pixel position offset and the interval duration into the sparse optical flow algorithm to obtain the target optical flow velocity;
根据所述视频流对应的尺寸缩放比例,将所述目标光流速度进行缩放处理得到所述液体的目标流速。According to the scaling ratio corresponding to the video stream, the target optical flow velocity is scaled to obtain the target flow velocity of the liquid.
进一步的,所述任意相邻两帧灰度图像包括:第一帧灰度图像以及第二帧灰度图像;Further, said any two adjacent frames of grayscale images include: a first frame of grayscale image and a second frame of grayscale image;
所述根据所述液体中同一粒子在任意相邻两帧灰度图像之间的像素点位置偏移量,确定不满足预设差异条件的目标粒子包括:The determining the target particle that does not meet the preset difference condition according to the pixel position offset of the same particle in the liquid between any two adjacent frames of grayscale images includes:
获取所述第一帧灰度图像至所述第二帧灰度图像的第一像素点位置偏移量,并获取所述第二帧灰度图像至所述第一帧灰度图像的第二像素点位置偏移量;Obtain the first pixel point position offset from the first frame of grayscale image to the second frame of grayscale image, and obtain the second pixel point position offset from the second frame of grayscale image to the first frame of grayscale image Pixel position offset;
获取所述第一帧灰度图像中任一像素点的第一像素点位置;Acquiring the first pixel position of any pixel in the first frame of grayscale image;
根据所述第一像素点位置偏移量以及所述第一像素点位置,得到所述任一像素点对应于所述第二帧灰度图像的像素点位置;According to the offset of the first pixel point position and the first pixel point position, obtain the pixel point position corresponding to the grayscale image of the second frame of any pixel point;
根据所述第二像素点位置偏移量以及所述第二帧灰度图像的像素点位置,预测所述任一像素点在所述第一帧灰度图像中的第二像素点位置;Predicting a second pixel position of any pixel in the first frame of grayscale image according to the second pixel position offset and the pixel position of the second frame of grayscale image;
若所述第一像素点位置与所述第二像素点位置的距离大于预设距离阈值,则确定所述任一像素点所对应的粒子为不满足所述预设差异条件的目标粒子。If the distance between the first pixel point position and the second pixel point position is greater than a preset distance threshold, it is determined that the particle corresponding to any pixel point is a target particle that does not satisfy the preset difference condition.
进一步的,所述将所述同一粒子的像素点位置偏移量以及所述间隔时长代入稀疏光流算法,得到目标光流速度包括:Further, the step of substituting the pixel position offset of the same particle and the interval duration into the sparse optical flow algorithm to obtain the target optical flow velocity includes:
根据所述稀疏光流算法得到所述目标光流速度其中所述所述x、y表示所述同一粒子在x、y方向的像素点位置偏移量,t表示所述间隔时长,Ix,Iy,It分别表示x、y方向的像素点位置偏移量的偏导数以及间隔时长t的偏导数。According to the sparse optical flow algorithm Get the target optical flow velocity which stated said x, y represent described same particle in x, the pixel point position offset of y direction, t represents described interval duration, Ix, Iy, It represent respectively the partial derivative of the pixel point position offset of x, y direction and The partial derivative of the interval duration t.
进一步的,所述将所述同一粒子的像素点位置偏移量以及所述间隔时长代入稀疏光流算法,得到目标光流速度包括:Further, the step of substituting the pixel position offset of the same particle and the interval duration into the sparse optical flow algorithm to obtain the target optical flow speed includes:
通过对所述相邻两帧目标灰度图像连续降采样,将各次采样得到的相邻两帧目标灰度图像构建为图像金字塔;其中,所述图像金字塔的最底层为所述相邻两帧目标灰度图像,最高层为以最低采样率采样得到的相邻两帧目标灰度图像;By continuously down-sampling the two adjacent frames of target grayscale images, the two adjacent frames of target grayscale images obtained by each sampling are constructed into an image pyramid; wherein, the bottom layer of the image pyramid is the two adjacent frames The frame target grayscale image, the highest layer is two adjacent frames of target grayscale images sampled at the lowest sampling rate;
将所述图像金字塔中最高层图像中同一粒子的像素点位置偏移量,以及所述最高层图像中相邻两帧目标灰度图像的间隔时长代入稀疏光流算法,得到所述图像金字塔最高层图像的第一光流速度;Substituting the pixel position offset of the same particle in the highest layer image in the image pyramid, and the interval between two adjacent frames of target grayscale images in the highest layer image into the sparse optical flow algorithm, the highest image pyramid is obtained. The first optical flow velocity of the layer image;
基于所述第一光流速度迭代逐层计算所述图像金字塔每层图像的光流速度,直至得到最底层图像的光流速度结束迭代,将所述最底层图像的光流速度作为所述目标光流速度。Iteratively calculate the optical flow velocity of each layer image of the image pyramid based on the first optical flow velocity until the optical flow velocity of the bottom image is obtained, and the iteration is completed, and the optical flow velocity of the bottom image is used as the target Optical flow velocity.
进一步的,所述根据所述视频流对应的尺寸缩放比例,将所述目标光流速度进行缩放处理得到所述液体的目标流速之前,还包括:Further, before performing scaling processing on the target optical flow velocity according to the scaling ratio corresponding to the video stream to obtain the target flow velocity of the liquid, the method further includes:
计算所述间隔时长内所述液体的流动距离与所述间隔时长内像素点的位移距离的线性关系,将所述线性关系作为所述尺寸缩放比例。Calculate the linear relationship between the flow distance of the liquid within the interval time and the displacement distance of the pixel point within the interval time, and use the linear relationship as the size scaling ratio.
进一步的,所述相邻两帧目标灰度图像为多组,多组相邻两帧目标灰度图像对应得到多个目标光流速度;Further, the two adjacent frames of target grayscale images are multiple groups, and multiple groups of two adjacent frames of target grayscale images correspond to multiple target optical flow velocities;
所述根据所述视频流对应的尺寸缩放比例,将所述目标光流速度进行缩放处理得到所述液体的目标流速包括:The step of scaling the target optical flow velocity to obtain the target flow velocity of the liquid according to the scaling ratio corresponding to the video stream includes:
根据多个所述目标光流速度确定光流速度;determining an optical flow velocity according to a plurality of target optical flow velocities;
根据所述线性关系将所述光流速度转换成所述液体的目标流速。converting the optical flow velocity into a target flow velocity of the liquid according to the linear relationship.
进一步的,所述相邻两帧目标灰度图像为多组,多组相邻两帧目标灰度图像对应得到多个目标光流速度;Further, the two adjacent frames of target grayscale images are multiple groups, and multiple groups of two adjacent frames of target grayscale images correspond to multiple target optical flow velocities;
所述根据所述视频流对应的尺寸缩放比例,将所述目标光流速度进行缩放处理得到所述液体的目标流速包括:The step of scaling the target optical flow velocity to obtain the target flow velocity of the liquid according to the scaling ratio corresponding to the video stream includes:
根据所述线性关系将多个所述目标光流速度转换成所述液体的多个流速;converting a plurality of the target optical flow velocities into a plurality of flow velocities of the liquid according to the linear relationship;
根据所述液体的多个流速确定所述液体的目标流速。A target flow rate of the liquid is determined according to a plurality of flow rates of the liquid.
本申请实施例还提供了一种液体的流速检测装置,包括:The embodiment of the present application also provides a liquid flow rate detection device, including:
获取单元,用于获取拍摄流动液体的视频流,将所述视频流中的多帧视频图像转换为多帧灰度图像;An acquisition unit, configured to acquire a video stream for capturing a flowing liquid, and convert multiple frames of video images in the video stream into multiple frames of grayscale images;
删除单元,用于根据所述液体中同一粒子在任意相邻两帧灰度图像之间的像素点位置偏移量,确定不满足预设差异条件的目标粒子,并所述目标粒子在多帧所述灰度图像中对应的像素点,得到多帧目标灰度图像;The deletion unit is used to determine the target particles that do not meet the preset difference conditions according to the pixel position offset of the same particle in the liquid between any two adjacent frames of grayscale images, and the target particles in the multi-frame corresponding pixels in the grayscale image to obtain multiple frames of target grayscale images;
确定单元,用于确定所述多帧目标灰度图像中相邻两帧目标灰度图像中同一粒子的像素点位置偏移量,确定所述相邻两帧目标灰度图像的间隔时长;执行单元,用于将所述同一粒子的像素点位置偏移量以及所述间隔时长代入稀疏光流算法,得到目标光流速度;A determining unit, configured to determine the pixel point offset of the same particle in two adjacent frames of the target gray-scale image in the multi-frame target gray-scale image, and determine the interval between the two adjacent frames of the target gray-scale image; execute A unit for substituting the pixel position offset of the same particle and the interval duration into the sparse optical flow algorithm to obtain the target optical flow velocity;
处理单元,用于根据所述视频流对应的尺寸缩放比例,将所述目标光流速度进行缩放处理得到所述液体的目标流速。The processing unit is configured to perform scaling processing on the target optical flow velocity to obtain the target flow velocity of the liquid according to the scaling ratio corresponding to the video stream.
本申请实施例还提供了一种液体的流速检测装置,包括:The embodiment of the present application also provides a liquid flow rate detection device, including:
中央处理器,存储器,输入输出接口,有线或无线网络接口,电源;Central processing unit, memory, input and output interface, wired or wireless network interface, power supply;
所述存储器为短暂存储存储器或持久存储存储器;The memory is a temporary storage memory or a persistent storage memory;
所述中央处理器配置为与所述存储器通信,在控制面功能实体上执行所述存储器中的指令操作以执行上述的流速检测方法。The central processing unit is configured to communicate with the memory, and to execute instruction operations in the memory on the control plane functional entity to execute the above-mentioned flow velocity detection method.
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质包括指令,当所述指令在计算机上运行时,使得计算机执行上述的流速检测方法。The embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium includes instructions, and when the instructions are run on a computer, the computer is made to execute the above method for detecting flow velocity.
从以上技术方案可以看出,本申请实施例具有以下优点:It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
本申请实施例中获取拍摄流动液体的视频流,将视频流中的多帧视频图像转换为多帧灰度图像;根据液体中同一粒子在任意相邻两帧灰度图像之间的像素点位置偏移量,确定不满足预设差异条件的目标粒子,并删除目标粒子在多帧灰度图像中对应的像素点,得到多帧目标灰度图像;确定多帧目标灰度图像中相邻两帧目标灰度图像中同一粒子的像素点位置偏移量,确定相邻两帧目标灰度图像的间隔时长;将同一粒子的像素点位置偏移量以及间隔时长代入稀疏光流算法,得到目标光流速度;根据视频流对应的尺寸缩放比例,将目标光流速度进行缩放处理得到液体的目标流速。通过多帧目标灰度图像中相邻两帧目标灰度图像中同一粒子的像素点位置偏移量得到液体的目标流速,能够全局地对液体流动面进行测速,测得的液体流速更加精准。In the embodiment of the present application, the video stream of the flowing liquid is obtained, and the multi-frame video images in the video stream are converted into multi-frame grayscale images; according to the pixel position of the same particle in the liquid between any two adjacent grayscale images Offset, determine the target particles that do not meet the preset difference conditions, and delete the corresponding pixels of the target particles in the multi-frame grayscale image to obtain a multi-frame target grayscale image; The pixel position offset of the same particle in the target grayscale image of the frame determines the interval between two adjacent frames of the target grayscale image; the pixel position offset and the interval of the same particle are substituted into the sparse optical flow algorithm to obtain the target Optical flow velocity: according to the scaling ratio corresponding to the video stream, the target optical flow velocity is scaled to obtain the target flow velocity of the liquid. The target flow velocity of the liquid is obtained by the pixel position offset of the same particle in two adjacent frames of the target grayscale image in multiple frames of the target grayscale image, and the velocity of the liquid flow surface can be measured globally, and the measured liquid flow velocity is more accurate.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are only some implementations recorded in the application. For example, those skilled in the art can also obtain other drawings based on these drawings.
图1为本申请实施例公开的一个液体的流速检测的流程图;Fig. 1 is a flow chart of the flow rate detection of a liquid disclosed in the embodiment of the present application;
图2为本申请实施例公开的另一液体的流速检测的流程图;Fig. 2 is a flow chart of the flow rate detection of another liquid disclosed in the embodiment of the present application;
图3为本申请实施例公开的一个液体分层测速的示意图;Fig. 3 is a schematic diagram of a liquid layered velocity measurement disclosed in the embodiment of the present application;
图4为本申请实施例公开的一个流速检测装置的示意图;FIG. 4 is a schematic diagram of a flow rate detection device disclosed in an embodiment of the present application;
图5为本申请实施例公开的另一流速检测装置的示意图。Fig. 5 is a schematic diagram of another flow velocity detection device disclosed in the embodiment of the present application.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiment of the application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the application. Obviously, the described embodiment is only It is a part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
在本申请实施例的描述中,需要说明的是,术语“中心”、“上”、“下”、“左”、“右”、“竖直”、“水平”、“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本申请实施例和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本申请实施例的限制。In the description of the embodiments of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer " and other indicated orientations or positional relationships are based on the orientations or positional relationships shown in the drawings, and are only for the convenience of describing the embodiments of the present application and simplifying the description, rather than indicating or implying that the referred device or element must have a specific orientation, Constructed and operative in a particular orientation and therefore should not be construed as limiting to the embodiments of the present application.
在本申请实施例的描述中,需要说明的是,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本申请实施例中的具体含义。In the description of the embodiments of this application, it should be noted that unless otherwise specified and limited, the terms "installation", "connection", and "connection" should be understood in a broad sense, for example, it can be a fixed connection or a A detachable connection, or an integral connection; it may be a mechanical connection or an electrical connection; it may be a direct connection or an indirect connection through an intermediary, and it may be an internal communication between two components. Those of ordinary skill in the art can understand the specific meanings of the above terms in the embodiments of the present application in specific situations.
现有的对液体进行检测流速的方法一般包括转子式流速仪和超声雷达流速仪,转子式流速仪需要置于流场中,会对液体的流场本体形成干扰,从而改变其局部流速,且一般用于单点的流速检测;超声雷达流速仪则是基于超声波原理,利用多普勒效应,在和被测液体接触过程中,利用多普勒频移测出被测液体的流速,超声波在液体传输过程中存在不稳定性,传输距离不宜过远,一般对局部进行测速,测量的范围具有限局限性。可见,现有的流速检测方法一般用于单点的流速检测或对局部进行测速,测量的液体流速不够精准。因此,本申请实施例提供了一种液体的流速检测方法,能够使测得的液体流速更加精准,如图1所示,具体步骤如下:Existing methods for detecting the flow velocity of liquids generally include rotor-type flow meters and ultrasonic radar flow meters. The rotor-type flow meters need to be placed in the flow field, which will interfere with the flow field body of the liquid, thereby changing its local flow velocity, and It is generally used for single-point flow velocity detection; the ultrasonic radar flowmeter is based on the principle of ultrasound, using the Doppler effect, and using the Doppler frequency shift to measure the flow velocity of the liquid under test during the contact process with the liquid under test. There is instability in the process of liquid transmission, and the transmission distance should not be too far. Generally, the velocity is measured locally, and the measurement range is limited. It can be seen that the existing flow velocity detection methods are generally used for single-point flow velocity detection or local velocity measurement, and the measured liquid flow velocity is not accurate enough. Therefore, the embodiment of the present application provides a liquid flow rate detection method, which can make the measured liquid flow rate more accurate, as shown in Figure 1, the specific steps are as follows:
101、获取拍摄流动液体的视频流,将视频流中的多帧视频图像转换为多帧灰度图像。101. Acquire a video stream for capturing a flowing liquid, and convert multiple frames of video images in the video stream into multiple frames of grayscale images.
流速检测装置可以获取拍摄流动液体的视频流,将视频流中的多帧视频图像转换为多帧灰度图像。该液体(水体)包括水和其中溶解的物质,主要为非浑浊液体。流速检测装置可以通过控制一字激光器向流动液体发出一字平面激光,激光射入液体后,液体中杂质将对激光产生反射;流速检测装置控制摄像机拍摄反射的粒子图像,采集液体的激光反射点的图像得到液体的视频流。接着,可以使用rgb2gray()函数或RGB三通道法将视频流中的多帧视频图像转换为多帧灰度图像,具体此处不做限定。The flow velocity detection device can acquire a video stream of shooting liquid, and convert multiple frames of video images in the video stream into multiple frames of grayscale images. The liquid (body of water) includes water and substances dissolved therein, and is primarily a non-turbid liquid. The flow velocity detection device can control the laser to emit a flat laser to the flowing liquid. After the laser is injected into the liquid, the impurities in the liquid will reflect the laser light; the flow velocity detection device controls the camera to capture the reflected particle image and collect the laser reflection point of the liquid. The image gets a video stream of the liquid. Next, the rgb2gray() function or RGB three-channel method can be used to convert multiple frames of video images in the video stream into multiple frames of grayscale images, which are not limited here.
102、删除目标粒子在多帧灰度图像中对应的像素点,得到多帧目标灰度图像。102. Delete the pixel points corresponding to the target particles in the multiple frames of grayscale images to obtain multiple frames of target grayscale images.
流速检测装置可以根据液体中同一粒子在任意相邻两帧灰度图像之间的像素点位置偏移量,确定不满足预设差异条件的目标粒子,删除目标粒子在多帧灰度图像中对应的像素点,得到多帧目标灰度图像。具体的,任意相邻两帧灰度图像包括:第一帧灰度图像以及第二帧灰度图像;其中,根据所述液体中同一粒子在任意相邻两帧灰度图像之间的像素点位置偏移量,确定不满足预设差异条件的目标粒子包括:获取第一帧灰度图像至第二帧灰度图像的第一像素点位置偏移量,并获取第二帧灰度图像至第一帧灰度图像的第二像素点位置偏移量;可以理解的是可以任意取多个液体粒子对应在第一帧灰度图像与第二帧灰度图像的多个像素点位置,可以以第一帧灰度图像的多个像素点位置为起点,以第二帧灰度图像的多个像素点位置为终点,得到多个像素点位置在x、y方向上的多个偏移量,对该多个偏移量取众数或平均值,即可得到第一帧灰度图像至第二帧灰度图像的第一像素点位置偏移量;该第二像素点位置偏移量可以再次任意取多个液体粒子对应在第一帧灰度图像与第二帧灰度图像的多个像素点位置,以第二帧灰度图像的多个像素点位置为起点得到第二帧灰度图像至第一帧灰度图像的第二像素点位置偏移量。同时,可以获取第一帧灰度图像中任一像素点的第一像素点位置,该第一像素点位置一般为真实的像素点位置。The flow velocity detection device can determine the target particles that do not meet the preset difference conditions according to the pixel position offset of the same particle in the liquid between any two adjacent gray-scale images, and delete the target particles corresponding to the multi-frame gray-scale images. pixels to obtain multiple frames of target grayscale images. Specifically, any two adjacent frames of grayscale images include: a first frame of grayscale image and a second frame of grayscale image; wherein, according to the pixel points of the same particle in the liquid between any two adjacent frames of grayscale images Position offset, determining the target particles that do not meet the preset difference conditions includes: obtaining the first pixel position offset from the first frame of grayscale image to the second frame of grayscale image, and obtaining the second frame of grayscale image to The second pixel position offset of the first frame grayscale image; it can be understood that a plurality of liquid particles can be arbitrarily taken to correspond to multiple pixel positions of the first frame grayscale image and the second frame grayscale image, which can be Taking multiple pixel positions of the first frame of grayscale image as the starting point, and taking multiple pixel positions of the second frame of grayscale image as the end point, obtain multiple offsets of multiple pixel point positions in the x and y directions , taking the mode or average value of the plurality of offsets, the first pixel position offset from the first frame grayscale image to the second frame grayscale image can be obtained; the second pixel position offset Again, a plurality of liquid particles can be arbitrarily selected to correspond to multiple pixel positions of the first frame grayscale image and the second frame grayscale image, and the second frame grayscale image can be obtained starting from the multiple pixel point positions of the second frame grayscale image The second pixel position offset from the grayscale image to the first frame of grayscale image. At the same time, the first pixel point position of any pixel point in the first frame of the grayscale image can be obtained, and the first pixel point position is generally a real pixel point position.
根据第一像素点位置偏移量以及第一像素点位置,得到任一像素点对应于第二帧灰度图像的像素点位置;可以理解的是,该第一像素点位置偏移量一般为x、y方向上的偏移量,根据该第一像素点位置偏移量将任一像素点在x、y方向上偏移,即可得到任一像素点对应于第二帧灰度图像的像素点位置。根据第二像素点位置偏移量以及第二帧灰度图像的像素点位置,预测任一像素点在第一帧灰度图像中的第二像素点位置;可以理解的是,根据第二像素点位置偏移量将第二帧灰度图像的像素点位置进行偏移后,可以预测该任一像素点第一帧灰度图像中的第二像素点位置,一般情况下,第一帧灰度图像上该任一像素点的第一像素点位置以及第二像素点位置的距离相近或在同一位置。若第一像素点位置与第二像素点位置的距离大于预设距离阈值,则确定任一像素点所对应的粒子为不满足预设差异条件的目标粒子,该预设距离阈值可以为10厘米或20厘米,具体此处不做限定;第一像素点位置与第二像素点位置的距离过远,则表面该任一像素点在灰度图像中的偏差较大,需删除该任一像素点对应的目标粒子在多帧灰度图像中对应的像素点。According to the first pixel position offset and the first pixel position, any pixel corresponding to the pixel position of the second frame grayscale image is obtained; it can be understood that the first pixel position offset is generally The offset in the x and y directions, according to the position offset of the first pixel point, any pixel point is offset in the x and y directions, so that any pixel point corresponding to the second frame of the grayscale image can be obtained Pixel location. According to the second pixel position offset and the pixel position of the second frame grayscale image, predict the second pixel position of any pixel in the first frame grayscale image; it can be understood that according to the second pixel Point position offset After offsetting the pixel point position of the second frame grayscale image, the second pixel point position in the first frame grayscale image of any pixel point can be predicted. Generally, the first frame grayscale image The distance between the first pixel point and the second pixel point of any pixel point on the image is close to or at the same position. If the distance between the first pixel point position and the second pixel point position is greater than the preset distance threshold, it is determined that the particle corresponding to any pixel point is a target particle that does not meet the preset difference condition, and the preset distance threshold can be 10 cm or 20 cm, which is not limited here; the distance between the first pixel position and the second pixel position is too far, and the deviation of any pixel on the surface in the grayscale image is large, and any pixel needs to be deleted The point corresponds to the pixel point of the target particle in the multi-frame grayscale image.
在一种可实现的方案中,如图2所示,从视频流中获取第一帧图像,并将第一帧图像转化为灰度图像,创建轨迹数组Trajectories,将第一帧灰度图像的角点位置(角点位置为液体粒子在灰度图像中的像素点位置)加入到数组Trajectories,从视频流中获取第二帧图像,并转化为灰度图像;根据第一帧灰度图像至第二帧灰度图像的像素点位置偏移量以及第一帧灰度图像的角点位置获取第二帧灰度图像的角点位置;根据第二帧灰度图像至第一帧灰度图像的像素点位置偏移量以及第二帧灰度图像的角点位置获取第一帧灰度图像的角点位置;将获取到的第一帧角点与数组Trajectories中相对应点相减,求二者间距离;判断二者距离是否小于预设距离阈值,若否则将该角点删除;若是则将第二帧灰度图像的角点加入数组new-Trajectories,将new-Trajectories中的点赋值给数组Trajectories,可以得到角点轨迹,利用LK算法即可计算出光流速度。In an achievable scheme, as shown in Figure 2, the first frame image is obtained from the video stream, and the first frame image is converted into a grayscale image, and the trajectory array Trajectories is created, and the first frame grayscale image The corner position (the corner position is the pixel position of the liquid particle in the grayscale image) is added to the array Trajectories, the second frame image is obtained from the video stream, and converted into a grayscale image; according to the first frame grayscale image to The pixel position offset of the second frame of grayscale image and the corner position of the first frame of grayscale image obtain the corner position of the second frame of grayscale image; according to the second frame of grayscale image to the first frame of grayscale image Obtain the corner position of the first frame gray image; subtract the obtained first frame corner point from the corresponding point in the array Trajectories to find The distance between the two; determine whether the distance between the two is less than the preset distance threshold, if not, delete the corner point; if so, add the corner point of the second frame of grayscale image to the array new-Trajectories, and assign the points in new-Trajectories Given the array Trajectories, the corner trajectory can be obtained, and the optical flow velocity can be calculated by using the LK algorithm.
103、确定相邻两帧目标灰度图像中同一粒子的像素点位置偏移量以及间隔时长。103. Determine the pixel position offset and interval duration of the same particle in two adjacent frames of the target grayscale image.
流速检测装置可以确定多帧目标灰度图像中相邻两帧目标灰度图像中同一粒子的像素点位置偏移量,并确定相邻两帧目标灰度图像的间隔时长。可以理解的是,该同一粒子指的是多个粒子,相邻两帧目标灰度图像中同一粒子的像素点位置偏移量一般为相邻两帧目标灰度图像中多个粒子对应在两帧目标灰度图像的多个像素点位置偏移量。可以通过相邻两帧目标灰度图像中同一粒子的像素点位置,进而确定同一粒子的像素点位置偏移量。该像素点位置偏移量一般指的是像素点移动了(dx,dy)的距离到下一帧。The flow velocity detection device can determine the pixel position offset of the same particle in two adjacent frames of the target gray image in the multi-frame target gray image, and determine the interval between two adjacent frames of the target gray image. It can be understood that the same particle refers to a plurality of particles, and the pixel position offset of the same particle in two adjacent frames of target grayscale images is generally equal to the number of particles corresponding to the two adjacent frames of target grayscale images. Multiple pixel position offsets of the frame target grayscale image. The pixel point offset of the same particle can be determined by the pixel point position of the same particle in two adjacent frames of target grayscale images. The pixel position offset generally refers to the pixel moving a distance of (dx, dy) to the next frame.
104、将同一粒子的像素点位置偏移量以及间隔时长代入稀疏光流算法,得到目标光流速度。104. Substitute the pixel position offset and interval duration of the same particle into the sparse optical flow algorithm to obtain the target optical flow velocity.
流速检测装置可以将同一粒子的像素点位置偏移量以及间隔时长代入稀疏光流算法(LK算法),得到目标光流速度。通过对灰度图像进行分析处理得到粒子运动轨迹,具体的:同一粒子在第一帧灰度图像中像素点的光强度为I(x,y,t),移动了(dx,dy)的距离到第二帧灰度图像,用了dt时间。x、y表示所述同一粒子在x、y方向的像素点位置偏移量,t表示所述间隔时长;假设认为该像素点在移动前后的光强度是不变的,则有:The flow velocity detection device can substitute the pixel position offset and interval time of the same particle into the sparse optical flow algorithm (LK algorithm) to obtain the target optical flow velocity. The trajectory of the particle is obtained by analyzing and processing the grayscale image, specifically: the light intensity of the pixel point of the same particle in the first frame of grayscale image is I(x,y,t), and the distance moved by (dx,dy) To the second frame of grayscale image, dt time is used. x and y represent the pixel position offset of the same particle in the x and y directions, and t represents the interval duration; assuming that the light intensity of the pixel is constant before and after the movement, then:
I(x,y,t)=I(x+δx,y+δy,t+δt)I(x,y,t)=I(x+δx,y+δy,t+δt)
将等号右边的式子进行泰勒展开,忽略不计无穷小项,同时两边同除dt,可以得到:Carry out Taylor expansion of the formula on the right side of the equal sign, ignore the infinitesimal term, and divide dt on both sides at the same time, you can get:
设u,v分别为光流沿x轴和y轴的速度矢量,则有 Let u and v be the velocity vectors of the optical flow along the x-axis and y-axis respectively, then
Ix,Iy,It分别表示x、y方向的像素点位置偏移量的偏导数以及间隔时长t的偏导数,即 Ix, Iy, It respectively represent the partial derivative of the pixel position offset in the x and y directions and the partial derivative of the interval time t, that is
综上可得,Ix u+Iy v+It=0。In summary, I x u+I y v+I t =0.
假设光流在像素点的邻域是一个常数,使用最小二乘法对邻域中的所有像素点求解光流方程。引入另外的约束条件,假设在一个大小为m×m(n=m2)窗口,图像的光流是一个恒定值,那么可以得到一个方程组:Assuming that the optical flow is a constant in the neighborhood of the pixel, the optical flow equation is solved for all the pixels in the neighborhood using the least square method. Introducing additional constraints, assuming that the optical flow of the image is a constant value in a window with a size of m×m (n=m 2 ), then a system of equations can be obtained:
表示成矩阵的形式为:记采用最小二乘法,可以得到:即目标光流速度可以理解的是,得到的目标光流速度一般为光流矢量。Expressed in matrix form as: remember Using the method of least squares, we can get: target optical flow velocity It can be understood that the obtained target optical flow velocity is generally an optical flow vector.
进一步的,当物体的速度较大时,算法出现的误差比较大,为了较少图像中物体运动的速度,一个方法是,缩小图像尺寸。假设当图像为400×400时,物体速度为[1616],那么图像缩小为200×200时,速度变为[8,8]。缩小为100×100时,速度减少到[4,4]。所以可以通过缩小图像尺寸来减慢速度以此获得更大精确度。因此,可以通过对所述相邻两帧目标灰度图像连续降采样,将各次采样得到的相邻两帧目标灰度图像构建为图像金字塔;其中,图像金字塔的最底层为相邻两帧目标灰度图像,最高层为以最低采样率采样得到的相邻两帧目标灰度图像;将图像金字塔中最高层图像中同一粒子的像素点位置偏移量,以及最高层图像中相邻两帧目标灰度图像的间隔时长代入稀疏光流算法,得到图像金字塔最高层图像的第一光流速度;基于第一光流速度迭代逐层计算图像金字塔每层图像的光流速度,直至得到最底层图像的光流速度结束迭代,将最底层图像的光流速度作为目标光流速度。在一种可实现的方案中,(1)建立金字塔。令I0=I是第0层的图像,它是金字塔图像中分辨率最高的图像,图像的宽度和高度分别定义为nx0=nx和ny0=ny。以一种递归的方式建立金字塔:从I0中计算I1,从I1中计算I2...。(2)基于金字塔的跟踪。首先,光流和仿射变换矩阵在最高一层的图像上计算出;将上一层的计算结果作为初始值传递给下一层图像,这一层的图像在这个初始值的基础上,计算这一层的光流和仿射变化矩阵;再将这一层的光流和仿射矩阵作为初始值传递给下一层图像,直到传递给最后一层,即原始图像层,这一层计算出来的光流和仿射变换矩阵作为最后的光流和仿射变换矩阵的结果。(3)迭代过程。在金字塔的每一层,目标是计算出光流和仿射变换矩阵从而使误差最小。将每一层的结果逐层迭代,最终得到目标光流速度。Furthermore, when the speed of the object is high, the error of the algorithm is relatively large. In order to reduce the speed of the object in the image, one method is to reduce the size of the image. Assuming that when the image is 400×400, the object speed is [1616], then when the image is reduced to 200×200, the speed becomes [8,8]. When scaling down to 100×100, the speed is reduced to [4,4]. So you can slow down the speed by reducing the image size to get more accuracy. Therefore, by continuously down-sampling the two adjacent frames of the target gray-scale images, the two adjacent frames of the target gray-scale images obtained by each sampling can be constructed as an image pyramid; The target grayscale image, the highest layer is two adjacent frames of target grayscale images sampled at the lowest sampling rate; the pixel position offset of the same particle in the highest layer image in the image pyramid, and the Substitute the interval time of the frame target grayscale image into the sparse optical flow algorithm to obtain the first optical flow velocity of the image at the highest level of the image pyramid; based on the first optical flow velocity, iteratively calculate the optical flow velocity of each layer of the image pyramid until the final The optical flow velocity of the underlying image ends the iteration, and the optical flow velocity of the bottom image is used as the target optical flow velocity. In an achievable solution, (1) build a pyramid. Let I0=I be the image of the 0th layer, which is the image with the highest resolution in the pyramid image, and the width and height of the image are defined as nx0=nx and ny0=ny respectively. Build the pyramid in a recursive manner: compute I1 from I0, compute I2 from I1.... (2) Pyramid-based tracking. First, the optical flow and affine transformation matrix are calculated on the image of the highest layer; the calculation result of the previous layer is passed to the image of the next layer as the initial value, and the image of this layer is calculated on the basis of this initial value. The optical flow and affine change matrix of this layer; then pass the optical flow and affine matrix of this layer as the initial value to the image of the next layer until it is passed to the last layer, that is, the original image layer, and this layer calculates The resulting optical flow and affine transformation matrix are the results of the final optical flow and affine transformation matrix. (3) Iterative process. At each level of the pyramid, the goal is to compute the optical flow and affine transformation matrix to minimize the error. The result of each layer is iterated layer by layer, and finally the target optical flow speed is obtained.
105、根据视频流对应的尺寸缩放比例,将目标光流速度进行缩放处理得到液体的目标流速。105. According to the scaling ratio corresponding to the video stream, the target optical flow velocity is scaled to obtain the target flow velocity of the liquid.
当得到目标光流速度后,可以根据视频流对应的尺寸缩放比例,将目标光流速度进行缩放处理得到液体的目标流速。可以理解的是,视频流在拍摄时,根据不同的拍摄方式得到的视频图像中像素点的位移距离与实际的距离存在一定的偏差。可以通过俯视视角下像素与实际距离成线性关系的速度变化,求出实际的液体流速。具体的,可以计算间隔时长内液体的流动距离与间隔时长内像素点的位移距离的线性关系,将线性关系作为尺寸缩放比例。可以通过多组相邻两帧图像的间隔时长内,液体的流动距离与像素点的位移距离之间的比例关系,得到该线性关系。After the target optical flow velocity is obtained, the target optical flow velocity can be scaled according to the scaling ratio corresponding to the video stream to obtain the target flow velocity of the liquid. It can be understood that when the video stream is shot, there is a certain deviation between the displacement distance of the pixels in the video image obtained according to different shooting methods and the actual distance. The actual liquid flow velocity can be obtained by the speed change of the pixel and the actual distance in the top view angle, which is linearly related. Specifically, the linear relationship between the flow distance of the liquid within the time interval and the displacement distance of the pixel point within the time interval can be calculated, and the linear relationship can be used as a scaling ratio. The linear relationship can be obtained through the proportional relationship between the flow distance of the liquid and the displacement distance of the pixel point within the time interval between two adjacent frames of images.
可以理解的是,相邻两帧目标灰度图像为多组时,多组相邻两帧目标灰度图像对应可以得到多个目标光流速度;当确定液体的目标流速时,可以先从多个目标光流速度中确定出一个光流速度,将该光流速度进行速度变换得到液体的目标流速;还可以将多个目标光流速度先进行速度变换为多个液体的流速,再从多个液体的流速中确定液体的目标流速。具体的,根据多个目标光流速度确定光流速度可以为,对多个目标光流速度取众数或者取平均值得到光流速度,具体此处不做限定。接着,根据线性关系将该光流速度转换成液体的目标流速,可以理解的是,可以将该光流速度乘以线性关系的比例,即可得到液体的目标流速。进一步的,可以根据线性关系将多个目标光流速度转换成液体的多个流速;再根据液体的多个流速确定液体的目标流速。可以对液体的多个流速取众数或者取平均值得到液体的目标流速。It can be understood that when two adjacent frames of target grayscale images are in multiple groups, multiple groups of adjacent two frames of target grayscale images can correspond to multiple target optical flow velocities; One optical flow velocity is determined from one target optical flow velocity, and the optical flow velocity is transformed to obtain the target flow velocity of the liquid; it is also possible to convert multiple target optical flow velocities into multiple liquid flow velocities first, and then from multiple target optical flow velocities Determine the target flow rate of the liquid from the flow rates of the liquids. Specifically, determining the optical flow velocity according to multiple target optical flow velocities may be to obtain the optical flow velocity by taking the mode or average value of the multiple target optical flow velocities, which is not specifically limited here. Next, the optical flow velocity is converted into the target flow velocity of the liquid according to the linear relationship. It can be understood that the target flow velocity of the liquid can be obtained by multiplying the optical flow velocity by the ratio of the linear relationship. Further, the multiple target optical flow velocities can be converted into multiple flow velocities of the liquid according to the linear relationship; and then the target flow rate of the liquid is determined according to the multiple flow velocities of the liquid. The target flow rate of the liquid can be obtained by taking the mode or averaging the multiple flow rates of the liquid.
本申请实施例中获取拍摄流动液体的视频流,将视频流中的多帧视频图像转换为多帧灰度图像;根据液体中同一粒子在任意相邻两帧灰度图像之间的像素点位置偏移量,确定不满足预设差异条件的目标粒子,并删除目标粒子在多帧灰度图像中对应的像素点,得到多帧目标灰度图像;确定多帧目标灰度图像中相邻两帧目标灰度图像中同一粒子的像素点位置偏移量,确定相邻两帧目标灰度图像的间隔时长;将同一粒子的像素点位置偏移量以及间隔时长代入稀疏光流算法,得到目标光流速度;根据视频流对应的尺寸缩放比例,将目标光流速度进行缩放处理得到液体的目标流速。通过多帧目标灰度图像中相邻两帧目标灰度图像中同一粒子的像素点位置偏移量得到液体的目标流速,能够全局地对液体流动面进行测速,测得的液体流速更加精准。In the embodiment of the present application, the video stream of the flowing liquid is obtained, and the multi-frame video images in the video stream are converted into multi-frame grayscale images; according to the pixel position of the same particle in the liquid between any two adjacent grayscale images Offset, determine the target particles that do not meet the preset difference conditions, and delete the corresponding pixels of the target particles in the multi-frame grayscale image to obtain a multi-frame target grayscale image; The pixel position offset of the same particle in the target grayscale image of the frame determines the interval between two adjacent frames of the target grayscale image; the pixel position offset and the interval of the same particle are substituted into the sparse optical flow algorithm to obtain the target Optical flow velocity: according to the scaling ratio corresponding to the video stream, the target optical flow velocity is scaled to obtain the target flow velocity of the liquid. The target flow velocity of the liquid is obtained by the pixel position offset of the same particle in two adjacent frames of the target grayscale image in multiple frames of the target grayscale image, and the velocity of the liquid flow surface can be measured globally, and the measured liquid flow velocity is more accurate.
在一种可实现的方式中,如图3所示,当需要得到不同流层的液体流速时,可以通过控制激光器移动到指定的流层,该流层指的是液体的水面至水底中的任一平面。接着,将得到每一流层的液体视频流通过上述步骤,即可得到每一流层对应的液体流速。可见,通过激光束对液体进行投影照射,液体中杂志粒子对激光产生漫反射,然后从摄像机中对粒子进行成像,并跟踪不同帧之间粒子的运动轨迹,采用摄像机拍摄轨迹,并对其运动速度进行分析计算,得到粒子运动速度,并利用粒子运动速度代表液体的运动速度,实现对液体流速的测量。使用上述方法的益处在于:通过激光激发水中微粒的反光特性,并使其能在光学摄像头下呈现其运动轨迹;通过摄像机拍摄水中微粒的运动,通过对视频的关键角点的分析,实现液体流速的测量;通过移动激光发射器,可实现对不同流层的液体流速的测量;对不同流层的流速的精确测量可精确还可以得到整个断面的液体流速。In an achievable way, as shown in Figure 3, when it is necessary to obtain the liquid flow velocity of different flow layers, the laser can be controlled to move to the specified flow layer, which refers to the water surface to the bottom of the liquid. any plane. Next, the obtained liquid video flow of each flow layer is passed through the above steps, and the corresponding liquid flow velocity of each flow layer can be obtained. It can be seen that the liquid is projected and irradiated by the laser beam, and the particles in the liquid produce diffuse reflection on the laser, and then the particles are imaged from the camera, and the trajectory of the particles between different frames is tracked, and the trajectory is captured by the camera, and its movement The velocity is analyzed and calculated to obtain the velocity of the particle, and the velocity of the particle is used to represent the velocity of the liquid to realize the measurement of the velocity of the liquid. The benefits of using the above method are: the reflective properties of the particles in the water are excited by the laser, and their movement trajectories can be displayed under the optical camera; the movement of the particles in the water is captured by the camera, and the flow rate of the liquid is realized by analyzing the key corners of the video. The measurement of the liquid flow rate of different flow layers can be realized by moving the laser transmitter; the accurate measurement of the flow rate of different flow layers can be accurate and the liquid flow rate of the entire section can be obtained.
本申请实施例还提供了一种液体的流速检测装置,如图4所示,包括:The embodiment of the present application also provides a liquid flow rate detection device, as shown in Figure 4, including:
获取单元401,用于获取拍摄流动液体的视频流,将所述视频流中的多帧视频图像转换为多帧灰度图像;The acquiring
删除单元402,用于根据所述液体中同一粒子在任意相邻两帧灰度图像之间的像素点位置偏移量,确定不满足预设差异条件的目标粒子,并所述目标粒子在多帧所述灰度图像中对应的像素点,得到多帧目标灰度图像;The
确定单元403,用于确定所述多帧目标灰度图像中相邻两帧目标灰度图像中同一粒子的像素点位置偏移量,确定所述相邻两帧目标灰度图像的间隔时长;执行单元404,用于将所述同一粒子的像素点位置偏移量以及所述间隔时长代入稀疏光流算法,得到目标光流速度;A determining
处理单元405,用于根据所述视频流对应的尺寸缩放比例,将所述目标光流速度进行缩放处理得到所述液体的目标流速。The
本申请实施例还提供了一种液体的流速检测装置500,如图5所示,包括:The embodiment of the present application also provides a liquid flow
中央处理器501,存储器502,输入输出接口503,有线或无线网络接口504,电源505;
所述存储器502为短暂存储存储器或持久存储存储器;The
所述中央处理器501配置为与所述存储器502通信,在控制面功能实体上执行所述存储器502中的指令操作以执行上述的流速检测方法。The
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,read-onlymemory)、随机存取存储器(RAM,random access memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), magnetic disk or optical disk, and other media that can store program codes.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211057508.6A CN115359028A (en) | 2022-08-31 | 2022-08-31 | Liquid flow velocity detection method, detection device and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211057508.6A CN115359028A (en) | 2022-08-31 | 2022-08-31 | Liquid flow velocity detection method, detection device and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115359028A true CN115359028A (en) | 2022-11-18 |
Family
ID=84003674
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211057508.6A Pending CN115359028A (en) | 2022-08-31 | 2022-08-31 | Liquid flow velocity detection method, detection device and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115359028A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116679080A (en) * | 2023-05-30 | 2023-09-01 | 广州伏羲智能科技有限公司 | River surface flow velocity determining method and device and electronic equipment |
| CN119991684A (en) * | 2025-04-17 | 2025-05-13 | 西安格润牧业股份有限公司 | A method for detecting eggshell in egg liquid |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101854465A (en) * | 2010-02-01 | 2010-10-06 | 杭州海康威视软件有限公司 | Image processing method and device based on optical flow algorithm |
| US20150365696A1 (en) * | 2014-06-13 | 2015-12-17 | Texas Instruments Incorporated | Optical flow determination using pyramidal block matching |
| US20180246137A1 (en) * | 2017-02-28 | 2018-08-30 | King Abdullah University Of Science And Technology | Rainbow Particle Imaging Velocimetry for Dense 3D Fluid Velocity Imaging |
| CN111311631A (en) * | 2020-01-19 | 2020-06-19 | 湖北文理学院 | Fluid velocity detection method, device and equipment in microfluidic chip |
| CN112686204A (en) * | 2021-01-12 | 2021-04-20 | 昆明理工大学 | Video flow measurement method and device based on sparse pixel point tracking |
| CN113012195A (en) * | 2021-03-04 | 2021-06-22 | 西安电子科技大学 | Method for estimating river surface flow velocity based on optical flow calculation and readable storage medium |
-
2022
- 2022-08-31 CN CN202211057508.6A patent/CN115359028A/en active Pending
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101854465A (en) * | 2010-02-01 | 2010-10-06 | 杭州海康威视软件有限公司 | Image processing method and device based on optical flow algorithm |
| US20150365696A1 (en) * | 2014-06-13 | 2015-12-17 | Texas Instruments Incorporated | Optical flow determination using pyramidal block matching |
| US20180246137A1 (en) * | 2017-02-28 | 2018-08-30 | King Abdullah University Of Science And Technology | Rainbow Particle Imaging Velocimetry for Dense 3D Fluid Velocity Imaging |
| CN111311631A (en) * | 2020-01-19 | 2020-06-19 | 湖北文理学院 | Fluid velocity detection method, device and equipment in microfluidic chip |
| CN112686204A (en) * | 2021-01-12 | 2021-04-20 | 昆明理工大学 | Video flow measurement method and device based on sparse pixel point tracking |
| CN113012195A (en) * | 2021-03-04 | 2021-06-22 | 西安电子科技大学 | Method for estimating river surface flow velocity based on optical flow calculation and readable storage medium |
Non-Patent Citations (3)
| Title |
|---|
| SUYUOA: "光流估计", pages 1 - 10, Retrieved from the Internet <URL:https://blog.csdn.net/potato123232/article/details/120204231> * |
| 林宇凌;金晓宏;王中任;: "基于LK光流法的微流控芯片中流体速度检测", 激光与红外, no. 08, 20 August 2020 (2020-08-20), pages 120 - 125 * |
| 研究僧小陈: "LK光流法", pages 1 - 6, Retrieved from the Internet <URL:https://www.cnblogs.com/chenxuanzhen/p/9640446.html> * |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116679080A (en) * | 2023-05-30 | 2023-09-01 | 广州伏羲智能科技有限公司 | River surface flow velocity determining method and device and electronic equipment |
| CN119991684A (en) * | 2025-04-17 | 2025-05-13 | 西安格润牧业股份有限公司 | A method for detecting eggshell in egg liquid |
| CN119991684B (en) * | 2025-04-17 | 2025-06-24 | 西安格润牧业股份有限公司 | A method for detecting eggshell in egg liquid |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP7120581B2 (en) | CCTV image-based real-time automatic flowmeter-side system and method | |
| JP7120582B2 (en) | River flow velocity measurement device and method using optical flow image processing | |
| US12320687B2 (en) | Systems and methods for remote sensing of river velocity using video and an optical flow algorithm | |
| Huang et al. | Limitation and improvement of PIV: part II: particle image distortion, a novel technique | |
| CN102564508B (en) | Method for implementing online tests of stream flow based on video images | |
| Perks | KLT-IV v1. 0: Image velocimetry software for use with fixed and mobile platforms | |
| KR102523451B1 (en) | Devices and Methods for Measuring Flow Velocity of River Based on Drone Imaging | |
| Ettema et al. | Particle-image velocimetry for whole-field measurement of ice velocities | |
| CN104297516B (en) | A kind of two-dimentional velocity field mearsurement method of flow surface | |
| CN115359028A (en) | Liquid flow velocity detection method, detection device and storage medium | |
| CN117495959B (en) | A method for dynamic displacement measurement of civil engineering structures based on computer vision | |
| CN113804916B (en) | A frequency domain spatiotemporal image velocimetry method based on prior information of maximum flow velocity | |
| CN115471777A (en) | Refined water flow velocity field acquisition method and system based on video identification | |
| CN111780716A (en) | A monocular real-time ranging method based on target pixel area and aspect ratio | |
| Murmu et al. | Relative velocity measurement using low cost single camera-based stereo vision system | |
| CN120594560B (en) | Boiler heating surface crack detection method based on millimeter wave radar imaging | |
| CN117745777B (en) | Remote sensing detection earth surface dense abnormal element removing method based on space-time registration | |
| Zhang et al. | Computer vision-based real-time monitoring for swivel construction of bridges: from laboratory study to a pilot application | |
| CN118072238A (en) | River flow real-time monitoring method based on unmanned aerial vehicle remote sensing and tower foundation video | |
| CN119251257B (en) | Non-contact river flow velocity calculation method and system based on super point | |
| Iglesias et al. | Computer vision applied to wave flume measurements | |
| CN116203277B (en) | Sea surface small-scale flow field measurement method based on PTV and PIV technologies | |
| CN115187509B (en) | A Three-Dimensional Vibration Detection Method for Transformers Based on Binocular Ranging and Optical Flow | |
| Hering et al. | A robust technique for tracking particles over long image sequences | |
| Spies et al. | Evaluating the range flow motion constraint |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |
















