WO2021051654A1 - 快速光流跟踪方法及相关设备 - Google Patents

快速光流跟踪方法及相关设备 Download PDF

Info

Publication number
WO2021051654A1
WO2021051654A1 PCT/CN2019/121609 CN2019121609W WO2021051654A1 WO 2021051654 A1 WO2021051654 A1 WO 2021051654A1 CN 2019121609 W CN2019121609 W CN 2019121609W WO 2021051654 A1 WO2021051654 A1 WO 2021051654A1
Authority
WO
WIPO (PCT)
Prior art keywords
optical flow
target
offset
points
tracking
Prior art date
Application number
PCT/CN2019/121609
Other languages
English (en)
French (fr)
Inventor
丁旭
胡文泽
Original Assignee
深圳云天励飞技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 深圳云天励飞技术有限公司 filed Critical 深圳云天励飞技术有限公司
Publication of WO2021051654A1 publication Critical patent/WO2021051654A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20016Hierarchical, coarse-to-fine, multiscale or multiresolution image processing; Pyramid transform

Definitions

  • This application relates to the field of image processing technology, and in particular to a fast optical flow tracking method and related equipment.
  • target detection and tracking technology In the field of video surveillance, target detection and tracking technology is generally used to detect and track the movement of human faces, pedestrians or vehicles. In the field of video compression and robot navigation, it is also necessary to analyze the movement information of the target. In these fast moving scenes, the tracking speed and tracking accuracy are extremely demanding. At present, optical flow tracking methods are often used for motion analysis. How to further improve the tracking speed of optical flow tracking methods for tracking targets is a problem that needs to be solved urgently.
  • the embodiments of the present application provide a fast optical flow tracking method and related equipment, which are used to improve the tracking speed of the tracking target.
  • an embodiment of the present application provides a fast optical flow tracking method, which is applied to an electronic device, and the method includes:
  • N is an integer greater than 0;
  • each of the first optical flow points corresponds to an optical flow value
  • the displacement change and scale change of the tracking target are determined based on the M target optical flow values.
  • an embodiment of the present application provides a fast optical flow tracking device, which is applied to electronic equipment, and the device includes:
  • the optical flow point selection unit is configured to call a preset optical flow point selection model to obtain N first optical flow points, where N is an integer greater than 0;
  • the optical flow value calculation unit is configured to call a preset optical flow value calculation algorithm to calculate the optical flow values of the N first optical flow points, and each of the first optical flow points corresponds to an optical flow value;
  • the optical flow value determining unit is configured to filter out M target optical flow values from the N optical flow values according to a preset offset threshold, where M ⁇ N and M is a positive integer;
  • the tracking target prediction unit is configured to determine the displacement change and the scale change of the tracking target based on the M target optical flow values.
  • embodiments of the present application provide an electronic device that includes a processor, a memory, a communication interface, and one or more programs.
  • the one or more programs are stored in the memory and are The configuration is executed by the processor, and the program includes instructions for executing part or all of the steps described in the method described in the first aspect of the embodiments of the present application.
  • an embodiment of the present application provides a computer-readable storage medium, wherein the above-mentioned computer-readable storage medium is used to store a computer program, and the above-mentioned computer program is executed by a processor to realize Part or all of the steps described in the method described in one aspect.
  • the embodiments of the present application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute as implemented in this application. Examples include part or all of the steps described in the method described in the first aspect.
  • the computer program product may be a software installation package.
  • the preset optical flow point selection model is called to obtain N first optical flow points; the preset optical flow value calculation algorithm is called to calculate the optical flow values of the N first optical flow points;
  • the preset offset threshold selects M target optical flow values from the determined N optical flow values; the displacement change and scale change of the tracking target are determined based on the M target optical flow values, which is different from the existing optical flow tracking algorithm.
  • the method of randomly selecting optical flow points or uniformly selecting optical flow points in the target area, calling the preset optical flow point selection model to obtain the optical flow points can select more suitable optical flow points, thereby improving the tracking accuracy of the tracking target;
  • the first time N optical flow points are selected, and the second time M optical flow values are selected from the N optical flow values.
  • the selected number is less than the number selected by the existing optical flow tracking algorithm, so that only the selected optical flow points and optical flow values need to be processed, which improves the tracking speed of
  • FIG. 1A is a schematic flowchart of a fast optical flow tracking method provided by an embodiment of the present application
  • FIG. 1B is a schematic structural diagram of an optical flow value provided by an embodiment of the present application.
  • Figure 1C is a schematic structural diagram of a ResNet18 network model provided by this application.
  • FIG. 2 is a schematic flowchart of a fast optical flow tracking method provided by an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • Fig. 4 is a schematic structural diagram of a fast optical flow tracking device provided by an embodiment of the present application.
  • Electronic devices can include various handheld devices with wireless communication functions, vehicle-mounted devices, wearable devices (such as smart watches, smart bracelets, pedometers, etc.), computing devices or other processing devices that are communicatively connected to wireless modems, and various Various forms of user equipment (User Equipment, UE), mobile station (Mobile Station, MS), terminal equipment (terminal device), and so on.
  • UE User Equipment
  • MS Mobile Station
  • terminal device terminal device
  • FIG. 1A is a schematic flowchart of a fast optical flow tracking method provided by an embodiment of the present application, which is applied to an electronic device, and the method includes:
  • Step 101 Call a preset optical flow point selection model to obtain N first optical flow points, where N is an integer greater than zero.
  • the preset optical flow point selection model includes P convolutional layers and Q fully connected layers
  • the calling the preset optical flow point selection model to obtain N first optical flow points includes :
  • the optical flow point information to be measured of the target tracking image is extracted through the P convolutional layers and the Q fully connected layers, where the optical flow point information to be measured includes the optical flow point to be measured and the optical flow point to be measured. State the confidence level corresponding to the optical flow point to be measured;
  • the first N optical flow points to be measured corresponding to the confidence levels are acquired as the first optical flow points, where the confidence levels corresponding to the first optical flow points are all greater than a preset confidence threshold.
  • the P and the Q are both integers greater than zero.
  • the confidence is used to characterize the quality of the corresponding optical flow point to be measured.
  • the higher the confidence the higher the quality of the corresponding optical flow point to be measured.
  • the preset reliability threshold may be 0.8, 0.85, 0.9, 0.95, or other values, for example, which is not limited here.
  • the N can be, for example, 5, 15, 25, 35, or other values, which is not limited here.
  • Step 102 Invoke a preset optical flow value calculation algorithm to calculate the optical flow values of the N first optical flow points, and each of the first optical flow points corresponds to an optical flow value.
  • the invoking a preset optical flow value calculation algorithm to calculate the optical flow values of the N first optical flow points includes:
  • N second optical flow points correspond to the N first optical flow points one-to-one, and the N first optical flow points are located in the first target frame, so The N second optical flow points are located in a second target frame, and the first target frame and the second target frame are target frames that are adjacent in time order;
  • FIG. 1B is a schematic structural diagram of an optical flow value provided in an embodiment of the present application.
  • the first optical flow point a1(x1, y1) is located in the first target frame i
  • the second optical flow point a2(x2, y2) is located in the second target frame i+1
  • the first optical flow point a1( The optical flow value of x1, x2) is A(x2-x1, y2-y1).
  • Step 103 Filter out M target optical flow values from the N optical flow values according to a preset offset threshold, where M ⁇ N and M is a positive integer.
  • M target optical flow values can be filtered from the N optical flow values, and the offset of the M target optical flow values may be greater than or equal to the preset offset, or Is less than or equal to the preset offset, and may also be greater than or equal to the first preset offset, and less than or equal to the second preset offset, and the preset offset includes the first preset offset.
  • the offset and the second preset offset are not limited here.
  • the M may be, for example, an integer less than the N. If the N is 25, the M may be, for example, 5, 10, 15, 20, or other values, which are not limited here.
  • Step 104 Determine the displacement change and the scale change of the tracking target based on the M target optical flow values.
  • the preset optical flow point selection model is called to obtain N first optical flow points; the preset optical flow value calculation algorithm is called to calculate the optical flow values of the N first optical flow points;
  • the preset offset threshold selects M target optical flow values from the determined N optical flow values; the displacement change and scale change of the tracking target are determined based on the M target optical flow values, which is different from the existing optical flow tracking algorithm.
  • the method of randomly selecting optical flow points or uniformly selecting optical flow points in the target area, calling the preset optical flow point selection model to obtain the optical flow points can select more suitable optical flow points, thereby improving the tracking accuracy of the tracking target;
  • the first time N optical flow points are selected, and the second time M optical flow values are selected from the N optical flow values.
  • the selected number is less than the number selected by the existing optical flow tracking algorithm, so that only the selected optical flow points and optical flow values need to be processed, which improves the tracking speed of
  • the P is 16, the Q is 4, the N is 25, the 16 convolutional layers and 2 of the 4 fully connected layers It is the same as the 16 convolutional layers and 2 fully connected layers in the ResNet18 network model.
  • FIG. 1C is a schematic structural diagram of a ResNet18 network model provided by this application. The structure and connection mode of each convolutional layer and each fully connected layer are shown in the figure.
  • the number of first optical flow points output is controlled by setting the number of fully connected layers, which is different from the existing optical flow tracking algorithm that randomly selects optical flow points or uniformly selects the optical flow points in the target area.
  • the optical flow point method can select a more appropriate and smaller number of optical flow points, which not only improves the tracking accuracy of the tracking target, but also improves the tracking speed of the tracking target.
  • the preset optical flow value calculation algorithm is the pyramid Lucas-Kanade algorithm
  • the number of pyramid levels of the pyramid Lucas-Kanade algorithm is R
  • the number of iterations is S
  • the R is less than 5.
  • An integer of, the S is an integer greater than 0.
  • R can be 0, 1, 2, 3, 4, which is not limited here.
  • S can be 1, 5, 10, 50, or other values, which are not limited here.
  • the Lucas-Kanade method is an optical flow algorithm based on pixel recursion, which is a displacement estimator of predictive correction type.
  • the predicted value can be used as a motion estimation value of the previous pixel position, or as a linear combination of motion estimation in the current pixel neighborhood.
  • the prediction is further corrected.
  • this application combines the Gaussian pyramid layering with the Lucas-Kanade method, that is, the pyramid Lucas-Kanade algorithm.
  • a layering strategy from coarse to fine is used to decompose the image into different frame rates. As the level increases, the resolution becomes lower and lower, and the result obtained under coarse precision is used as the initial value of the next scale. Calculate the flow velocity of the image sequence at the resolution of.
  • the number of pyramid layers and the number of iterations of the pyramid Lucas-Kanade algorithm are reduced to calculate the optical flow value. While ensuring the accuracy of the optical flow value, unnecessary calculation processes are reduced, thereby improving The tracking speed of the tracking target.
  • the determining the displacement change and the scale change of the tracking target based on the M target optical flow values includes:
  • the displacement change of the tracking target is determined based on the 0 offsets, and the scale change of the tracking target is determined based on the optical flow values corresponding to the 0 offsets.
  • the offset of each optical flow value includes a horizontal offset and a vertical offset
  • a specific way of determining the offset of each target optical flow value is: The projection of the target vector corresponding to the value in the horizontal direction is determined as the horizontal offset, and the projection of the target vector corresponding to each optical flow value in the vertical direction is determined as the vertical Offset.
  • L can be, for example, 5, 10, 15, 20, or other values, which are not limited here.
  • the number of segmented intervals L is a value artificially preset before calculation.
  • the interval of each segment interval is (maximum offset-minimum offset)/(L-1).
  • a specific implementation manner of determining the displacement change of the tracking target based on the 0 offsets is: determining the first average value of the 0 horizontal offsets, and determining the 0 vertical offsets The second average value of the displacement; the first average value and the second average value are used as the displacement change of the tracking target.
  • a specific implementation manner of determining the scale change of the tracking target based on the optical flow values corresponding to the 0 offsets is: determining the first optical flow points and the second optical flow points corresponding to the 0 offsets. Flow point; sure A first distance, that is, the first distance is the distance between any two first optical flow points in the Q first optical flow points; determine Second distance, that is, the second distance is the distance between any two second optical flow points in the Q second optical flow points, the First distance from the One-to-one correspondence between each second distance; determine the ratio of each first distance to the second distance corresponding to the first distance; determine The median of the ratios; use the median as the scale change of the tracking target.
  • target optical flow values which are A1(1,1), A2(2,2), A3(2.1,2.1), A4(3,3), A5( 3.1,3.1), A6(4,4), A7(4.1,4.1), A8(4.2,4.2), A9(5,5), A10(6,6), horizontal offset and vertical offset
  • maximum offset is 6
  • minimum offset is 1, then 6 segment intervals are determined, and the 6 segment intervals are 1 ⁇ 2, 2 ⁇ 3, 3 ⁇ 4, 4 ⁇ 5, 5 ⁇ 6,6 ⁇ 7.
  • the offset included in the segment interval 1 to 2 is A1 (1, 1)
  • the offset included in the segment interval 2 to 3 is A2 (2, 2), A3 (2.1, 2.1)
  • the offsets included in 3 ⁇ 4 are A4(3,3), A5(3.1,3.1)
  • the offsets included in the segment interval 4 ⁇ 5 are A6(4,4), A7(4.1,4.1) , A8 (4.2, 4.2)
  • the offset included in the segment interval 5 to 6 is A9 (5, 5)
  • the offset included in the segment interval 6 to 7 is A10 (6, 6).
  • the target segmented interval is 4-5.
  • the average value of the horizontal offset and the vertical offset of the target segment interval is 4.1
  • the displacement change of the tracking target is (4.1, 4.1).
  • the first distance can be determined [(1-0 )2+(3-1)2]1/2 and its corresponding second distance [(5-4.1)2+(7-5.1)2]1/2, the first distance can be determined [(1-1) 2+(3-2)2]1/2 and its corresponding second distance [(5-5.2)2+(7-6.2)2]1/2, the first distance can be determined [(1-0)2 +(2-1)2]1/2 and its
  • the obtained offset is divided into intervals, and then multiple offsets are determined from the divided intervals, and finally the displacement change and the angle change are determined based on the multiple offsets, Ensure the accuracy of the calculated displacement changes and scale changes.
  • the method before determining the maximum offset and the minimum offset among the M offsets, the method further includes:
  • the deviation mean value is less than a second threshold value, and it is determined that the deviation variance is less than a third threshold value.
  • the second threshold can be 1, 2, 3, 4, or other values, which are not limited here.
  • the third threshold can be 1, 4, 9, 16, or other values, which are not limited here.
  • the average offset may be the average horizontal offset in the x direction, the average vertical offset in the y direction, or the average offset in the x direction and the y direction;
  • the offset variance may be the horizontal offset variance in the x direction, the vertical offset variance in the y direction, or the offset variance in the x direction and the y direction. limited.
  • the mean value of the horizontal offset in the x direction for:
  • the mean value of the vertical offset in the y direction is:
  • the mean value of the vertical offset in the y direction is:
  • the method further includes:
  • the preset optical flow point selection algorithm is called to select E new ones
  • the first optical flow point, and the displacement change and scale change of the tracking target are determined based on the E optical flow points
  • Figure 2 is a schematic flow diagram of a fast optical flow tracking method provided by an embodiment of the present application, which is applied to an electronic device, and the method includes:
  • Step 201 Obtain a target tracking image.
  • Step 202 Extract the optical flow point information to be measured of the target tracking image through P convolutional layers and Q fully connected layers, where the optical flow point information to be measured includes the optical flow point to be measured and the For the confidence level corresponding to the optical flow point to be measured, both the P and the Q are integers greater than zero.
  • Step 203 Arrange the optical flow points to be measured in descending order according to the degree of confidence.
  • Step 204 Obtain the optical flow points to be measured corresponding to the first N confidences as the first optical flow points, where the confidences corresponding to the first optical flow points are all greater than a preset confidence threshold.
  • Step 205 Determine N second optical flow points, the N second optical flow points correspond to the N first optical flow points one-to-one, and the N first optical flow points are located within the first target frame Wherein, the N second optical flow points are located in a second target frame, and the first target frame and the second target frame are target frames that are adjacent in time order.
  • Step 206 Determine N target vectors based on the N first optical flow points and the N second optical flow points.
  • Step 207 Use the N target vectors as the optical flow values of the N first optical flow points.
  • Step 208 Filter out M target optical flow values from the N optical flow values according to a preset offset threshold, where M ⁇ N and M is a positive integer.
  • Step 209 Determine the offset of each target optical flow value.
  • Step 210 Determine the maximum offset and the minimum offset among the M offsets.
  • Step 211 Determine L segment intervals based on the maximum offset and the minimum offset, where L is an integer greater than zero.
  • Step 212 Determine the number of offsets included in each segment interval.
  • Step 213 Determine the target segmentation interval, where the number of offsets included in the target segmentation interval is greater than or equal to the first threshold.
  • Step 214 Determine O offsets included in the target segmentation interval, where O is an integer greater than 0.
  • Step 215 Determine the displacement change of the tracking target based on the 0 offsets, and determine the scale change of the tracking target based on the optical flow values corresponding to the 0 offsets.
  • FIG. 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the electronic device includes a processor, A memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the processor, and the programs include instructions for executing the following steps:
  • N is an integer greater than 0;
  • each of the first optical flow points corresponds to an optical flow value
  • the displacement change and scale change of the tracking target are determined based on the M target optical flow values.
  • the preset optical flow point selection model includes P convolutional layers and Q fully connected layers.
  • the above program includes instructions specifically for executing the following steps:
  • the optical flow point information to be measured of the target tracking image is extracted through the P convolutional layers and the Q fully connected layers, where the optical flow point information to be measured includes the optical flow point to be measured and the optical flow point to be measured. State the confidence level corresponding to the optical flow point to be measured;
  • the first N optical flow points to be measured corresponding to the confidence levels are acquired as the first optical flow points, where the confidence levels corresponding to the first optical flow points are all greater than a preset confidence threshold.
  • the above-mentioned program includes instructions specifically for executing the following steps:
  • N second optical flow points correspond to the N first optical flow points one-to-one, and the N first optical flow points are located in the first target frame, so The N second optical flow points are located in a second target frame, and the first target frame and the second target frame are target frames that are adjacent in time order;
  • the aforementioned program includes instructions specifically for executing the following steps:
  • the displacement change of the tracking target is determined based on the 0 offsets, and the scale change of the tracking target is determined based on the optical flow values corresponding to the 0 offsets.
  • the above-mentioned program includes instructions that are also specifically used to perform the following steps:
  • the deviation mean value is less than a second threshold value, and it is determined that the deviation variance is less than a third threshold value.
  • the embodiment of the present application may divide the electronic device into functional units according to the method example.
  • each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit.
  • the integrated unit can be implemented in the form of hardware or software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
  • FIG. 4 is a schematic structural diagram of a fast optical flow tracking device provided by an embodiment of the present application, which is applied to electronic equipment, and the device includes:
  • the optical flow point selection unit 401 is configured to call a preset optical flow point selection model to obtain N first optical flow points, where N is an integer greater than 0;
  • the optical flow value calculation unit 402 is configured to call a preset optical flow value calculation algorithm to calculate the optical flow values of the N first optical flow points, and each of the first optical flow points corresponds to an optical flow value;
  • the optical flow value screening unit 403 is configured to screen out M target optical flow values from the N optical flow values according to a preset offset threshold, where M ⁇ N and M is a positive integer;
  • the tracking target prediction unit 404 is configured to determine the displacement change and the scale change of the tracking target based on the M target optical flow values.
  • the preset optical flow point selection model includes P convolutional layers and Q fully connected layers.
  • the optical flow point selection unit 401 is specifically configured to:
  • the optical flow point information to be measured of the target tracking image is extracted through the P convolutional layers and the Q fully connected layers, where the optical flow point information to be measured includes the optical flow point to be measured and the optical flow point to be measured. State the confidence level corresponding to the optical flow point to be measured;
  • the first N optical flow points to be measured corresponding to the confidence levels are acquired as the first optical flow points, where the confidence levels corresponding to the first optical flow points are all greater than a preset confidence threshold.
  • the optical flow value calculation unit 402 is specifically configured to:
  • N second optical flow points correspond to the N first optical flow points one-to-one, and the N first optical flow points are located in the first target frame, so The N second optical flow points are located in a second target frame, and the first target frame and the second target frame are target frames that are adjacent in time order;
  • the tracking target prediction unit 504 is specifically configured to:
  • the displacement change of the tracking target is determined based on the 0 offsets, and the scale change of the tracking target is determined based on the optical flow values corresponding to the 0 offsets.
  • the tracking target prediction unit 504 before determining the maximum offset and the minimum offset among the M offsets, is further configured to:
  • the deviation mean value is less than a second threshold value, and it is determined that the deviation variance is less than a third threshold value.
  • optical flow point selection unit 401 the optical flow value calculation unit 402, the optical flow value screening unit 403, and the tracking target prediction unit 404 may be implemented by a processor.
  • An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any method as recorded in the above method embodiment .
  • the embodiments of the present application also provide a computer program product.
  • the above-mentioned computer program product includes a non-transitory computer-readable storage medium storing a computer program.
  • the above-mentioned computer program is operable to cause a computer to execute any of the methods described in the above-mentioned method embodiments. Part or all of the steps of the method.
  • the computer program product may be a software installation package.
  • the disclosed device may be implemented in other ways.
  • the device embodiments described above are only illustrative, for example, the division of the above-mentioned units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or integrated. To another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical or other forms.
  • the units described above as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable memory.
  • the technical solution of the present application essentially or the part that contributes to the existing technology 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 memory, A number of instructions are included to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the foregoing methods of the various embodiments of the present application.
  • the aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
  • the program can be stored in a computer-readable memory, and the memory can include: a flash disk , Read-only memory (English: Read-Only Memory, abbreviation: ROM), random access device (English: Random Access Memory, abbreviation: RAM), magnetic disk or optical disk, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

一种快速光流跟踪方法及相关设备,应用于电子设备,该方法包括:调用预设光流点选取模型获取N个第一光流点(101);调用预设光流值计算算法计算N个第一光流点的光流值,每个第一光流点对应一个光流值(102);根据预设偏移量阈值从N个光流值中筛选出M个目标光流值(103);基于M个目标光流值确定跟踪目标的位移变化和尺度变化(104)。采用上述方法可提高对跟踪目标的跟踪速度。

Description

快速光流跟踪方法及相关设备
本申请要求于2019年9月19日提交中国专利局,申请号为201910889323.3、发明名称为“快速光流跟踪方法及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及图像处理技术领域,尤其涉及一种快速光流跟踪方法及相关设备。
背景技术
在视频监控领域,一般通过目标检测与跟踪技术来检测和跟踪人脸、行人或车辆的运动,在视频压缩、机器人导航领域,也需要对目标的运动信息进行分析。在这些快速的运动场景中,跟踪速度和跟踪准确度要求极高。目前常采用光流跟踪方法来进行运动分析,如何进一步提高光流跟踪方法对跟踪目标的跟踪速度是一个急需解决的问题。
发明内容
本申请实施例提供一种快速光流跟踪方法及相关设备,用于提高对跟踪目标的跟踪速度。
第一方面,本申请实施例提供一种快速光流跟踪方法,应用于电子设备,所述方法包括:
调用预设光流点选取模型获取N个第一光流点,所述N为大于0的整数;
调用预设光流值计算算法计算所述N个第一光流点的光流值,每个所述第一光流点对应一个光流值;
根据预设偏移量阈值从N个所述光流值中筛选出M个目标光流值,所述M≤N且M为正整数;
基于所述M个目标光流值确定跟踪目标的位移变化和尺度变化。
第二方面,本申请实施例提供一种快速光流跟踪装置,应用于电子设备,所述装置包括:
光流点选取单元,用于调用预设光流点选取模型获取N个第一光流点,所述N为大于0的整数;
光流值计算单元,用于调用预设光流值计算算法计算所述N个第一光流点的光流值,每个所述第一光流点对应一个光流值;
光流值确定单元,用于根据预设偏移量阈值从N个所述光流值中筛选出M个目标光流值,所述M≤N且M为正整数;
跟踪目标预测单元,用于基于所述M个目标光流值确定跟踪目标的位移变化和尺度变化。
第三方面,本申请实施例提供一种电子设备,该电子设备包括处理器、存储器、通信接口,以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行如本申请实施例第一方面所述的方法中所描述的部分或全部步骤的指令。
第四方面,本申请实施例提供了一种计算机可读存储介质,其中,上述计算机可读存储介质用于存储计算机程序,其中,上述计算机程序被处理器执行,以实现如本申请实施例第一方面所述的方法中所描述的部分或全部步骤。
第五方面,本申请实施例提供了一种计算机程序产品,其中,上述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如本申请实施例第一方面所述的方法中所描述的部分或全部步骤。该计算机程序产品可以为一个软件安装包。
可以看出,在本申请实施例中,调用预设光流点选取模型获取N个第一光流点;调用预设光流值计算算法计算N个第一光流点的光流值;根据预设偏移量阈值从确定的N个光流值中筛选出M个目标光流值;基于M个目标光流值确定跟踪目标的位移变化和尺度变化,不同于现有的光流跟踪算法在目标区域 随机选取光流点或均匀选择光流点的方法,调用预设光流点选取模型获取光流点,能够选择更为合适的光流点,从而提高对跟踪目标的跟踪准确性;其次,并不是对目标区域内所有的光流点均进行计算,而是通过两次筛选,第一次选取N个光流点,第二次从N个光流值中选择M个光流值,选取的数量上少于现有的光流跟踪算法所选取的数量,从而只需处理所选取的光流点和光流值,提高了对跟踪目标的跟踪速度。
本申请的这些方面或其他方面在以下实施例的描述中会更加简明易懂。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1A是本申请实施例提供的一种快速光流跟踪方法的流程示意图;
图1B时本申请实施例提供的一种光流值的结构示意图;
图1C是本申请提供的一种ResNet18网络模型的结构示意图;
图2是本申请实施例提供的一种快速光流跟踪方法的流程示意图;
图3是本申请实施例提供的一种电子设备的结构示意图;
图4是本申请实施例提供的一种快速光流跟踪装置的结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
以下分别进行详细说明。
本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
以下,对本申请中的部分用语进行解释说明,以便于本领域技术人员理解。
电子设备可以包括各种具有无线通信功能的手持设备、车载设备、可穿戴设备(例如智能手表、智能手环、计步器等)、计算设备或通信连接到无线调制解调器的其他处理设备,以及各种形式的用户设备(User Equipment,UE),移动台(Mobile Station,MS),终端设备(terminal device)等等。为方便描述,上面提到的设备统称为电子设备。
请参阅图1A,图1A是本申请实施例提供的一种快速光流跟踪方法的流程示意图,应用于电子设备,所述方法包括:
步骤101:调用预设光流点选取模型获取N个第一光流点,所述N为大于0的整数。
在本申请的一实现方式中,所述预设光流点选取模型包括P个卷积层和Q个全连接层,所述调用预设光流点选取模型获取N个第一光流点包括:
获取目标跟踪图像;
通过所述P个卷积层和所述Q个全连接层提取所述目标跟踪图像的待测光 流点信息,其中,所述待测光流点信息包括所述待测光流点和所述待测光流点对应的置信度;
根据所述置信度大小对所述待测光流点进行降序排列;
获取前N个所述置信度对应的所述待测光流点作为第一光流点,其中,所述第一光流点对应的置信度均大于预设置信度阈值。
其中,所述P和所述Q均为大于0的整数。
其中,置信度用于表征其对应待测光流点的质量,置信度越高,其对应的待测光流点的质量越高。
其中,预设置信度阈值例如可以为0.8、0.85、0.9、0.95,或是其他值,在此不作限定。
其中,所述N例如可以为5、15、25、35,或是其他值,在此不作限定。
步骤102:调用预设光流值计算算法计算所述N个第一光流点的光流值,每个所述第一光流点对应一个光流值。
具体地,所述调用预设光流值计算算法计算所述N个第一光流点的光流值,包括:
确定N个第二光流点,所述N个第二光流点与所述N个第一光流点一一对应,所述N个第一光流点位于第一目标帧之中,所述N个第二光流点位于第二目标帧之中,所述第一目标帧与所述第二目标帧为按照时间顺序相邻的目标帧;
基于所述N个第一光流点与所述N个第二光流点确定N个目标向量;
将所述N个目标向量作为所述N个第一光流点的光流值。
举例说明,如图1B所示,图1B时本申请实施例提供的一种光流值的结构示意图。第一光流点a1(x1,y1)位于第一目标帧i之中,第二光流点a2(x2,y2)位于第二目标帧i+1之中,则第一光流点a1(x1,x2)的光流值为A(x2-x1,y2-y1)。
步骤103:根据预设偏移量阈值从N个所述光流值中筛选出M个目标光流值,所述M≤N且M为正整数。
需要说明的是,可以从N个所述光流值中筛选出M个目标光流值,M个目标光流值的偏移量可以是大于或等于所述预设偏移量,也可以是小于或等于所述预设偏移量,还可以是大于或等于第一预设偏移量,且小于或等于第二预设偏移量,所述预设偏移量包括所述第一预设偏移量和所述第二预设偏移量,在此均不做限定。
其中,所述M例如可以为小于所述N的整数,若所述N为25,则所述M例如可以为5、10、15、20,或是其他值,在此不作限定。
步骤104:基于所述M个目标光流值确定跟踪目标的位移变化和尺度变化。
可以看出,在本申请实施例中,调用预设光流点选取模型获取N个第一光流点;调用预设光流值计算算法计算N个第一光流点的光流值;根据预设偏移量阈值从确定的N个光流值中筛选出M个目标光流值;基于M个目标光流值确定跟踪目标的位移变化和尺度变化,不同于现有的光流跟踪算法在目标区域随机选取光流点或均匀选择光流点的方法,调用预设光流点选取模型获取光流点,能够选择更为合适的光流点,从而提高对跟踪目标的跟踪准确性;其次,并不是对目标区域内所有的光流点均进行计算,而是通过两次筛选,第一次选取N个光流点,第二次从N个光流值中选择M个光流值,选取的数量上少于现有的光流跟踪算法所选取的数量,从而只需处理所选取的光流点和光流值,提高了对跟踪目标的跟踪速度。
在本申请的一实现方式中,所述P为16,所述Q为4,所述N为25,所述16个卷积层和所述4个全连接层中的其中2个全连接层与ResNet18网络模型中的16个卷积层和2个全连接层相同。
如图1C所示,图1C是本申请提供的一种ResNet18网络模型的结构示意图。每个卷积层与每个全连接层的结构以及连接方式如图所示。
可以看出,在本申请实施例中,通过设置全连接层的数量来控制输出的第一光流点的数量,不同于现有的光流跟踪算法在目标区域随机选取光流点或均匀选择光流点的方法,能够选择更为合适且数量更少的光流点,在提高对跟踪 目标的跟踪准确性的同时,还能够提高对跟踪目标的跟踪速度。
在本申请的一实现方式中,所述预设光流值计算算法为金字塔Lucas-Kanade算法,所述金字塔Lucas-Kanade算法的金字塔层数为R,迭代次数为S,所述R为小于5的整数,所述S为大于0的整数。
其中,R可以为0、1、2、3、4,在此不作限定。
其中,S可以为1、5、10、50,或是其他值,在此不作限定。
其中,Lucas-Kanade方法是一种基于像素递归的光流算法,就是预测校正型的位移估算器。预测值可以作为前一个像素位置的运动估算值,或作为当前像素邻域内的运动估算线性组合。据该像素上的位移帧差的梯度的最小值,对预测作进一步的修正。为了进一步提高Lucas-Kanade方法的准确度以及运算速度,本申请将高斯金字塔分层与Lucas-Kanade方法结合起来,也就是金字塔Lucas-Kanade算法。采用了由粗到精的分层策略将图像分解成不同的帧率,随着级别的增加,分辨率越来越低,并将粗精度下得到的结果作为下一尺度的初始值,在不同的分辨率上对图像序列进行流速计算。
可以看出,在本申请实施例中,减少金字塔Lucas-Kanade算法的金字塔层数和迭代次数去计算光流值,在保证光流值的精确度的同时,减少不必要的计算过程,从而提高对跟踪目标的跟踪速度。
在本申请的一实现方式中,所述基于所述M个目标光流值确定跟踪目标的位移变化和尺度变化,包括:
确定每个目标光流值的偏移量;
确定M个偏移量中的最大偏移量与最小偏移量;
基于所述最大偏移量与所述最小偏移量确定L个分段区间,所述L为大于0的整数;
确定每个分段区间中所包括的偏移量的数量;
确定目标分段区间,所述目标分段区间所包括的偏移量的数量大于或等于第一阈值;
确定所述目标分段区间包括的O个偏移量,所述O为大于0的整数;
基于所述O个偏移量确定跟踪目标的位移变化,以及基于所述O个偏移量对应的光流值确定跟踪目标的尺度变化。
具体地,所述每个光流值的偏移量包括水平偏移量和竖直偏移量,所述确定每个目标光流值的偏移量的一具体方式为:将每个光流值对应的目标向量的模在水平方向上的投影确定为所述水平偏移量,以及将所述每个光流值对应的目标向量的模在竖直方向上的投影确定为所述竖直偏移量。
其中,L例如可以为5、10、15、20,或是其他值,在此不做限定。
需要说明的是,分段区间个数L为在计算之前人为预先设定的值。
其中,每个分段区间的间隔为(最大偏移量-最小偏移量)/(L-1)。
具体地,所述基于所述O个偏移量确定跟踪目标的位移变化的一具体实现方式为:确定所述O个水平偏移量的第一平均值,以及确定所述O个竖直偏移量的第二平均值;将所述第一平均值和所述第二平均值作为跟踪目标的位移变化。
具体地,所述基于所述O个偏移量对应的光流值确定跟踪目标的尺度变化的一具体实现方式为:确定所述O个偏移量对应的第一光流点和第二光流点;确定
Figure PCTCN2019121609-appb-000001
个第一距离,即所述第一距离为Q个第一光流点中的任意两个第一光流点之间的距离;确定
Figure PCTCN2019121609-appb-000002
个第二距离,即所述第二距离为Q个第二光流点中的任意两个第二光流点之间的距离,所述
Figure PCTCN2019121609-appb-000003
个第一距离与所述
Figure PCTCN2019121609-appb-000004
个第二距离一一对应;确定每个第一距离与所述第一距离对应的第二距离的比值;确定
Figure PCTCN2019121609-appb-000005
个比值中的中位数;将所述中位数作为跟踪目标的尺度变化。
举例说明,假定有10个目标光流值,这10个光流值分别为A1(1,1)、A2(2,2)、A3(2.1,2.1)、A4(3,3)、A5(3.1,3.1)、A6(4,4)、A7(4.1,4.1)、A8(4.2,4.2)、A9(5,5)、A10(6,6),水平偏移量和竖直偏移量的最大偏移量均为6,最小偏移量均为1,则确定6个分段区间,6个分段区间分别为1~2、2~3、3~4、4~5、5~6、6~7。分段区间1~2中包括的偏移量为A1(1,1),分段 区间2~3中包括的偏移量为A2(2,2)、A3(2.1,2.1),分段区间3~4中包括的偏移量为A4(3,3)、A5(3.1,3.1),分段区间4~5中包括的偏移量为A6(4,4)、A7(4.1,4.1)、A8(4.2,4.2),分段区间5~6中包括的偏移量为A9(5,5),分段区间6~7中包括的偏移量为A10(6,6)。若将包括的偏移量的数量大于或等于3的分段区间作为目标区间,则目标分段区间为4~5。目标分段区间的水平偏移量和竖直偏移量的平均值均为4.1,则跟踪目标的位移变化为(4.1,4.1)。
又举例说明,假定目标分段区间4~5中包括的偏移量为A6(4,4)、A7(4.1,4.1)、A8(4.2,4.2),A6(4,4)对应的第一光流点为a1(1,3)和第二光流点a2(5,7),A7(4.1,4.1)对应的第一光流点为a1(0,1)和第二光流点a2(4.1,5.1),A8(4.2,4.2)对应的第一光流点为a1(1,2)和第二光流点a2(5.2,6.2),则可以确定第一距离[(1-0)2+(3-1)2]1/2以及其对应的第二距离[(5-4.1)2+(7-5.1)2]1/2,可以确定第一距离[(1-1)2+(3-2)2]1/2以及其对应的第二距离[(5-5.2)2+(7-6.2)2]1/2,可以确定第一距离[(1-0)2+(2-1)2]1/2以及其对应的第二距离[(5.2-4.1)2+(6.2-5.1)2]1/2,所以第一距离与第二距离的比值为1.06、1.25、0.91,中位数为1.06,则跟踪目标的位移变化为1.06。
可以看出,在本申请实施例中,通过将得到的偏移量进行划分区间,然后从划分的区间中确定多个偏移量,最后基于这多个偏移量确定位移变化和角度变化,保证了计算得到的位移变化和尺度变化的准确度。
在本申请的一实现方式中,在确定M个偏移量中的最大偏移量与最小偏移量之前,所述方法还包括:
基于所述M个偏移量的偏移均值和偏移方差;
确定所述偏移均值小于第二阈值,以及确定所述偏移方差小于第三阈值。
其中第二阈值可以为1、2、3、4,或是其他值,在此不作限定。
其中第三阈值可以为1、4、9、16,或是其他值,在此不作限定。
需要说明的是,所述偏移均值可以是x方向上的水平偏移均值,也可以是y方向上的竖直偏移均值,还可以是包括x方向和y方向上的偏移均值;同样, 所述偏移方差可以是x方向上的水平偏移方差,也可以是y方向上的竖直偏移方差,还可以是包括x方向和y方向上的偏移方差,在此均不做限定。
举例说明,假定M个偏移量分别为(1,2)、(2,2)、(3,4)、(2,1)和(3,3),则x方向上的水平偏移均值为:
(1+2+3+2+3)/5=2.2,
y方向上的竖直偏移均值为:
(2+2+4+1+3)/5=2.4,
包括x方向和y方向上的偏移均值为:
[(12+22)1/2+(22+22)1/2+(32+42)1/2+(22+12)1/2+(32+32)1/2]/5=3.31。
则x方向上的水平偏移方差为:
[(2.2-1)2+(2.2-2)2+(2.2-3)2+(2.2-2)2+(2.2-3)2]/5=2.8,
y方向上的竖直偏移均值为:
[(2.4-2)2+(2.4-2)2+(2.4-4)2+(2.4-1)2+(2.4-3)2]/5=1.04,
包括x方向和y方向上的偏移均值为:
[(3.31-51/2)2+(3.31-81/2)2+(3.31-5)2+(3.31-51/2)2+(3.31-181/2)2]/5=1.26。
进一步地,所述方法还包括:
若确定所述偏移均值大于或等于所述第二阈值,和/或,确定所述偏移方差大于或等于所述第三阈值,则调用所述预设光流点选取算法重新选取E个第一光流点,以及基于所述E个光流点确定所述跟踪目标的位移变化和尺度变化
可以看出,在本申请实施例中,基于多个目标光流值的偏移均值和偏移方差去判断该多个目标光流值是不是符合要求的光流值,在多个目标光流值符合要求时才进行下一步计算,进而保证了计算得到的位移变化和尺度变化的准确度。
请参阅图2,图2是本申请实施例提供的一种快速光流跟踪方法的流程示意 图,应用于电子设备,所述方法包括:
步骤201:获取目标跟踪图像。
步骤202:通过P个卷积层和Q个全连接层提取所述目标跟踪图像的待测光流点信息,其中,所述待测光流点信息包括所述待测光流点和所述待测光流点对应的置信度,所述P和所述Q均为大于0的整数。
步骤203:根据所述置信度大小对所述待测光流点进行降序排列。
步骤204:获取前N个所述置信度对应的所述待测光流点作为第一光流点,其中,所述第一光流点对应的置信度均大于预设置信度阈值。
步骤205:确定N个第二光流点,所述N个第二光流点与所述N个第一光流点一一对应,所述N个第一光流点位于第一目标帧之中,所述N个第二光流点位于第二目标帧之中,所述第一目标帧与所述第二目标帧为按照时间顺序相邻的目标帧。
步骤206:基于所述N个第一光流点与所述N个第二光流点确定N个目标向量。
步骤207:将所述N个目标向量作为所述N个第一光流点的光流值。
步骤208:根据预设偏移量阈值从N个所述光流值中筛选出M个目标光流值,所述M≤N且M为正整数。
步骤209:确定每个目标光流值的偏移量。
步骤210:确定所述M个偏移量中的最大偏移量与最小偏移量。
步骤211:基于所述最大偏移量与所述最小偏移量确定L个分段区间,所述L为大于0的整数。
步骤212:确定每个分段区间中所包括的偏移量的数量。
步骤213:确定目标分段区间,所述目标分段区间所包括的偏移量的数量大于或等于第一阈值。
步骤214:确定所述目标分段区间包括的O个偏移量,所述O为大于0的整数。
步骤215:基于所述O个偏移量确定跟踪目标的位移变化,以及基于所述O个偏移量对应的光流值确定跟踪目标的尺度变化。
需要说明的是,本实施例的具体实现过程可参见上述方法实施例所述的具体实现过程,在此不再叙述。
与上述图1A和图2所示的实施例一致的,请参阅图3,图3是本申请实施例提供的一种电子设备的结构示意图,如图3所示,该电子设备包括处理器、存储器、通信接口以及一个或多个程序,其中,上述一个或多个程序被存储在上述存储器中,并且被配置由上述处理器执行,上述程序包括用于执行以下步骤的指令:
调用预设光流点选取模型获取N个第一光流点,所述N为大于0的整数;
调用预设光流值计算算法计算所述N个第一光流点的光流值,每个所述第一光流点对应一个光流值;
根据预设偏移量阈值从N个所述光流值中筛选出M个目标光流值,所述M≤N且M为正整数;
基于所述M个目标光流值确定跟踪目标的位移变化和尺度变化。
在本申请的一实现方式中,所所述预设光流点选取模型包括P个卷积层和Q个全连接层,在调用预设光流点选取模型获取N个第一光流点方面,上述程序包括具体用于执行以下步骤的指令:
获取目标跟踪图像;
通过所述P个卷积层和所述Q个全连接层提取所述目标跟踪图像的待测光流点信息,其中,所述待测光流点信息包括所述待测光流点和所述待测光流点对应的置信度;
根据所述置信度大小对所述待测光流点进行降序排列;
获取前N个所述置信度对应的所述待测光流点作为第一光流点,其中,所述第一光流点对应的置信度均大于预设置信度阈值。
在本申请的一实现方式中,在调用预设光流值计算算法计算所述N个第一光流点的光流值方面,上述程序包括具体用于执行以下步骤的指令:
确定N个第二光流点,所述N个第二光流点与所述N个第一光流点一一对应,所述N个第一光流点位于第一目标帧之中,所述N个第二光流点位于第二目标帧之中,所述第一目标帧与所述第二目标帧为按照时间顺序相邻的目标帧;
基于所述N个第一光流点与所述N个第二光流点确定N个目标向量;
将所述N个目标向量作为所述N个第一光流点的光流值。
在本申请的一实现方式中,在基于所述M个目标光流值确定跟踪目标的位移变化和尺度变化方面,上述程序包括具体用于执行以下步骤的指令:
确定每个目标光流值的偏移量;
确定M个偏移量中的最大偏移量与最小偏移量;
基于所述最大偏移量与所述最小偏移量确定L个分段区间,所述L为大于0的整数;
确定每个分段区间中所包括的偏移量的数量;
确定目标分段区间,所述目标分段区间所包括的偏移量的数量大于或等于第一阈值;
确定所述目标分段区间包括的O个偏移量,所述O为大于0的整数;
基于所述O个偏移量确定跟踪目标的位移变化,以及基于所述O个偏移量对应的光流值确定跟踪目标的尺度变化。
在本申请的一实现方式中,确定M个偏移量中的最大偏移量与最小偏移量之前,上述程序包括还具体用于执行以下步骤的指令:
基于所述M个偏移量的偏移均值和偏移方差;
确定所述偏移均值小于第二阈值,以及确定所述偏移方差小于第三阈值。
需要说明的是,本实施例的具体实现过程可参见上述方法实施例所述的具体实现过程,在此不再叙述。
本申请实施例可以根据所述方法示例对电子设备进行功能单元的划分,例如,可以对应各个功能划分各个功能单元,也可以将两个或两个以上的功能集成在一个处理单元中。所述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
下面为本申请装置实施例,本申请装置实施例用于执行本申请方法实施例所实现的方法。请参阅图4,图4是本申请实施例提供的一种快速光流跟踪装置的结构示意图,应用于电子设备,所述装置包括:
光流点选取单元401,用于调用预设光流点选取模型获取N个第一光流点,所述N为大于0的整数;
光流值计算单元402,用于调用预设光流值计算算法计算所述N个第一光流点的光流值,每个所述第一光流点对应一个光流值;
光流值筛选单元403,用于根据预设偏移量阈值从N个所述光流值中筛选出M个目标光流值,所述M≤N且M为正整数;
跟踪目标预测单元404,用于基于所述M个目标光流值确定跟踪目标的位移变化和尺度变化。
在本申请的一实现方式中,所述预设光流点选取模型包括P个卷积层和Q个全连接层,在调用预设光流点选取模型获取N个第一光流点方面,所述光流点选取单元401,具体用于:
获取目标跟踪图像;
通过所述P个卷积层和所述Q个全连接层提取所述目标跟踪图像的待测光流点信息,其中,所述待测光流点信息包括所述待测光流点和所述待测光流点对应的置信度;
根据所述置信度大小对所述待测光流点进行降序排列;
获取前N个所述置信度对应的所述待测光流点作为第一光流点,其中,所述第一光流点对应的置信度均大于预设置信度阈值。
在本申请的一实现方式中,在调用预设光流值计算算法计算所述N个第一光流点的光流值方面,所述光流值计算单元402,具体用于:
确定N个第二光流点,所述N个第二光流点与所述N个第一光流点一一对应,所述N个第一光流点位于第一目标帧之中,所述N个第二光流点位于第二目标帧之中,所述第一目标帧与所述第二目标帧为按照时间顺序相邻的目标帧;
基于所述N个第一光流点与所述N个第二光流点确定N个目标向量;
将所述N个目标向量作为所述N个第一光流点的光流值。
在本申请的一实现方式中,在基于所述M个目标光流值确定跟踪目标的位移变化和尺度变化方面,所述跟踪目标预测单元504,具体用于:
确定每个目标光流值的偏移量;
确定M个偏移量中的最大偏移量与最小偏移量;
基于所述最大偏移量与所述最小偏移量确定L个分段区间,所述L为大于0的整数;
确定每个分段区间中所包括的偏移量的数量;
确定目标分段区间,所述目标分段区间所包括的偏移量的数量大于或等于第一阈值;
确定所述目标分段区间包括的O个偏移量,所述O为大于0的整数;
基于所述O个偏移量确定跟踪目标的位移变化,以及基于所述O个偏移量对应的光流值确定跟踪目标的尺度变化。
在本申请的一实现方式中,确定M个偏移量中的最大偏移量与最小偏移量之前,所述跟踪目标预测单元504,还用于:
基于所述M个偏移量的偏移均值和偏移方差;
确定所述偏移均值小于第二阈值,以及确定所述偏移方差小于第三阈值。
需要说明的是,光流点选取单元401、光流值计算单元402、光流值筛选单元403和跟踪目标预测单元404可通过处理器实现。
本申请实施例还提供一种计算机存储介质,其中,该计算机存储介质存储 用于电子数据交换的计算机程序,该计算机程序使得计算机执行如上述方法实施例中记载的任一方法的部分或全部步骤。
本申请实施例还提供一种计算机程序产品,上述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如上述方法实施例中记载的任一方法的部分或全部步骤。该计算机程序产品可以为一个软件安装包。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元 中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储器中。根据这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例上述方法的全部或部分步骤。而前述的存储器包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储器中,存储器可以包括:闪存盘、只读存储器(英文:Read-Only Memory,简称:ROM)、随机存取器(英文:Random Access Memory,简称:RAM)、磁盘或光盘等。
以上对本申请实施例进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (10)

  1. 一种快速光流跟踪方法,其特征在于,应用于电子设备,所述方法包括:
    调用预设光流点选取模型获取N个第一光流点,所述N为大于0的整数;
    调用预设光流值计算算法计算所述N个第一光流点的光流值,每个所述第一光流点对应一个光流值;
    根据预设偏移量阈值从N个所述光流值中筛选出M个目标光流值,所述M≤N且M为正整数;
    基于所述M个目标光流值确定跟踪目标的位移变化和尺度变化。
  2. 根据权利要求1所述的方法,其特征在于,所述预设光流点选取模型包括P个卷积层和Q个全连接层,所述调用预设光流点选取模型获取N个第一光流点,包括:
    获取目标跟踪图像;
    通过所述P个卷积层和所述Q个全连接层提取所述目标跟踪图像的待测光流点信息,其中,所述待测光流点信息包括所述待测光流点和所述待测光流点对应的置信度;
    根据所述置信度大小对所述待测光流点进行降序排列;
    获取前N个所述置信度对应的所述待测光流点作为第一光流点,其中,所述第一光流点对应的置信度均大于预设置信度阈值。
  3. 根据权利要求1或2所述的方法,其特征在于,所述调用预设光流值计算算法计算所述N个第一光流点的光流值,包括:
    确定N个第二光流点,所述N个第二光流点与所述N个第一光流点一一对应,所述N个第一光流点位于第一目标帧之中,所述N个第二光流点位于第二目标帧之中,所述第一目标帧与所述第二目标帧为按照时间顺序相邻的目标帧;
    基于所述N个第一光流点与所述N个第二光流点确定N个目标向量;
    将所述N个目标向量作为所述N个第一光流点的光流值。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述基于所述M个目标光流值确定跟踪目标的位移变化和尺度变化,包括:
    确定每个目标光流值的偏移量;
    确定M个偏移量中的最大偏移量与最小偏移量;
    基于所述最大偏移量与所述最小偏移量确定L个分段区间,所述L为大于0的整数;
    确定每个分段区间中所包括的偏移量的数量;
    确定目标分段区间,所述目标分段区间所包括的偏移量的数量大于或等于第一阈值;
    确定所述目标分段区间包括的O个偏移量,所述O为大于0的整数;
    基于所述O个偏移量确定跟踪目标的位移变化,以及基于所述O个偏移量对应的光流值确定跟踪目标的尺度变化。
  5. 根据权利要求4所述的方法,其特征在于,所述确定M个偏移量中的最大偏移量与最小偏移量之前,所述方法还包括:
    基于所述M个偏移量的偏移均值和偏移方差;
    确定所述偏移均值小于第二阈值,以及确定所述偏移方差小于第三阈值。
  6. 一种快速光流跟踪装置,其特征在于,应用于电子设备,所述装置包括:
    光流点选取单元,用于调用预设光流点选取模型获取N个第一光流点,所述N为大于0的整数;
    光流值计算单元,用于调用预设光流值计算算法计算所述N个第一光流点的光流值,每个所述第一光流点对应一个光流值;
    光流值确定单元,根据预设偏移量阈值从N个所述光流值中筛选出M个目标光流值,所述M≤N且M为正整数;
    跟踪目标预测单元,用于基于所述M个目标光流值确定跟踪目标的位移变化和尺度变化。
  7. 根据权利要求6所述的装置,其特征在于,所述基于所述M个目标光 流值确定跟踪目标的位移变化和尺度变化方面,所述跟踪目标预测单元,具体用于:
    确定每个目标光流值的偏移量;
    确定M个偏移量中的最大偏移量与最小偏移量;
    基于所述最大偏移量与所述最小偏移量确定L个分段区间,所述L为大于0的整数;
    确定每个分段区间中所包括的偏移量的数量;
    确定目标分段区间,所述目标分段区间所包括的偏移量的数量大于或等于第一阈值;
    确定所述目标分段区间包括的O个偏移量,所述O为大于0的整数;
    基于所述O个偏移量确定跟踪目标的位移变化,以及基于所述O个偏移量对应的光流值确定跟踪目标的尺度变化。
  8. 根据权利要求7所述的装置,其特征在于,所述确定M个偏移量中的最大偏移量与最小偏移量之前,所述跟踪目标预测单元,还用于:
    基于所述M个偏移量的偏移均值和偏移方差;
    确定所述偏移均值小于第二阈值,以及确定所述偏移方差小于第三阈值。
  9. 一种电子设备,其特征在于,包括处理器、存储器、通信接口,以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行如权利要求1-5任一项所述的方法中的步骤的指令。
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现权利要求1至5任意一项所述的方法。
PCT/CN2019/121609 2019-09-19 2019-11-28 快速光流跟踪方法及相关设备 WO2021051654A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910889323.3A CN110827313B (zh) 2019-09-19 2019-09-19 快速光流跟踪方法及相关设备
CN201910889323.3 2019-09-19

Publications (1)

Publication Number Publication Date
WO2021051654A1 true WO2021051654A1 (zh) 2021-03-25

Family

ID=69548165

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/121609 WO2021051654A1 (zh) 2019-09-19 2019-11-28 快速光流跟踪方法及相关设备

Country Status (2)

Country Link
CN (1) CN110827313B (zh)
WO (1) WO2021051654A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080232643A1 (en) * 2007-03-23 2008-09-25 Technion Research & Development Foundation Ltd. Bitmap tracker for visual tracking under very general conditions
CN105261042A (zh) * 2015-10-19 2016-01-20 华为技术有限公司 光流估计的方法及装置
CN108090919A (zh) * 2018-01-02 2018-05-29 华南理工大学 一种基于超像素光流和自适应学习因子改进的核相关滤波跟踪方法
CN108288021A (zh) * 2017-12-12 2018-07-17 深圳市深网视界科技有限公司 一种人群异常事件检测方法、电子设备和存储介质
CN109523573A (zh) * 2018-11-23 2019-03-26 上海新世纪机器人有限公司 目标对象的跟踪方法和装置

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8866821B2 (en) * 2009-01-30 2014-10-21 Microsoft Corporation Depth map movement tracking via optical flow and velocity prediction
CN103871080A (zh) * 2014-03-25 2014-06-18 上海交通大学 复杂视频监控场景中光流特征自适应量化方法
CN104574439A (zh) * 2014-12-25 2015-04-29 南京邮电大学 一种融合卡尔曼滤波与tld算法的目标跟踪方法
CN104657994B (zh) * 2015-02-13 2017-12-19 厦门美图之家科技有限公司 一种基于光流法判断图像一致性的方法和系统
DE112016004109T5 (de) * 2015-09-11 2018-08-09 Intel Corporation Echtzeit-mehrfach-fahrzeugdetektion und -tracking
CN106204594A (zh) * 2016-07-12 2016-12-07 天津大学 一种基于视频图像的弥散性运动物体的方向检测方法
DE102016123058A1 (de) * 2016-11-30 2018-05-30 Connaught Electronics Ltd. Optischer Fluss mit Konfidenzschätzung
CN108133491A (zh) * 2017-12-29 2018-06-08 重庆锐纳达自动化技术有限公司 一种实现动态目标跟踪的方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080232643A1 (en) * 2007-03-23 2008-09-25 Technion Research & Development Foundation Ltd. Bitmap tracker for visual tracking under very general conditions
CN105261042A (zh) * 2015-10-19 2016-01-20 华为技术有限公司 光流估计的方法及装置
CN108288021A (zh) * 2017-12-12 2018-07-17 深圳市深网视界科技有限公司 一种人群异常事件检测方法、电子设备和存储介质
CN108090919A (zh) * 2018-01-02 2018-05-29 华南理工大学 一种基于超像素光流和自适应学习因子改进的核相关滤波跟踪方法
CN109523573A (zh) * 2018-11-23 2019-03-26 上海新世纪机器人有限公司 目标对象的跟踪方法和装置

Also Published As

Publication number Publication date
CN110827313B (zh) 2023-03-03
CN110827313A (zh) 2020-02-21

Similar Documents

Publication Publication Date Title
US10972672B2 (en) Device having cameras with different focal lengths and a method of implementing cameras with different focal lengths
US20200019806A1 (en) Tracker assisted image capture
US10455152B2 (en) Panoramic video processing method and device and non-transitory computer-readable medium
US9560271B2 (en) Removing unwanted objects from photographed image
US9471964B2 (en) Non-local mean-based video denoising method and apparatus
US9947077B2 (en) Video object tracking in traffic monitoring
CN106934806B (zh) 一种基于结构清晰度的无参考图失焦模糊区域分割方法
US8243807B2 (en) Image processing method, a program of an image processing method, a recording medium on which a program of an image processing method is recorded and an image processing circuit
CN106791279B (zh) 基于遮挡检测的运动补偿方法及系统
WO2015014111A1 (zh) 一种光流跟踪方法和装置
CN105374049B (zh) 一种基于稀疏光流法的多角点跟踪方法及装置
WO2013100791A1 (en) Method of and apparatus for scalable frame rate up-conversion
CN106412441A (zh) 一种视频防抖控制方法以及终端
CN113409353B (zh) 运动前景检测方法、装置、终端设备及存储介质
CN114674826A (zh) 基于布匹的视觉检测方法及检测系统
WO2021051654A1 (zh) 快速光流跟踪方法及相关设备
JP2018197945A (ja) 障害物検出装置および障害物検出方法
US9215474B2 (en) Block-based motion estimation method
CN115657893A (zh) 一种显示控制方法、显示控制装置及智能设备
CN115514887A (zh) 视频采集的控制方法、装置、计算机设备和存储介质
CN114663314A (zh) 图像降噪方法、装置、计算机设备及介质
CN116418932A (zh) 一种视频帧内插方法及装置
WO2020113419A9 (zh) 一种图像处理方法和装置
CN107154052A (zh) 对象状态估计的方法及装置
CN112085002A (zh) 人像分割方法、装置、存储介质及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19945775

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19945775

Country of ref document: EP

Kind code of ref document: A1