Method and device for determining motion trajectory, storage medium, and electronic device

Through image processing and the application of network models, the three-dimensional motion trajectory of the target object is determined, which solves the problem of inaccurate motion trajectories in the existing technology and realizes real-time and accurate motion information calculation.

CN112184757BActive Publication Date: 2024-09-06ZHEJIANG DAHUA TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202011044996.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-28
Publication Date
2024-09-06
Estimated Expiration
2040-09-28

AI Technical Summary

Technical Problem

The determination of motion trajectories in the existing technology is imprecise, and it is difficult to calculate the three-dimensional motion information of the target in real time.

Method used

By performing image processing on the acquired N frames of images to be processed, obtain the disparity map, instance segmentation mask and optical flow map, adjust the scene flow, use these parameters to track the target object, determine its first motion trajectory, and determine the second motion based on this trajectory. Specific steps include inputting the image into the disparity map network model, instance segmentation network model and optical flow estimation network model, constructing the energy function of the rotation and translation matrix RT, optimizing the RT matrix, adjusting the scene flow, calculating the three-dimensional spatial coordinate value, and predicting the position of the next frame. .

Benefits of technology

It realizes the accurate determination of the movement trajectory of the target object, solves the problem of inaccurate determination of the movement trajectory, and achieves the effect of accurately determining the movement trajectory.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112184757B
    Figure CN112184757B
Patent Text Reader

Abstract

The embodiment of the present invention provides a method and device for determining a motion trajectory, a storage medium, and an electronic device, the method comprising: performing image processing on N frames of images to be processed to obtain processing parameters of the N frames of images to be processed; adjusting the scene flow of the N frames of images to be processed using the processing parameters to obtain a target scene flow; tracking a target object using the processing parameters and the target scene flow to obtain a first motion trajectory of the target object; and determining a second motion trajectory of the target object based on the processing parameters and the first motion trajectory. Through the present invention, the problem of inaccurate determination of motion trajectories in related technologies is solved, and the effect of accurately determining motion trajectories is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of images, and in particular, to a method and device for determining a motion trajectory, a storage medium, and an electronic device. Background Art

[0002] With the continuous development of computer vision technology and computer network technology, video surveillance has a large demand in many fields such as security, finance and education. In these application fields, human target motion estimation is the main content of monitoring tasks. In the application scenario of smart finance, personnel monitoring in the hall of automatic teller machine (ATM) can improve personal and property safety. In the application scenario of smart education, student behavior monitoring is crucial to teaching quality and teaching safety. The most important thing for monitoring human targets is to calculate the target's motion information in real time, especially the three-dimensional motion information that can represent the real motion of the target.

[0003] Currently, there are three-dimensional motion estimation schemes, including motion estimation methods based on iterative closest points (ICP), motion estimation methods based on multi-view vision theory, and motion estimation methods based on scene flow, etc. However, the above determination methods have the problem of inaccuracy.

[0004] With respect to the above technical problems, no effective solutions have been proposed in the relevant technologies. Summary of the invention

[0005] The embodiments of the present invention provide a method and device for determining a motion trajectory, a storage medium, and an electronic device, so as to at least solve the problem of inaccurate determination of the motion trajectory in the related art.

[0006] According to one embodiment of the present invention, a method for determining a motion trajectory is provided, comprising: performing image processing on N frames of acquired images to be processed to obtain processing parameters of the N frames of images to be processed, wherein the processing parameters include disparity maps of the N frames of images to be processed, instance segmentation masks of the N frames of images to be processed, and optical flow maps of the N frames of images to be processed, the N frames of images to be processed are obtained by photographing the same target object at different angles, and N is a natural number greater than or equal to 1; adjusting the scene flow of the N frames of images to be processed by using the processing parameters to obtain a target scene flow; tracking the target object by using the processing parameters and the target scene flow to obtain a first motion trajectory of the target object; and determining a second motion trajectory of the target object based on the processing parameters and the first motion trajectory.

[0007] According to another embodiment of the present invention, a device for determining a motion trajectory is provided, comprising: a first determination module, used to perform image processing on N frames of acquired images to be processed to obtain processing parameters of the N frames of images to be processed, wherein the processing parameters include disparity maps of the N frames of images to be processed, instance segmentation masks of the N frames of images to be processed and optical flow maps of the N frames of images to be processed, the N frames of images to be processed are obtained by photographing the same target object at different angles, and N is a natural number greater than or equal to 1; a second determination module, used to adjust the scene flow of the N frames of images to be processed using the processing parameters to obtain a target scene flow; a third determination module, used to track the target object using the processing parameters and the target scene flow to obtain a first motion trajectory of the target object; and a fourth determination module, used to determine a second motion trajectory of the target object based on the processing parameters and the first motion trajectory.

[0008] In an exemplary embodiment, the first determination module includes: a first determination unit, used to input the N frames of images to be processed into a determined disparity map network model to obtain the disparity map of the images to be processed output by the disparity map network model, wherein the disparity map network model is determined by a stereo matching network based on deep learning; a second determination unit, used to perform instance segmentation and annotation on the same target object in the N frames of images to be processed using an instance segmentation network model to obtain an instance segmentation mask of the target object; a third determination unit, used to calculate the optical flow of the N frames of images to be processed using an optical flow estimation network model to obtain an optical flow map of the N frames of images to be processed.

[0009] In an exemplary embodiment, the second determination module includes: a fourth determination unit, used to construct an energy function based on the rotation and translation matrix RT using the disparity map, the instance segmentation mask and the optical flow map to obtain an RT energy function; a fifth determination unit, used to adjust the RT energy function to obtain a target RT; and a sixth determination unit, used to adjust the scene flow of the N frames of images to be processed using the target RT to obtain a target scene flow.

[0010] In an exemplary embodiment, the fourth determination unit includes: a first determination subunit, used to determine the initialization RT matrix; a second determination subunit, used to determine the constraints of the RT energy function, wherein the constraints include photometric error constraints, rigid fitting constraints and optical flow consistency constraints, the photometric error constraints are used to constrain the grayscale value of the target object, the rigid fitting constraints are used to constrain the three-dimensional point cloud of the target object, and the optical flow consistency constraints are used to constrain the optical flow value of the target object; a third determination subunit, used to determine the RT energy function based on the initialization RT matrix and the constraints.

[0011] In an exemplary embodiment, the fifth determination unit includes: a fourth determination subunit, used to optimize the RT energy function using the Gauss-Newton iteration method to obtain an optimized RT energy function; a fifth determination subunit, used to minimize the optimized RT energy function to obtain the target RT, wherein minimizing the optimized RT energy function includes: minimizing the photometric error constraint, the rigid fitting constraint and the optical flow consistency constraint.

[0012] In an exemplary embodiment, the third determination module includes: a seventh determination unit, used to determine the instance segmentation mask of the target object from the instance segmentation masks of the N frames of images to be processed; a first calculation unit, used to calculate the maximum outer bounding box of the target object in the image to be processed based on the instance segmentation mask of the target object; an eighth determination unit, used to determine the cost association matrix of the target object using the maximum outer bounding box, wherein the cost association matrix is ​​used to represent the association cost of the target object in the Kth frame of the image to be processed and the K-1th frame of the image to be processed, and the K is a natural number less than or equal to the N; a first association unit, used to associate the data of the target object according to the cost association matrix to output the first motion trajectory from the data.

[0013] In an exemplary embodiment, the fourth determination module includes: a ninth determination unit, used to determine the two-dimensional coordinate value of the target object from the first motion trajectory; a tenth determination unit, used to determine the first three-dimensional space coordinate value of the target object based on the two-dimensional coordinate value, the disparity map of the N frames of images to be processed and the calibration parameters of the camera device; an eleventh determination unit, used to predict the second three-dimensional space coordinate value of the target object in the next frame of image to be processed using the first three-dimensional space coordinate value and the target rotation and translation matrix RT of the target object determined in the target scene stream; a twelfth determination unit, used to determine the three-dimensional space center of gravity position of the target object using the second three-dimensional space coordinate value; the twelfth determination unit is used to determine the second motion trajectory from the three-dimensional space center of gravity position.

[0014] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when run.

[0015] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0016] Through the present invention, by performing image processing on the acquired N frames of images to be processed, processing parameters of the N frames of images to be processed are obtained, wherein the processing parameters include disparity maps of the N frames of images to be processed, instance segmentation masks of the N frames of images to be processed, and optical flow maps of the N frames of images to be processed, and the N frames of images to be processed are obtained by shooting at different angles for the same target object, and N is a natural number greater than or equal to 1; the scene flow of the N frames of images to be processed is adjusted by using the processing parameters to obtain the target scene flow; the target object is tracked by using the processing parameters and the target scene flow to obtain the first motion trajectory of the target object; the second motion trajectory of the target object is determined based on the processing parameters and the first motion trajectory. Motion estimation can be performed based on multiple motion information. Therefore, the problem of inaccurate determination of the motion trajectory in the related art can be solved, and the effect of accurately determining the motion trajectory can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a hardware structure block diagram of a mobile terminal of a method for determining a motion trajectory according to an embodiment of the present invention;

[0018] Figure 2 is a flow chart of a method for determining a motion trajectory according to an embodiment of the present invention;

[0019] Figure 3 is an overall flow chart according to an embodiment of the present invention;

[0020] Figure 4 4 is a structural block diagram of a device for determining a motion trajectory according to an embodiment of the present invention. DETAILED DESCRIPTION

[0021] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.

[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0023] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for determining a motion trajectory according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0024] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for determining the motion trajectory in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0025] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0026] In this embodiment, a method for determining a motion trajectory is provided. Figure 2 is a flow chart of a method for determining a motion trajectory according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0027] Step S202, performing image processing on the acquired N frames of images to be processed to obtain processing parameters of the N frames of images to be processed, wherein the processing parameters include a disparity map of the N frames of images to be processed, an instance segmentation mask of the N frames of images to be processed, and an optical flow map of the N frames of images to be processed, the N frames of images to be processed are obtained by photographing the same target object at different angles, and N is a natural number greater than or equal to 1;

[0028] Step S204, adjusting the scene flow of N frames of images to be processed using the processing parameters to obtain a target scene flow;

[0029] Step S206, tracking the target object using the processing parameters and the target scene flow to obtain a first motion trajectory of the target object;

[0030] Step S208: determining a second motion trajectory of the target object based on the processing parameters and the first motion trajectory.

[0031] The execution subject of the above steps may be a terminal, etc., but is not limited thereto.

[0032] Optionally, this embodiment includes but is not limited to being applied to scenarios where the motion trajectory of a target object is estimated. For example, in smart financial application scenarios, self-service ATM hall personnel monitoring can improve personal and property safety. In smart education application scenarios, student behavior monitoring is crucial to teaching quality and teaching safety.

[0033] Optionally, in this embodiment, N frames of images to be processed can be acquired by a binocular camera, and the target object includes but is not limited to a person. The binocular camera is installed obliquely, and can capture the head area of ​​all people in the scene, and the head area of ​​the person can be regarded as a rigid moving target.

[0034] Optionally, a binocular camera mounted obliquely can be used to capture continuous frames of left and right eye images. The monitoring screen can cover the head area of ​​the moving target in the scene. The left and right eye images are stereo calibrated and stereo rectified to obtain the camera internal and external parameters and the rectified image. A stereo matching network based on deep learning is used to calculate the disparity map, an instance segmentation network is used to calculate the instance segmentation mask, and an optical flow estimation network is used to calculate the optical flow map. The scene flow is optimized through three constraints. Multi-target tracking is performed based on the optimized scene flow and instance segmentation to obtain a two-dimensional motion trajectory. Finally, the three-dimensional motion trajectory is calculated through the optimized scene flow, such as Figure 3 As shown, it is the overall flow chart of this embodiment, which mainly includes scene flow optimization based on disparity, optical flow and instance segmentation, multi-target tracking based on instance segmentation and scene flow, and three-dimensional motion estimation of the target.

[0035] Through the above steps, since the acquired N frames of images to be processed are subjected to image processing, processing parameters of the N frames of images to be processed are obtained, wherein the processing parameters include disparity maps of the N frames of images to be processed, instance segmentation masks of the N frames of images to be processed, and optical flow maps of the N frames of images to be processed, and the N frames of images to be processed are obtained by shooting at different angles for the same target object, and N is a natural number greater than or equal to 1; the scene flow of the N frames of images to be processed is adjusted using the processing parameters to obtain the target scene flow; the target object is tracked using the processing parameters and the target scene flow to obtain the first motion trajectory of the target object; the second motion trajectory of the target object is determined based on the processing parameters and the first motion trajectory. Motion estimation can be performed based on multiple motion information. Therefore, the problem of inaccurate determination of the motion trajectory in the related art can be solved, and the effect of accurately determining the motion trajectory can be achieved.

[0036] In an exemplary embodiment, performing image processing on the acquired N frames of images to be processed to obtain processing parameters of the N frames of images to be processed includes:

[0037] S1, inputting N frames of to-be-processed images into a determined disparity map network model, and obtaining a disparity map of the to-be-processed image output by the disparity map network model, wherein the disparity map network model is determined based on a stereo matching network of deep learning;

[0038] S2, using the instance segmentation network model to perform instance segmentation annotation on the same target object in N frames of images to be processed, and obtain the instance segmentation mask of the target object;

[0039] S3, using the optical flow estimation network model to calculate the optical flow of N frames of images to be processed, and obtain optical flow maps of the N frames of images to be processed.

[0040] Optionally, in this embodiment, the scene flow represents a dense three-dimensional motion field of each point of a dynamic scene or a three-dimensional object in the scene. The scene flow can be calculated based on binocular stereo images of consecutive frames. The three-dimensional motion field is generally restored by disparity estimation and optical flow estimation. The scene flow represents the instantaneous motion vector of the three-dimensional scene. The optical flow map can be calculated from multiple frames of binocular images captured by a calibrated binocular camera, and the disparity map can be calculated by stereo matching. At the same time, this embodiment optimizes the scene flow for each target instance in the scene, and instance segmentation is also required.

[0041] Optionally, in order to obtain a dense disparity map, this embodiment uses a deep learning-based stereo matching network AANet. First, supervised training is performed on the open source disparity dataset DrivingStereo, and then unsupervised training is performed using unlabeled data collected by a binocular camera in the application scenario. Finally, a network model that can predict the disparity map in real time is obtained.

[0042] Optionally, the optical flow is calculated using a deep learning-based optical flow estimation network FlowNet. First, supervised pre-training is performed on the open source optical flow dataset Sceneflow, and then unsupervised training is performed on the collected dataset using the pre-trained network model.

[0043] Optionally, the instance segmentation network uses a centermask network. First, the data collected in the application scenario is annotated for instance segmentation, and then used for supervised training of the network. In the scene flow optimization process, each person's head area can be regarded as a rigid body doing rigid motion, and the instance annotation of the data set is mainly the annotation of the head area of ​​the moving target.

[0044] In an exemplary embodiment, adjusting the scene flow of N frames of to-be-processed images by using processing parameters to obtain a target scene flow includes:

[0045] S1, construct an energy function based on the rotation and translation matrix RT using the disparity map, instance segmentation mask and optical flow map to obtain the RT energy function;

[0046] S2, adjust the RT energy function to obtain the target RT;

[0047] S3, adjusting the scene flow of N frames of images to be processed using the target RT to obtain a target scene flow.

[0048] Optionally, in this embodiment, the head of each target object can be regarded as an instance of rigid motion. Each instance of rigid motion in the scene has a different rotation and translation matrix (RT matrix) due to the difference in its own motion speed and direction. The RT matrix is ​​calculated for each instance to predict the three-dimensional motion of the instance.

[0049] Optionally, the mask of each instance (the head of the target object) is calculated through the instance segmentation network, and then the disparity estimation network and the optical flow estimation network are used to calculate the disparity and optical flow of the current frame. The energy function based on the RT matrix is ​​constructed through the instance segmentation results, the disparity map and the optical flow map, and the optimal RT matrix is ​​obtained by minimizing the energy function through the optimization method. Minimizing the energy function is actually to solve an optimal RT matrix to minimize the energy function.

[0050] In an exemplary embodiment, the energy function of the target object based on the RT matrix is ​​constructed using the disparity map, the instance segmentation mask, and the optical flow map to obtain the RT energy function, including:

[0051] S1, determine the initialization RT matrix;

[0052] S2, determining the constraint items of the RT energy function, wherein the constraint items include a photometric error constraint item, a rigid fitting constraint item, and an optical flow consistency constraint item. The photometric error constraint item is used to constrain the grayscale value of the target object, the rigid fitting constraint item is used to constrain the three-dimensional point cloud of the target object, and the optical flow consistency constraint item is used to constrain the optical flow value of the target object;

[0053] S3, determining the RT energy function based on the initialized RT matrix and the constraint terms.

[0054] Optionally, in this embodiment, a Gauss-Newton iteration method may be used for optimization, and a reasonable initial RT matrix may be calculated using disparity, optical flow, and instance segmentation results.

[0055] In an exemplary embodiment, adjusting the RT energy function to obtain a target RT includes:

[0056] S1, using Gauss-Newton iteration method to optimize the RT energy function and obtain the optimized RT energy function;

[0057] S2, minimize the optimized RT energy function to obtain the target RT, wherein minimizing the optimized RT energy function includes: minimizing the photometric error constraint term, the rigid fitting constraint term, and the optical flow consistency constraint term.

[0058] Optionally, in this embodiment, L 0 ,R 0 ,L 1 ,R 1 Represent two consecutive binocular image pairs, D 0 ,D 1 Represent the disparity map of frame 0 and frame t1 respectively, F L ,F R They represent the optical flow graphs corresponding to two consecutive frames of the left and right eyes respectively. It represents the instance segmentation result of the t0th frame of the left image, and RT represents the rotation and translation matrix of the target between the previous and next frames.

[0059] Optionally, initializing RT includes: calculating the three-dimensional coordinates XYZ_t0 and XYZ_t1 of each instance at time t0 and t1 according to the disparity and instance segmentation results. The three-dimensional coordinate XYZ_t1 is offset by optical flow to obtain the new three-dimensional coordinate XYZ_t1To0_flow. Then, a random subset of XYZ_t0 and XYZ_t1To0_flow is selected to obtain the initial pose RT, and the pose is applied to all points in the instance for affine transformation to obtain XYZ_t1To0_RT, and the deviation between XYZ_t1To0_flow and XYZ_t1To0_RT is calculated. If the deviation in the instance is less than the set threshold and the proportion of points exceeds the set value, the pose estimation result is returned, otherwise the initial RT is recalculated.

[0060] Optionally, determining the energy function constraint includes: for L 0 For each instance in L 1 should have similar grayscale distribution in L 0 and L 1 The gray value difference should be very small. Based on this, the gray value difference of each instance can be used as a constraint term, that is, the photometric error constraint term, denoted by E photo For L 0 For each instance in , the 3D point cloud reconstructed in frame 0 can fit the 3D point cloud reconstructed in frame 1 after rotation and translation. Based on this principle, a rigid fitting constraint term can be constructed, denoted as E rigid The 3D point of a pixel point p in a certain instance of frame 0 is reprojected to the corresponding point on the image of frame 1 through the rotation and translation matrix RT, which is recorded as p'. The coordinate difference between pixel point p' and pixel point p is the optical flow value of point p. The optical flow F calculated by the optical flow estimation network L The (p'-p) calculated for each instance pixel can construct the optical flow consistency constraint term, denoted as E flow .

[0061] Optionally, the optimization of the energy function and scene flow includes: three energy constraints with the rotation and translation matrix RT as independent variables and the initial RT are constructed above. The photometric error constraint, the rigid fitting constraint, and the optical flow consistency constraint constrain the grayscale value, three-dimensional point cloud, and optical flow of each instance in the scene respectively. Taking these three constraints as energy functions and minimizing them through optimization methods, the motion estimation RT of the corresponding instance can be obtained. For each instance, the final energy function is as follows:

[0062]

[0063] E=λ photo E photo +λ rigid E rigid +λ flow E flow Formula (1);

[0064] Among them, λ photo , rigid and λ flow is the weight coefficient corresponding to each constraint item. The optimization method adopts Gauss-Newton iteration method. By minimizing the energy function E i Calculate the optimal rotation and translation matrix RT corresponding to the target instance.

[0065] According to the optimized rotation and translation matrix RT, the instance segmentation result and the disparity map of the 0th frame, the optimal disparity D of each instance can be obtained. 0 ,D 1 , Optical flow graph F rigid .

[0066] In an exemplary embodiment, tracking a target object using processing parameters and a target scene flow to obtain a first motion trajectory of the target object includes:

[0067] S1, determining the instance segmentation mask of the target object from the instance segmentation masks of N frames of images to be processed;

[0068] S2, calculating the maximum outer bounding box of the target object in the image to be processed based on the instance segmentation mask of the target object;

[0069] S3, using the maximum outer bounding box to determine the cost association matrix of the target object, wherein the cost association matrix is ​​used to represent the association cost of the target object in the Kth frame of the image to be processed and the K-1th frame of the image to be processed, and K is a natural number less than or equal to N;

[0070] S4, associating the data of the target object according to the cost association matrix to output a first motion trajectory from the data.

[0071] Optionally, in this embodiment, the idea of ​​detection-based multi-target tracking is utilized to first calculate the instance segmentation result, then calculate the maximum external bounding box based on the mask of each instance, then construct a cost association matrix, perform data association based on the cost association matrix, and finally output the target trajectory based on the data association result.

[0072] Optionally, an association cost matrix is ​​constructed based on the head instance mask and the optimized instance optical flow in the instance segmentation result. The bounding box and its center coordinates of the head instance are calculated, and then the pairwise target association cost matrix cost_mat of the m targets in the k-1th frame and the n targets in the kth frame is calculated. The association cost is composed of the head instance mask IOU_ins (intersection over union), the bounding box IOU_box and the center point distance. The smaller the association cost of two targets, the more similar they are.

[0073] Optionally, the calculation of instance mask intersection over union (IOU_ins) requires the use of the optimized instance optical flow F rigid First, use the instance optical flow F rigidMap the instance mask in the k-1 frame to the k-th frame to obtain the instance mask instance_warp of the k-th frame. Then, calculate the intersection of instance_warp and the instance mask of the instance segmentation of the n objects in the k-1-th frame, that is, IOU_ins. The IOU_ins calculated in this way not only limits the search range of the associated target by using the optical flow information, but also reduces the impact of the IOU_box value being too large due to occlusion or the target position being too close to each other.

[0074] Optionally, for two targets to be associated in the previous and next frames, first determine whether the distance between their center points is less than T (T is set to 40 pixels, assuming that the maximum distance of target movement in two consecutive frames in the image is less than 40 pixels). If the center point distance is less than T, then determine the IOU_ins and IOU_box values ​​of the target. In order to improve the robustness of the algorithm, the association cost is calculated by combining IOU_ins and IOU_box. The association cost calculation formula is as follows:

[0075]

[0076] The smaller the cost, the greater the probability that the two targets are the same target. When the cost is less than the preset threshold T_iou, the two targets are considered to be the same target. The threshold T_iou is an adjustable parameter, and setting it to 0.6 can achieve better tracking results. Multi-target tracking finally outputs the two-dimensional tracking trajectory of the target.

[0077] In an exemplary embodiment, determining a second motion trajectory of the target object based on the processing parameters and the first motion trajectory includes:

[0078] S1, determining the two-dimensional coordinate value of the target object from the first motion trajectory;

[0079] S2, determining a first three-dimensional space coordinate value of the target object according to the two-dimensional coordinate value, the disparity map of the N frames of images to be processed and the calibration parameters of the camera device;

[0080] S3, predicting a second three-dimensional space coordinate value of the target object in the next frame of the image to be processed by using the first three-dimensional space coordinate value and the target rotation and translation matrix RT of the target object determined in the target scene stream;

[0081] S4, determining the three-dimensional space center of gravity position of the target object using the second three-dimensional space coordinate value;

[0082] S5, determining a second motion trajectory from the center of gravity position in the three-dimensional space.

[0083] Optionally, the above embodiments respectively calculate the disparity map, instance segmentation map, rotation and translation matrix RT and two-dimensional tracking trajectory of multi-target tracking. In order to calculate the three-dimensional motion information of the target, it is necessary to first calculate the three-dimensional point cloud information of each target instance, and then use the rotation and translation matrix RT to predict the three-dimensional position information of the target at the next moment, and combine the two-dimensional motion trajectory of multi-target tracking to obtain the three-dimensional motion of each target.

[0084] Optionally, the instance segmentation mask of each target is obtained according to the multi-target tracking trajectory to calculate the two-dimensional coordinates [u, v] of the instance, and then the three-dimensional spatial coordinates of the instance, i.e. [X, Y, Z], are calculated according to the disparity map and the camera binocular positioning parameters. The calculation formula is as follows:

[0085]

[0086]

[0087]

[0088] Among them, Baseline represents the baseline distance of the binocular camera, u and v represent the horizontal and vertical coordinates of the pixel point in the instance, d represents the disparity value of the corresponding point, u0 and v0 represent the horizontal and vertical coordinates of the center point of the left eye image, respectively. Then, the three-dimensional space coordinates [X, Y, Z] of the instance and its rotation and translation matrix RT are combined to predict its three-dimensional space coordinates [X_, Y_, Z_] at the next moment. The calculation formula is as follows:

[0089]

[0090] Predict the next moment's three-dimensional space coordinates [X_, Y_, Z_] of the instance, and finally calculate the three-dimensional space center of gravity position of the instance as the tracking trajectory point of the three-dimensional motion. The three-dimensional space coordinates of the center of gravity are marked as [x, y, z]. The calculation formula is as follows:

[0091]

[0092]

[0093]

[0094] Wherein, N represents the total number of 3D points of the instance, and i represents the ith 3D point. Thus, the present invention can obtain the 2D motion trajectory and 3D space motion trajectory of the human head region through instance segmentation, disparity map, scene flow and multi-target tracking.

[0095] In summary, this embodiment constructs an energy function based on three constraints, and uses optical flow information to reasonably initialize RT, and then stably outputs the accurate rotation and translation matrix RT of each instance by minimizing the energy function of each instance. The image acquisition method of the obliquely mounted binocular camera can capture the head area of ​​all target persons in the monitoring area, and each target head area can be regarded as an instance of rigid motion. The effective depth measurement range of the Kinect used in Patent 1 is limited, and it is difficult to effectively detect targets at a distance. Compared with Kinect, the binocular camera has a longer effective detection distance. Using an instance-based segmentation method to detect the target head area, targets that are close or side by side can be effectively distinguished, and it is not easy to cause false detection of close targets.

[0096] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0097] In this embodiment, a device for determining a motion trajectory is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0098] Figure 4 is a structural block diagram of a device for determining a motion trajectory according to an embodiment of the present invention. Figure 4 As shown, the device comprises:

[0099] A first determining module 42 is used to perform image processing on the acquired N frames of to-be-processed images to obtain processing parameters of the N frames of to-be-processed images, wherein the processing parameters include disparity maps of the N frames of to-be-processed images, instance segmentation masks of the N frames of to-be-processed images, and optical flow maps of the N frames of to-be-processed images, wherein the N frames of to-be-processed images are obtained by photographing the same target object at different angles, and N is a natural number greater than or equal to 1;

[0100] A second determination module 44 is used to adjust the scene flow of N frames of images to be processed using the processing parameters to obtain a target scene flow;

[0101] A third determination module 46 is used to track the target object using the processing parameters and the target scene flow to obtain a first motion trajectory of the target object;

[0102] The fourth determination module 48 is configured to determine a second motion trajectory of the target object based on the processing parameters and the first motion trajectory.

[0103] In an exemplary embodiment, the first determining module includes:

[0104] A first determining unit is used to input the N frames of to-be-processed images into a determined disparity map network model to obtain a disparity map of the to-be-processed images output by the disparity map network model, wherein the disparity map network model is determined based on a stereo matching network of deep learning;

[0105] A second determining unit is used to perform instance segmentation annotation on the same target object in the N frames of images to be processed by using an instance segmentation network model to obtain an instance segmentation mask of the target object;

[0106] The third determination unit is used to calculate the optical flow of the N frames of images to be processed by using the optical flow estimation network model to obtain the optical flow maps of the N frames of images to be processed.

[0107] In an exemplary embodiment, the second determining module includes:

[0108] A fourth determining unit is used to construct an energy function based on a rotation and translation matrix RT by using the disparity map, the instance segmentation mask and the optical flow map to obtain an RT energy function;

[0109] A fifth determining unit, configured to adjust the RT energy function to obtain a target RT;

[0110] The sixth determining unit is configured to adjust the scene flow of the N frames of images to be processed by using the target RT to obtain a target scene flow.

[0111] In an exemplary embodiment, the fourth determining unit includes:

[0112] A first determining subunit, used to determine an initialization RT matrix;

[0113] A second determination subunit is used to determine the constraint items of the RT energy function, wherein the constraint items include a photometric error constraint item, a rigid fitting constraint item, and an optical flow consistency constraint item, the photometric error constraint item is used to constrain the grayscale value of the target object, the rigid fitting constraint item is used to constrain the three-dimensional point cloud of the target object, and the optical flow consistency constraint item is used to constrain the optical flow value of the target object;

[0114] The third determination subunit is used to determine the RT energy function based on the initialized RT matrix and the constraint item.

[0115] In an exemplary embodiment, the fifth determining unit includes:

[0116] The fourth determination subunit is used to optimize the RT energy function by using the Gauss-Newton iteration method to obtain an optimized RT energy function;

[0117] The fifth determination subunit is used to minimize the above-mentioned optimized RT energy function to obtain the above-mentioned target RT, wherein minimizing the above-mentioned optimized RT energy function includes: minimizing the above-mentioned photometric error constraint item, the above-mentioned rigid fitting constraint item and the above-mentioned optical flow consistency constraint item.

[0118] In an exemplary embodiment, the third determining module includes:

[0119] a seventh determining unit, configured to determine the instance segmentation mask of the target object from the instance segmentation masks of the N frames of images to be processed;

[0120] A first calculation unit, configured to calculate a maximum outer bounding box of the target object in the image to be processed based on the instance segmentation mask of the target object;

[0121] an eighth determining unit, configured to determine a cost association matrix of the target object using the maximum external bounding box, wherein the cost association matrix is ​​used to represent an association cost of the target object in the Kth frame of the image to be processed and the K-1th frame of the image to be processed, and the K is a natural number less than or equal to the N;

[0122] The first association unit is used to associate the data of the target object according to the cost association matrix to output the first motion trajectory from the data.

[0123] In an exemplary embodiment, the fourth determining module includes:

[0124] a ninth determining unit, configured to determine a two-dimensional coordinate value of the target object from the first motion trajectory;

[0125] a tenth determining unit, configured to determine a first three-dimensional space coordinate value of the target object according to the two-dimensional coordinate value, the disparity map of the N frames of images to be processed, and a calibration parameter of the camera device;

[0126] an eleventh determining unit, configured to predict a second three-dimensional space coordinate value of the target object in a next frame of the image to be processed by using the first three-dimensional space coordinate value and a target rotation and translation matrix RT of the target object determined in the target scene stream;

[0127] A twelfth determining unit, configured to determine the three-dimensional space center of gravity position of the target object using the second three-dimensional space coordinate value;

[0128] The twelfth determining unit is used to determine the second motion trajectory from the center of gravity position of the three-dimensional space.

[0129] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0130] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0131] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0132] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0133] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0134] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0135] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0136] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for determining a motion trajectory, characterized in that: include: Performing image processing on the acquired N frames of images to be processed to obtain processing parameters of the N frames of images to be processed, wherein the processing parameters include disparity maps of the N frames of images to be processed, instance segmentation masks of the N frames of images to be processed, and optical flow maps of the N frames of images to be processed, the N frames of images to be processed are obtained by photographing the same target object at different angles, and N is a natural number greater than or equal to 1; Using the processing parameters to adjust the scene flow of the N frames of images to be processed to obtain a target scene flow; Tracking the target object using the processing parameters and the target scene flow to obtain a first motion trajectory of the target object; determining a second motion trajectory of the target object based on the processing parameters and the first motion trajectory; Wherein, determining the second motion trajectory of the target object based on the processing parameters and the first motion trajectory includes: determining the two-dimensional coordinate value of the target object from the first motion trajectory; determining the first three-dimensional space coordinate value of the target object according to the two-dimensional coordinate value, the disparity map of the N frames of images to be processed and the calibration parameters of the camera device; predicting the second three-dimensional space coordinate value of the target object in the next frame of the image to be processed by using the first three-dimensional space coordinate value and the target rotation and translation matrix RT of the target object determined in the target scene stream; determining the three-dimensional space center of gravity position of the target object by using the second three-dimensional space coordinate value; and determining the second motion trajectory from the three-dimensional space center of gravity position.

2. The method according to claim 1, characterized in that Performing image processing on the acquired N frames of images to be processed to obtain processing parameters of the N frames of images to be processed includes: Inputting the N frames of to-be-processed images into a determined disparity map network model to obtain a disparity map of the to-be-processed images output by the disparity map network model, wherein the disparity map network model is determined based on a stereo matching network of deep learning; Using an instance segmentation network model, annotating the same target object in the N frames of images to be processed by instance segmentation to obtain an instance segmentation mask of the target object; The optical flow of the N frames of images to be processed is calculated using an optical flow estimation network model to obtain an optical flow map of the N frames of images to be processed.

3. The method according to claim 1, characterized in that Using the processing parameters to adjust the scene flow of the N frames of images to be processed to obtain a target scene flow includes: constructing an energy function based on a rotation and translation matrix RT by using the disparity map, the instance segmentation mask and the optical flow map to obtain an RT energy function; Adjusting the RT energy function to obtain a target RT; The scene flow of the N frames of images to be processed is adjusted using the target RT to obtain the target scene flow.

4. The method according to claim 3, characterized in that: Constructing an energy function of the target object based on an RT matrix using the disparity map, the instance segmentation mask, and the optical flow map to obtain an RT energy function, including: Determine the initialization RT matrix; Determining the constraint items of the RT energy function, wherein the constraint items include a photometric error constraint item, a rigid fitting constraint item, and an optical flow consistency constraint item, the photometric error constraint item is used to constrain the grayscale value of the target object, the rigid fitting constraint item is used to constrain the three-dimensional point cloud of the target object, and the optical flow consistency constraint item is used to constrain the optical flow value of the target object; The RT energy function is determined based on the initialized RT matrix and the constraint terms.

5. The method according to claim 4, characterized in that Adjusting the RT energy function to obtain a target RT includes: Optimizing the RT energy function using the Gauss-Newton iteration method to obtain an optimized RT energy function; Minimize the optimized RT energy function to obtain the target RT, wherein minimizing the optimized RT energy function includes: minimizing the photometric error constraint term, the rigid fitting constraint term, and the optical flow consistency constraint term.

6. The method according to claim 1, characterized in that Tracking the target object using the processing parameters and the target scene flow to obtain a first motion trajectory of the target object includes: Determine an instance segmentation mask of the target object from instance segmentation masks of the N frames of images to be processed; Calculating a maximum outer bounding box of the target object in the image to be processed based on the instance segmentation mask of the target object; Determine a cost association matrix of the target object using the maximum outer bounding box, wherein the cost association matrix is ​​used to represent the association cost of the target object in the Kth frame of the image to be processed and the K-1th frame of the image to be processed, and K is a natural number less than or equal to N; The data of the target object is associated according to the cost association matrix to output the first motion trajectory from the data.

7. A device for determining a motion trajectory, characterized in that: include: A first determination module is used to perform image processing on the acquired N frames of to-be-processed images to obtain processing parameters of the N frames of to-be-processed images, wherein the processing parameters include disparity maps of the N frames of to-be-processed images, instance segmentation masks of the N frames of to-be-processed images, and optical flow maps of the N frames of to-be-processed images, wherein the N frames of to-be-processed images are obtained by photographing the same target object at different angles, and N is a natural number greater than or equal to 1; A second determination module is used to adjust the scene flow of the N frames of images to be processed using the processing parameters to obtain a target scene flow; A third determination module is used to track the target object by using the processing parameters and the target scene flow to obtain a first motion trajectory of the target object; a fourth determination module, configured to determine a second motion trajectory of the target object based on the processing parameters and the first motion trajectory; Among them, the fourth determination module includes: a ninth determination unit, used to determine the two-dimensional coordinate value of the target object from the first motion trajectory; a tenth determination unit, used to determine the first three-dimensional space coordinate value of the target object according to the two-dimensional coordinate value, the disparity map of the N frames of images to be processed and the calibration parameters of the camera device; an eleventh determination unit, used to predict the second three-dimensional space coordinate value of the target object in the next frame of the image to be processed using the first three-dimensional space coordinate value and the target rotation and translation matrix RT of the target object determined in the target scene stream; a twelfth determination unit, used to determine the three-dimensional space center of gravity position of the target object using the second three-dimensional space coordinate value; the twelfth determination unit is used to determine the second motion trajectory from the three-dimensional space center of gravity position.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 6 when executed.

9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • High-precision edge protection type RGBD scene flow estimation method

    CN110047093A

  • Multi-target three-dimensional trajectory tracking method and device

    CN110533687A

  • Target tracking method and device and storage device

    CN110796686A

  • Method and system for detecting moving target object and movable platform

    CN111247557A

  • Return trajectory prediction method based on binocular vision perception of racket swinging and ball hitting actions

    CN111369629A