Movatterモバイル変換


[0]ホーム

URL:


CN115953437B - A real-time multi-target tracking method integrating visual optical flow feature point tracking and motion trend estimation - Google Patents

A real-time multi-target tracking method integrating visual optical flow feature point tracking and motion trend estimation

Info

Publication number
CN115953437B
CN115953437BCN202310119716.2ACN202310119716ACN115953437BCN 115953437 BCN115953437 BCN 115953437BCN 202310119716 ACN202310119716 ACN 202310119716ACN 115953437 BCN115953437 BCN 115953437B
Authority
CN
China
Prior art keywords
target
frame
tracking
rectangular
frames
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310119716.2A
Other languages
Chinese (zh)
Other versions
CN115953437A (en
Inventor
孙长亮
刘宏立
吴晓闯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan University
Original Assignee
Hunan University
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 Hunan UniversityfiledCriticalHunan University
Priority to CN202310119716.2ApriorityCriticalpatent/CN115953437B/en
Publication of CN115953437ApublicationCriticalpatent/CN115953437A/en
Application grantedgrantedCritical
Publication of CN115953437BpublicationCriticalpatent/CN115953437B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Landscapes

Abstract

The invention provides a multi-target real-time tracking method for intelligent driving scene fusion visual optical flow feature point tracking and motion trend estimation, which comprises the steps of extracting optical flow features from a target area tracked by a previous frame, predicting the position of a target at a current frame, predicting a rectangular frame motion trend through a rectangular frame motion trend estimation algorithm, and comparing two prediction results to obtain the predicted position of the target of the previous frame at the current frame; and finally, carrying out position filtering on the successfully tracked target, improving the stability of the target rectangular frame and outputting the target rectangular frame to an intelligent driving decision module. The invention is mainly applied to an intelligent driving visual target tracking module and provides stable and reliable target output for a system.

Description

Multi-target real-time tracking method integrating visual light flow characteristic point tracking and motion trend estimation
Technical Field
The invention relates to the field of intelligent driving vision multi-target tracking, in particular to a multi-target real-time tracking method integrating vision optical flow characteristic point tracking and motion trend estimation.
Background
The research of the visual target tracking technology has very important significance in the field of intelligent driving perception, and the technology can estimate the motion state and trend of the target, so that the motion direction and speed of the target are calculated, and a basis is provided for an intelligent driving decision module.
The current visual target tracking technology has more research foundation and can be divided into related filtering, optical flow, motion state estimation, deep learning and other technologies according to different algorithm types. Early target tracking algorithms mainly comprise Median Flow, kalman filtering and the like, algorithms based on correlation filtering mainly comprise MOSSE, CSK, KCF and the like, and in recent years, target tracking algorithms based on deep learning are becoming popular, such as ECO, MDNet, SANet and DeepSORT.
However, in the application of the intelligent driving field, as the vehicle moves fast and the scene is complex, how to solve the problems of target shielding, fast movement, light change and the like is a great difficulty, and meanwhile, the problems of more targets, high real-time requirements and limited chip calculation force also put forward higher requirements on the performance of a tracking algorithm.
At present, in the deployment process of many algorithms, actual requirements cannot be met, for example, the algorithms such as media Flow and KCF are single-target tracking, real-time performance cannot be achieved when the algorithms are expanded to multi-target tracking, the algorithms based on deep learning are required to be independently marked with video tracking data sets, the cost is high, and the performance cannot reach expectations.
Therefore, a multi-objective real-time tracking algorithm suitable for intelligent driving scenarios is needed.
Disclosure of Invention
In order to solve the defects in the prior art, the invention aims to provide a multi-target real-time tracking method integrating visual optical flow characteristic point tracking and motion trend estimation, which aims to solve the problem of complex scene tracking, improve tracking precision and algorithm running efficiency and enable a tracking result to be smoother.
According to a first aspect of the present invention, there is provided a multi-target real-time tracking method integrating visual optical flow feature point tracking and motion trend estimation, comprising:
Step 10, acquiring an image Mi of the current ith frame in real time through image acquisition equipment, detecting targets in Mi by using a YOLO target detection algorithm to obtain rectangular frame positions of the targets, and adding each target of the ith frame into a target detection result list Objectsi of the ith frame.
Step 20, if the i frame is the first frame, configuring a new ID for each object in Objectsi, setting object first parameter tracked _frames to 1, setting object second parameter patched_frames to 0, assigning Objectsi to the object tracking result list of the current i frameJump to step 70 and if the i-th frame is not the first frame, proceed to step 30.
Step 30, target tracking result list for the i-1 th frameIs processed by a rectangular frame motion trend estimation algorithm to obtain a target motion state prediction position list of the current frameProcessing by using a rectangular frame area image optical flow characteristic point tracking algorithm to obtain a target optical flow prediction position list of the current frame
Step 40. ComparisonAndThe position of a rectangular frame of the same object j as the ID, calculating the overlapping degree IoU1 of a first rectangular frame, and presetting a threshold according to the first overlapping degreeJudging if (3)The target tracking is successful, the target is added into the position tracking prediction result list of the target of the i-1 frame in the i frameAnd 1 to the patched_frames of the target, ifThe target tracking fails, tracked _frames for the target is set to 0.
Step 50, associating each object in Objectsi with each otherThe matching degree is calculated according to each target in the image region, wherein the matching degree comprises a second overlapping degree matching degree IoU2, a normalized center point distance Dist, a difference degree Diff and an image region similarity SimM, ioU2 is used as the weight of the two target matching degrees if the matching degree meets a super-parameter threshold, the weight corresponding to the two target matching degrees is set to 0 if the matching degree does not meet the super-parameter threshold, and a matching degree weight matrix is constructed based on the weight.
Step 60, obtaining the matching relation between each object of the i-1 frame and the i frame by using a KM optimal matching algorithm according to a matching degree weight matrix, for the successfully matched object, assigning the ID of the object in the i-1 frame to the matched object of the i frame, tracked _frames plus 1, patched_frames being set to 0, for the unmatched object in the i frame, assigning a new ID, tracked _frames being set to 1, patched_frames being set to 0, for the unmatched object in the i-1 frame, the ID is unchanged, patched_frames plus 1, each object being addedA list.
Step 70, pairThe target in (a) is analyzed and judged, and if patched_frames are larger than the maximum target prediction frame number Pn, the target is selected fromRecovering its ID, if patched_frames are less than the maximum target predicted frame number Pn and tracked _frames are greater than the minimum target tracking frame number Tn, then the target is removed fromRemoved and addedA list.
Step 80. ForFiltering by using a rectangular frame smoothing filtering algorithm, outputting a filtered result, completing tracking of the current ith frame target, and performing filtering on the current ith frame targetAdding the target in the buffer list for tracking the next frame, and returning to the step 10 to process the next frame image.
Further, the multi-target real-time tracking method integrating visual optical flow characteristic point tracking and motion trend estimation is characterized in that a rectangular frame of the target comprises an upper left corner coordinate (x, y) of a rectangular frame area of an object in an image, a width w and a height h.
Furthermore, the multi-target real-time tracking method for integrating visual optical flow characteristic point tracking and motion trend estimation is characterized in that the rectangular frame motion trend estimation algorithm comprises the following steps ofRectangular frame position of middle object jTracking and predicting by using a Kalman filter, predicting the rectangular frame position of the current frame target according to the historical rectangular frame position of the target, and calculating to obtain the motion state prediction position of the target jAnd add to the list
The rectangular frame region image optical flow characteristic point tracking algorithm comprises respectively constructing a gray image pyramid for Mi and Mi-1, and generating a gray image pyramidRectangular frame position of middle object jUniformly selecting K coordinate points in Mi-1, calculating the positions of the K coordinate points in Mi by using LK optical flow point matching algorithm based on gray image pyramid, counting the position offset of all corresponding points between Mi and Mi-1, taking the average value as the optical flow tracking offset of the target jOptical flow tracking result of calculation target jIs thatAnd add to the list
Further, the multi-target real-time tracking method for fusing visual optical flow characteristic point tracking and motion trend estimation is characterized in that for a rectangular frame Ra(xa,ya,wa,ha) and a rectangular frame Rb(xb,yb,wb,hb), the overlapping degree of the rectangular frames is IoU =the intersection area of the two rectangular frames/the union area of the two rectangular frames.
The normalized center point distance is: Wherein: Center point coordinates of the rectangular boxes Ra and Rb, respectively, Wm represents the image width and Hm represents the image height.
The degree of difference is :Diff=abs(log(wa/wb))+abs(log(ha/hb)),wa,ha,wb,hb, which is the width and height of the rectangular boxes Ra and Rb, respectively.
The calculation of the similarity SimM of the image area comprises separating RGB channels of two rectangular frame area images Ma and Mb, counting color histogram, and normalizingWherein S{a,b} denotes the pixel area of the rectangular frame area image Ma or Mb,Representing the pixel value of the image Ma or Mb at the (i, j) position. For color histogram vectorsAndAnd calculating the similarity SimM =va`Vb/(||Va||×||Vb | of the image areas where the two rectangular frames are positioned by adopting a cosine similarity formula, wherein Va`Vb represents two vector point multiplication, and |va | and |vb | respectively represent the modes of the two vectors.
Further, the multi-target real-time tracking method for integrating visual optical flow characteristic point tracking and motion trend estimation is characterized in that the matching degree meeting the super-parameter threshold value comprises the following steps: Dist < threshdist、Diff<threshdiff、SimM>threshsim, whereFor the second overlap preset threshold, threshdist is the center point distance preset threshold, threshdiff is the difference preset threshold, and threshsim is the similarity preset threshold.
Further, the multi-target real-time tracking method for integrating visual optical flow characteristic point tracking and motion trend estimation is characterized in that a rectangular frame smoothing filtering algorithm is as follows:
The positions of rectangular frames of the target j from the i-2 frame to the i frame are respectively marked as Ri-2,j(xi-2,j,yi-2,j,wi-2,j,hi-2,j)、Ri-1,j(xi-1,j,yi-1,j,wi-1,j,hi-1,j)、Ri,j(xi,j,yi,j,wi,j,hi,j);, and the positions of rectangular frames after filtering from the i-3 frame to the i-1 frame are respectively marked as R'i-3,j(x'i-3,j,y'i-3,j,w'i-3,j,h'i-3,j)、R'i-2,j(x'i-2,j,y'i-2,j,w'i-2,j,h'i-2,j)、R,i-1,j(x'i-1,j,y'i-1,j,w'i-1,j,h,i-1,j).
The four parameters of the rectangular frame are respectively filtered by a 2-order Butterworth low-pass filter to be:
wherein, (a1,a2,a3) and (b1,b2,b3) are butterworth low-pass filter parameters, and are calculated by setting sampling frequency and cut-off frequency. And obtaining a target rectangular frame filtering result R'i,j(x'i,j,y'i,j,w'i,j,w'i,j).
Furthermore, the multi-target real-time tracking method integrating visual light flow characteristic point tracking and motion trend estimation is characterized in that the image acquisition equipment is arranged on a vehicle, a sensing area covers the front of the vehicle, and targets comprise vehicles, pedestrians and non-motor vehicles.
According to a second aspect of the present invention, there is provided a computer device characterized by comprising:
A memory for storing instructions, and
And the processor is used for calling the instructions stored in the memory to execute the multi-target real-time tracking method integrating the visual optical flow characteristic point tracking and the motion trend estimation in the first aspect.
According to a third aspect of the present invention, there is provided a computer-readable storage medium storing instructions that, when executed by a processor, perform the multi-objective real-time tracking method of the first aspect that fuses visual optical flow feature point tracking with motion trend estimation.
Compared with the prior art, the technical scheme of the invention has at least the following beneficial effects:
The position prediction of the previous frame target in the current frame is realized by combining the Kalman state filter and the optical flow tracking algorithm, and the problem that a single predictor cannot cover a complex scene is solved.
Aiming at the problem of calculating the similarity of the targets of the front frame and the rear frame, the method evaluates the targets from two dimensions, firstly, an evaluation algorithm is respectively designed by the overlapping degree of the rectangular frames, the distance between the center points and the size of the rectangular frames, secondly, a cosine similarity evaluation algorithm based on a color histogram is put forward on the image similarity of the rectangular frame area, so that the similarity of the targets is calculated more comprehensively, and the target tracking precision is improved.
In the aspect of target bipartite graph matching, compared with a Hungary matching algorithm commonly used in the industry, the method can only realize maximum matching, and the KM matching algorithm adopted by the invention further considers matching weights on the basis of the Hungary algorithm to realize optimal matching.
The target tracking algorithm realized by the invention provides a rectangular frame filtering algorithm based on a Butterworth low-pass filter on the basis of the rectangular frame jitter problem of the target, so that the target tracking result is smoother.
The invention finally achieves the operation efficiency of 30 frames per second in the embedded system, and the tracking target reaches 64 at most, and the tracking performance has advantages.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a schematic flow diagram that is shown in accordance with an exemplary embodiment.
FIG. 2 is a diagram illustrating optimal bipartite matching of rectangular boxes according to an example embodiment.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention. In addition, the technical features of the embodiments of the present invention described below may be combined with each other as long as they do not collide with each other.
Algorithm marking description:
Initializing the target number array, marking it as ListID, and adopting queue structure for list.
The current frame is marked as i, the current frame image is marked as Mi, the current target detection result is marked as Objectsi, and the current target tracking result is marked as
The previous frame image is marked as Mi-1, and the previous frame target tracking result is marked asThe prediction result of the motion state of the target in the previous frame is recorded asThe predicted result of the target optical flow of the previous frame is recorded asThe result of the predicted position of the previous frame target in the current frame is recorded as
Current target tracking result usageAnd (3) representing.
Each tracked target contains parameters of a target label id, a target tracking frame number tracked _frames, a target prediction frame number patched_frames, and a target rectangular frame coordinate R (x, y, w, h).
The parameter Tn represents the minimum target tracking frame number, and the parameter Pn represents the maximum target prediction frame number.
As shown in fig. 1, in one embodiment, the multi-target real-time tracking method for fusing visual optical flow feature point tracking and motion trend estimation provided by the present invention comprises the following steps:
1) The system is built, wherein a camera is arranged on a front windshield of a vehicle, covers a forward sensing area, is connected with a controller through a video transmission line and supplies power to the whole system;
2) Initializing a system, namely starting the system, loading a driver, performing self-checking on hardware functions, and alarming and exiting the system if the hardware fails, and entering the next step if the self-checking of the system is normal;
3) The algorithm collects the camera image of the current frame i in real time, which is marked as Mi, and uses the YOLO object detection algorithm to detect the object in the image, including vehicles, pedestrians and non-motor vehicles, which are marked as Objectsi;
4) If the current frame is the first frame, the target detection result is assigned to the current tracking resultStep 10), if not, entering the next step;
5) Tracking results for the i-1 st frameObtaining the motion state prediction position of each target in the current frame by using a rectangular frame motion trend estimation algorithm (see (4) rectangular frame motion trend estimation algorithm in an algorithm key module), and marking as
6) Tracking results for the i-1 st frameObtaining the optical flow prediction position of each target in the current frame by using a rectangular frame area image optical flow characteristic point tracking algorithm (see a 5 th partial rectangular frame area image optical flow characteristic point tracking algorithm in a 5 th node algorithm key module), and marking as
7) ComparisonAndCalculating the overlapping degree IoU of the rectangular frame positions of the corresponding targets in the list, ifThen add the target toList, and add 1 to the patched_frames parameter number of each target, otherwise the target tracking fails;
8) Tracking the predicted result with the i-1 th frame for each object in the i-th frame detection result ObjectsiCalculating the matching degree of the rectangular frames (see (1) rectangular frame matching degree calculation in the algorithm key module) and the similarity SimM of the image areas where the rectangular frames are located (see (2) rectangular frame area image similarity calculation in the algorithm key module), if the matching degree between the two rectangular frames meets the following conditions: Dist < threshdist、Diff<threshdiff、SimM>threshsim, building a matrix based on IoU as a weight;
9) Using weight matrix, executing optimal binary matching algorithm of rectangular frame (see (6) in key module of algorithm) to obtain correspondent relationship, for the successfully matched target, assigning correspondent target id in i-1 th frame to the target of current i-th frame, adding 1 to target parameter tracked _frames, setting 0 to patched_frames, for the unmatched target in i-th frame, distributing new id in target label array ListID, setting tracked _frames to 1, setting 0 to patched_frames, for the unmatched target in i-1 th frame, making target label unchanged, adding 1 to patched_frames, adding three targets into the systemA list;
10 Pair of (a) to (b)Analyzing and judging the target in the list, if the patched_frames are larger than the maximum target predicted frame number Pn, removing the target from the list and recovering the id to the target label list ListID, if the patched_frames are smaller than the maximum target predicted frame number Pn and the tracked _frames are larger than the minimum target tracking frame number Tn, removing the targetAnd add intoList of willThe target in the database is cached and used for follow-up target tracking calculation;
11 Pair of (a) to (b)Each target in the list is filtered by a rectangular frame smoothing filter algorithm (see (3) rectangular frame smoothing filter algorithm in an algorithm key module), jitter of a rectangular frame is reduced, a filtered result is added into a cache list for tracking a next frame, and meanwhile, a target tracking result is output to an intelligent driving decision module for decision making, and current frame target tracking is completed.
12 Returning to step 3).
The algorithm key module involved in the above steps comprises the following parts:
(1) Rectangular frame matching degree calculation: rectangular frame Ra(xa,ya,wa,ha) and rectangular frame Rb(xb,yb,wb,hb) three calculation methods are adopted:
Overlap IoU = intersection area of two rectangular boxes/union area of two rectangular boxes.
Normalized center point distanceWherein: Center point coordinates of the rectangular boxes Ra and Rb, respectively, Wm represents the image width and Hm represents the image height.
Difference diff=abs (log (wa/wb))+abs(log(ha/hb)).
(2) Calculating the similarity SimM of the rectangular frame region image:
RGB channels of the rectangular frame area images Ma and Mb are separated, color histograms are counted, normalization processing is carried out, and the calculation formula is as follows:
Where S{a,b} denotes the pixel area of the rectangular frame area image Ma or Mb,Representing the pixel value of the image Ma or Mb at the (i, j) position.
Correspondingly forming color histogram vectors with the same two dimensionsAndAnd calculating the similarity of two rectangular images by adopting a cosine similarity formula:
SimM=Va·Vb/(||Va||×||Vb||)
Where Va·Vb represents two vector point multiplies, the |va | and the |vb | represent the modes of the two vectors, respectively.
(3) And (3) a rectangular frame smoothing filter algorithm, namely, in order to enable the rectangular frame tracked by the target to be more stable, the position of the tracked target rectangular frame is adjusted through the smoothing filter algorithm. The current frame is denoted as i, and smoothing filtering is performed on the object denoted by reference numeral j as follows:
The positions of rectangular frames of the targets from the i-2 frame to the i-1 frame are respectively marked as Ri-2,j(xi-2,j,yi-2,j,wi-2,j,hi-2,j)、Ri-1,j(xi-1,j,yi-1,j,wi-1,j,hi-1,j)、Ri,j(xi,j,yi,j,wi,j,hi,j);, and the positions of rectangular frames after filtering from the i-3 frame to the i-1 frame are respectively marked as R'i-3,j(x'i-3,j,y'i-3,j,w'i-3,j,h'i-3,j)、R'i-2,j(x'i-2,j,y'i-2,j,w'i-2,j,h'i-2,j)、R,i-1,j(x'i-1,j,y'i-1,j,w'i-1,j,h,i-1,j).
The four parameters of the rectangular frame are respectively filtered by a 2-order Butterworth low-pass filter, and the calculation formula is as follows:
wherein, (a1,a2,a3) and (b1,b2,b3) are butterworth low-pass filter parameters, and are calculated by setting sampling frequency and cut-off frequency.
And returning and storing the target rectangular box filtering result R,i,j(x'i,j,y'i,j,w'i,j,w'i,j).
(4) In order to improve the accuracy of target tracking, the invention predicts the rectangular frame position of each target, adopts a 4-dimensional Kalman state filter, comprises (x, y, w, h) of the rectangular frame, and predicts the rectangular frame position of the target of the current frame according to the historical rectangular frame position of the target.
(5) The invention constructs a gray pyramid for the front and back frames of images, calculates the position of the rectangular frame area image of the previous frame in the current frame by LK optical flow tracking algorithm, thereby realizing optical flow tracking, and the algorithm steps are as follows:
And respectively constructing a gray pyramid for the front frame image and the rear frame image.
For last frame target listK points are uniformly selected from the rectangular frame area of each target.
The positions of these K points in the current frame image are calculated using the LK optical flow point matching algorithm.
And deleting the points with failed matching, and respectively calculating the transverse offset and the longitudinal offset of the front frame and the rear frame for the rest points.
And calculating the rectangular frame position of the target in the current frame.
Adding optical flow tracking results to a computer systemList and return.
(6) The invention converts the target matching problem between the rectangular frame list A and the rectangular frame list B into the bipartite graph matching problem, and calculates the optimal matching result by adopting a KM optimal matching algorithm.
First, the IoU overlap between the rectangular boxes of the two lists is calculated.
And constructing a weight matrix by taking the overlapping degree as the weight.
And calculating the weight matrix through a KM algorithm to obtain a matching relationship between the rectangular frames of the list A and the list B under the condition of optimal matching.
And the rectangle box successfully matched is considered as the same target, and a matching result is returned.
As shown in FIG. 2, 3 targets exist in the list A, 4 targets exist in the list B, the overlapping degree IoU is calculated for each target rectangular frame in the list in pairs, the value range is (0-1), a weight matrix is obtained, and then a KM optimal binary matching algorithm is used to obtain a matching result. Through operation, A1, A2 and A3 in FIG. 2 are successfully matched with B1, B2 and B4 in the list B respectively.
Specifically, in some embodiments, the invention is implemented by the steps of:
1) The system is built by installing a camera on a front windshield of a vehicle, covering a forward sensing area, connecting with a controller through a video transmission line and supplying power to the whole system.
2) Initializing the system, namely starting the system, loading the drive, performing self-checking on hardware functions, alarming and exiting the system if the hardware fails, and entering the next step if the self-checking of the system is normal.
3) The camera image of the current frame i is acquired in real time and is marked as Mi, a YOLO target detection algorithm is used for detecting targets in the image, each target position comprises pixel coordinates x and y of the upper left corner of a rectangular frame area of the object in the image, the width and the height w and h, the target category comprises vehicles, pedestrians and non-motor vehicles, and the identification result is marked as Objectsi.
4) If the current frame i is the first frame, initializing a target index queue ListID with a queue length of 128 and a queue data range of 0-127, assigning an ID to each target in the detection result Objectsi by using the first-in first-out principle for data input and output in the queue, setting a target parameter tracked _frames to 1, setting patched_frames to 0, and putting the targets into a listTo step 12), if the current frame i is not the first frame, proceeding to the next step.
5) Fetching the i-1 frame target tracking result from the buffer memoryRectangular frame position for each tracking target jTracking and predicting by using Kalman filter to obtain the predicted position of each target in the motion state of current frameAnd add to the listThis module is named rectangular box motion trend estimation algorithm.
6) Taking out the i-1 th frame image Mi-1 in the buffer memory, constructing a gray level image pyramid for the images Mi and Mi-1 respectively, and tracking the i-1 th frameRectangular frame position of each tracking target j in (a)K coordinate points are respectively taken in the row direction and the column direction, the positions of the K2 points in the current frame image are calculated by using an LK optical flow point matching algorithm based on a gray level image pyramid, and the position offset taking and the distance offset taking values between the corresponding points are recorded as valuesThe optical flow tracking result of each tracking target in the current frame is calculated by adopting the following formulaAnd add to the listThe module is named as a rectangular frame area image optical flow characteristic point tracking algorithm:
7) ComparisonAndCalculating the overlap IoU between the rectangular box positions of the corresponding targets in the list ifThen add the target toList and add 1 to the patched_frames parameter value for each target, otherwise the target tracking fails, tracked _frames parameter is set to 0.
8) Tracking the predicted result with the i-1 th frame for each target in the current frame i detection result ObjectsiThe matching degree is calculated by the rectangular frame of each target, and comprises the overlapping degree IoU, the normalized center point distance Dist and the difference degree Diff, and the calculation formula is as follows:
iou = intersection area of two rectangular boxes/union area of two rectangular boxes.
b.Wherein: Center point coordinates of the rectangular boxes Ra and Rb, respectively, Wm represents the image width and Hm represents the image height.
c.Diff=abs(log(wa/wb))+abs(log(ha/hb))。
9) Recomputing Objectsi each separately associated with each objectThe similarity SimM of the image area of the target in the method is calculated by two steps:
a. The RGB channels of the two rectangular frame area images Ma and Mb are separated, the color histogram is counted, the normalization processing is performed, and the calculation formula is as follows:
Where S{a,b} denotes the pixel area of the rectangular frame area image Ma or Mb,Representing the pixel value of the image Ma or Mb at the (i, j) position.
B. Correspondingly forming color histogram vectors with the same two dimensionsAndAnd calculating the similarity of two rectangular images by adopting a cosine similarity formula:
SimM=Va·Vb/(||Va||×||Vb||)
Where Va·Vb represents two vector point multiplies, the |va | and the |vb | represent the modes of the two vectors, respectively.
10 If Objectsi andThe matching degree between the targets in (a) meets the super-parameter threshold: Dist < threshdist、Diff<threshdiff、SimM>threshsim, ioU is used as a weight construction matrix, and if the super-parameter threshold is not met, the weight in the matrix is set to 0.
11 For the weight matrix, calculate Objectsi and using KM optimal bipartite matching algorithmFor the successfully matched targets, the i-1 frame is used for the corresponding relation between the targetsAssigning a corresponding object id to the object of Objectsi in the current i-th frame, adding 1 to the object parameter tracked _frames, setting 0 to patched_frames, for non-matching Objects in Objectsi, assigning a new id in object index array ListID, setting 1 to the object parameter tracked _frames, setting 0 to patched_frames, for non-matching Objects in ObjectsiAdding 1 to patched_frames, adding the three targets to the target listA list.
12 Emptying)List of pairs ofAnalyzing and judging the target in the list, if the patched_frames are larger than the maximum target predicted frame number Pn, removing the target from the list and recycling the id of the target to the target label queue ListID, and if the patched_frames are smaller than the maximum target predicted frame number Pn and the tracked _frames are larger than the minimum target tracking frame number Tn, removing the targetAnd add intoAndList if patched_frames are less than the maximum target predicted frame number Pn and tracked _frames are less than the minimum target tracking frame number Tn, then the target is addedAnd the list is used for subsequent target tracking calculation.
13 Pair of (a) to (b)Each object in the list is filtered by using a rectangular frame smoothing filter algorithm, so that the jitter of the rectangular frame is reduced, and the calculation steps are as follows:
a. the original positions of rectangular frames of targets marked j from the i-2 frame to the i frame are respectively marked Ri-2,j(xi-2,j,yi-2,j,wi-2,j,hi-2,j)、Ri-1,j(xi-1,j,yi-1,j,wi-1,j,hi-1,j)、Ri,j(xi,j,yi,j,wi,j,hi,j);, and the positions of rectangular frames after filtering from the i-3 frame to the i-1 frame are respectively marked R,i-3,j(x'i-3,j,y'i-3,j,w'i-3,j,h,i-3,j)、R,i-2,j(x'i-2,j,y'i-2,j,w'i-2,j,h,i-2,j)、R,i-1,j(x'i-1,j,y'i-1,j,w'i-1,j,h,i-1,j).
B. The four parameters of the rectangular frame are respectively filtered by a 2-order Butterworth low-pass filter, and the calculation formula is as follows:
wherein, (a1,a2,a3) and (b1,b2,b3) are butterworth low-pass filter parameters, and are calculated by setting sampling frequency and cut-off frequency.
C. Returning and saving the target rectangular frame filtering result R,i,j(x'i,j,y'i,j,w'i,j,w'i,j, and updatingIs included in the frame.
14 Will) beThe target tracking list is added into a buffer memory for tracking the next frame and is output to an intelligent driving decision module for decision making, and the current frame target tracking is completed.
15 Returning to step 3).
It is to be understood that the invention is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (9)

Translated fromChinese
1.一种融合视觉光流特征点追踪与运动趋势估计的多目标实时跟踪方法,其特征在于,包括:1. A multi-target real-time tracking method integrating visual optical flow feature point tracking and motion trend estimation, characterized by comprising:步骤10:通过图像采集设备实时获取当前第i帧的图像Mi,使用YOLO目标检测算法检测Mi中的目标,得到目标的矩形框位置,将第i帧每个目标加入第i帧的目标检测结果列表ObjectsiStep 10: Use the image acquisition device to acquire the imageMi of the current i-th frame in real time, use the YOLO target detection algorithm to detect the target inMi , obtain the rectangular box position of the target, and add each target in the i-th frame to the target detection result list Objectsi of the i-th frame;步骤20:如果第i帧为第一帧,对Objectsi中每个目标,配置新的ID,将目标第一参数tracked_frames设置为1,将目标第二参数patched_frames设置为0,将Objectsi赋值给当前第i帧的目标跟踪结果列表跳转至步骤70;如果第i帧不是第一帧,则继续执行步骤30;Step 20: If the i-th frame is the first frame, configure a new ID for each target in Objectsi , set the target's first parameter tracked_frames to 1, set the target's second parameter patched_frames to 0, and assign Objectsi to the target tracking result list of the current i-th frame Jump to step 70; if the i-th frame is not the first frame, continue to execute step 30;步骤30:对第i-1帧的目标跟踪结果列表的每个目标,使用矩形框运动趋势估计算法处理,得到目标在当前帧的运动状态预测位置列表使用矩形框区域图像光流特征点追踪算法处理,得到当前帧的目标光流预测位置列表Step 30: List of target tracking results for frame i-1 Each target is processed using the rectangular box motion trend estimation algorithm to obtain a list of target motion state prediction positions in the current frame. Use the rectangular frame area image optical flow feature point tracking algorithm to obtain the target optical flow prediction position list of the current frame步骤40:对比中ID相同目标j的矩形框位置,计算第一矩形框重叠度IoU1,根据第一重叠度预设阈值判断,如果目标跟踪成功,将该目标加入第i-1帧的目标在第i帧的位置跟踪预测结果列表并将该目标的patched_frames加1;如果目标跟踪失败,将该目标的tracked_frames设置为0;Step 40: Contrast and The position of the rectangular box of the target j with the same ID is calculated, and the first rectangular box overlap IoU1 is calculated. The threshold value is preset according to the first overlap Judge, if The target is tracked successfully and the target is added to the target position tracking prediction result list of the target in the i-1 frame in the i frame. And add 1 to the target's patched_frames; if If target tracking fails, the tracked_frames of the target is set to 0;步骤50:对Objectsi中的每个目标分别与中的每个目标计算匹配度,包括,第二重叠度匹配度IoU2,归一化中心点距离Dist,差异度Diff,所在图像区域相似度SimM,如果匹配度满足超参数阈值,则将IoU2作为这两个目标匹配度的权重,如果匹配度不满足超参数阈值,则将这两个目标匹配度对应的权重设置为0,基于此权重构建匹配度权重矩阵;Step 50: For each target in Objectsi, Calculate the matching degree for each target in, including the second overlap matching degree IoU2 , the normalized center point distance Dist, the difference degree Diff, and the image region similarity SimM. If the matching degree meets the hyperparameter threshold, then IoU2 is used as the weight of the matching degree of the two targets. If the matching degree does not meet the hyperparameter threshold, then the weights corresponding to the matching degrees of the two targets are set to 0, and a matching weight matrix is constructed based on this weight.步骤60:根据匹配度权重矩阵,使用KM最优匹配算法获得第i-1帧和第i帧各个目标之间的匹配关系,对于匹配成功的目标,将第i-1帧中目标的ID赋值给第i帧的匹配目标,tracked_frames加1,patched_frames设置为0;对于第i帧中未匹配的目标,分配新的ID,tracked_frames设置为1,patched_frames设置为0;对于第i-1帧中未匹配的目标,ID不变,patched_frames加1;各目标均加入列表;Step 60: According to the matching weight matrix, the KM optimal matching algorithm is used to obtain the matching relationship between the targets in the i-1 frame and the i-th frame. For the successfully matched targets, the ID of the target in the i-1 frame is assigned to the matching target in the i-th frame, tracked_frames is increased by 1, and patched_frames is set to 0; for the unmatched targets in the i-th frame, a new ID is assigned, tracked_frames is set to 1, and patched_frames is set to 0; for the unmatched targets in the i-1 frame, the ID remains unchanged and patched_frames is increased by 1; each target is added List;步骤70:对中的目标进行分析判断,如果patched_frames大于最大目标预测帧数Pn,则将该目标从中移除,回收其ID;如果patched_frames小于最大目标预测帧数Pn,且tracked_frames大于最小目标跟踪帧数Tn,则将该目标从中移除并加入列表;Step 70: Right Analyze and judge the target in the target, if patched_frames is greater than the maximum target prediction frame number Pn, then the target is removed from Remove it and recycle its ID; if patched_frames is less than the maximum target prediction frame number Pn, and tracked_frames is greater than the minimum target tracking frame number Tn, then the target is removed from Remove and add List;步骤80:对的每个目标,使用矩形框平滑滤波算法进行滤波,输出滤波后的结果,当前第i帧目标跟踪完成;并将中的目标加入缓存列表,用于下一帧跟踪;返回步骤10处理下一帧图像。Step 80: Right Each target is filtered using the rectangular frame smoothing filter algorithm and the filtered result is output. The target tracking of the current i-th frame is completed; The target in is added to the cache list for tracking in the next frame; and the process returns to step 10 to process the next frame image.2.根据权利要求1所述的融合视觉光流特征点追踪与运动趋势估计的多目标实时跟踪方法,其特征在于,所述目标的矩形框包括物体在图像中的矩形框区域左上角坐标(x,y)以及宽度w和高度h。2. The multi-target real-time tracking method integrating visual optical flow feature point tracking and motion trend estimation according to claim 1 is characterized in that the rectangular frame of the target includes the coordinates (x, y) of the upper left corner of the rectangular frame area of the object in the image as well as the width w and height h.3.根据权利要求2所述的融合视觉光流特征点追踪与运动趋势估计的多目标实时跟踪方法,其特征在于,矩形框运动趋势估计算法包括:对中目标j的矩形框位置使用卡尔曼滤波器进行跟踪预测,根据目标历史矩形框位置,预测当前帧目标的矩形框位置,计算得到目标j的运动状态预测位置并加入列表3. The multi-target real-time tracking method integrating visual optical flow feature point tracking and motion trend estimation according to claim 2 is characterized in that the rectangular frame motion trend estimation algorithm includes: The rectangular box position of target j in Use the Kalman filter for tracking prediction, predict the rectangular frame position of the target in the current frame based on the historical rectangular frame position of the target, and calculate the predicted motion state position of target j And add to the list矩形框区域图像光流特征点追踪算法包括:分别对Mi和Mi-1构建灰度图像金字塔,在中目标j的矩形框位置内均匀选取Mi-1中K个坐标点,使用基于灰度图像金字塔的LK光流点匹配算法计算该K个点在Mi中的位置,统计所有对应点在Mi和Mi-1之间的位置偏移量,取平均值作为目标j的光流追踪偏移量计算目标j的光流跟踪结果并加入列表The optical flow feature point tracking algorithm for rectangular frame area images includes: constructing grayscale image pyramids forMi and Mi-1 respectively, The rectangular box position of target j in Uniformly select K coordinate points in Mi-1 , use the LK optical flow point matching algorithm based on the grayscale image pyramid to calculate the position of the K points inMi , count the position offsets of all corresponding points betweenMi and Mi-1 , and take the average value as the optical flow tracking offset of target j Calculate the optical flow tracking results of target j for And add to the list4.根据权利要求3所述的融合视觉光流特征点追踪与运动趋势估计的多目标实时跟踪方法,其特征在于,对于矩形框Ra(xa,ya,wa,ha)和矩形框Rb(xb,yb,wb,hb),矩形框重叠度为:IoU=两个矩形框的交集面积/两个矩形框的并集面积;4. The method for real-time multi-target tracking integrating visual optical flow feature point tracking and motion trend estimation according to claim 3, wherein for a rectangular frameRa (xa ,ya ,wa ,ha ) and a rectangular frameRb (xb ,yb ,wb ,hb ), the rectangular frame overlap is: IoU = intersection area of the two rectangular frames / union area of the two rectangular frames;归一化中心点距离为:其中:分别为矩形框Ra和Rb的中心点坐标;Wm表示图像宽度,Hm表示图像高度;The normalized center point distance is: in: are the center coordinates of the rectangular framesRa andRb respectively;Wm represents the image width, andHm represents the image height;差异度为:Diff=abs(log(wa/wb))+abs(log(ha/hb)),wa,ha,wb,hb分别为矩形框Ra和Rb的宽度和高度;The difference is: Diff = abs(log(wa /wb )) + abs(log(ha /hb )), wherewa ,ha ,wb , andhb are the width and height of the rectangular boxesRa andRb , respectively;所在图像区域相似度SimM的计算包括:The calculation of the image region similarity SimM includes:对两个矩形框区域图像Ma和Mb的RGB通道进行分离,统计颜色直方图,并进行归一化处理得到其中,S{a,b}表示矩形框区域图像Ma或Mb的像素面积,表示图像Ma或Mb在(i,j)位置上的像素值;Separate the RGB channels of the two rectangular area imagesMa andMb , calculate the color histogram, and perform normalization to obtain Among them, S{a, b} represents the pixel area of the rectangular frame area imageMa orMb , Represents the pixel value of imageMa orMb at position (i, j);对于颜色直方图向量Va:和Vb:采用余弦相似性公式计算两个矩形框的所在图像区域相似度SimM=Va·Vb/(||Va||×||Vb||),其中Va·Vb表示两个向量点乘,||Va||和||Vb||分别表示两个向量的模。For the color histogram vector Va : and Vb : The cosine similarity formula is used to calculate the similarity of the image regions where the two rectangular boxes are located: SimM =Va ·Vb /(||Va ||×||Vb ||), whereVa ·Vb represents the dot product of two vectors, and ||Va || and ||Vb || represent the moduli of the two vectors respectively.5.根据权利要求4所述的融合视觉光流特征点追踪与运动趋势估计的多目标实时跟踪方法,其特征在于,匹配度满足超参数阈值包括:Dist<threshdist、Diff<threshdiff、SimM>threshsim,其中为第二重叠度预设阈值,threshdist为中心点距离预设阈值,threshdiff为差异度预设阈值,threshsim为相似度预设阈值。5. The multi-target real-time tracking method integrating visual optical flow feature point tracking and motion trend estimation according to claim 4, wherein the matching degree satisfies the hyperparameter threshold, including: Dist<threshdist , Diff<threshdiff , SimM>threshsim , where is the second overlap preset threshold, threshdist is the center point distance preset threshold, threshdiff is the difference preset threshold, and threshsim is the similarity preset threshold.6.根据权利要求5所述的融合视觉光流特征点追踪与运动趋势估计的多目标实时跟踪方法,其特征在于,矩形框平滑滤波算法为:6. The multi-target real-time tracking method integrating visual optical flow feature point tracking and motion trend estimation according to claim 5, wherein the rectangular frame smoothing filter algorithm is:将目标j从第i-2帧到第i帧矩形框位置分别记为Ri-2,j(xi-2,j,yi-2,j,wi-2,j,hi-2,j)、Ri-1,j(xi-1,j,yi-1,j,wi-1,j,hi-1,j)、Ri,j(xi,j,yi,j,wi,j,hi,j);从第i-3帧到第i-1帧滤波后的矩形框位置分别记为R’i-3,j(x’i-3,j,y’i-3,j,w’i-3,j,h’i-3,j)、R’i-2,j(x’i-2,j,y’i-2,j,w’i-2,j,h’i-2,j)、R’i-1,j(x’i-1,j,y’i-1,j,w’i-1,j,h’i-1,j);The rectangular box positions of target j from the i-2th frame to the i-th frame are denoted as Ri-2,j (xi-2,j ,yi-2,j ,wi-2,j ,hi-2,j ), Ri-1,j (xi-1,j ,yi-1,j ,wi-1,j ,hi-1,j ), and Ri,j (xi,j ,yi,j ,wi,j ,hi,j ); the rectangular box positions after filtering from the i-3th frame to the i-1th frame are denoted as R'i-3,j (x'i-3,j,y'i-3,j ,w'i-3,j ,h'i-3,j), R'i-2,j (x'i-2,j ,y'i-2,j ,w'i-2,j ,h'i-2,j), R'i-1,j (x'i-1,j,yi-1,j ,w'i-1,j ,h'i-1,j ).i-1,j ,y'i-1,j ,w'i-1,j ,h'i-1,j );对矩形框的四个参数分别用2阶巴特沃兹低通滤波器进行滤波为:The four parameters of the rectangular frame are filtered using a 2nd-order Butterworth low-pass filter:其中,(a1,a2,a3)和(b1,b2,b3)为巴特沃兹低通滤波器参数,通过设置采样频率和截止频率计算得到;Where (a1 ,a2 ,a3 ) and (b1 ,b2 ,b3 ) are the Butterworth low-pass filter parameters, which are calculated by setting the sampling frequency and cutoff frequency;获得目标矩形框滤波结果:R’i,j(x’i,j,y’i,j,w’i,j,w’i,j)。Get the target rectangular box filtering result: R'i,j (x'i,j ,y'i,j ,w'i,j ,w'i,j ).7.根据权利要求1-6任一项所述的融合视觉光流特征点追踪与运动趋势估计的多目标实时跟踪方法,其特征在于,所述图像采集设备安装在车辆上,感知区域覆盖车辆前方;所述目标包括:车辆、行人、非机动车。7. The multi-target real-time tracking method integrating visual optical flow feature point tracking and motion trend estimation according to any one of claims 1-6 is characterized in that the image acquisition device is installed on a vehicle and the sensing area covers the front of the vehicle; the targets include: vehicles, pedestrians, and non-motor vehicles.8.一种计算机设备,其特征在于,包括:8. A computer device, comprising:存储器,用于存储指令;以及处理器,用于调用所述存储器存储的指令执行如权利要求1-7中任一项所述的融合视觉光流特征点追踪与运动趋势估计的多目标实时跟踪方法。A memory for storing instructions; and a processor for calling the instructions stored in the memory to execute the multi-target real-time tracking method that integrates visual optical flow feature point tracking and motion trend estimation as described in any one of claims 1-7.9.一种计算机可读存储介质,其特征在于,存储有指令,所述指令被处理器执行时,执行如权利要求1-7中任一项所述的融合视觉光流特征点追踪与运动趋势估计的多目标实时跟踪方法。9. A computer-readable storage medium, characterized in that it stores instructions, which, when executed by a processor, execute the multi-target real-time tracking method that integrates visual optical flow feature point tracking and motion trend estimation according to any one of claims 1 to 7.
CN202310119716.2A2023-02-162023-02-16 A real-time multi-target tracking method integrating visual optical flow feature point tracking and motion trend estimationActiveCN115953437B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202310119716.2ACN115953437B (en)2023-02-162023-02-16 A real-time multi-target tracking method integrating visual optical flow feature point tracking and motion trend estimation

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202310119716.2ACN115953437B (en)2023-02-162023-02-16 A real-time multi-target tracking method integrating visual optical flow feature point tracking and motion trend estimation

Publications (2)

Publication NumberPublication Date
CN115953437A CN115953437A (en)2023-04-11
CN115953437Btrue CN115953437B (en)2025-08-22

Family

ID=87296883

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202310119716.2AActiveCN115953437B (en)2023-02-162023-02-16 A real-time multi-target tracking method integrating visual optical flow feature point tracking and motion trend estimation

Country Status (1)

CountryLink
CN (1)CN115953437B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN116385497B (en)*2023-05-292023-08-22成都与睿创新科技有限公司Custom target tracking method and system for body cavity
CN117761678B (en)*2024-02-222024-04-26成都鹰谷米特科技有限公司Complex environment target detection method and chip based on V frequency band
CN119515203B (en)*2025-01-062025-05-27宁德时代新能源科技股份有限公司 Battery transport detection method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103325108A (en)*2013-05-272013-09-25浙江大学Method for designing monocular vision odometer with light stream method and feature point matching method integrated
WO2021017291A1 (en)*2019-07-312021-02-04平安科技(深圳)有限公司Darkflow-deepsort-based multi-target tracking detection method, device, and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112489077B (en)*2019-09-122025-01-07浙江菜鸟供应链管理有限公司 Target tracking method, device and computer system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103325108A (en)*2013-05-272013-09-25浙江大学Method for designing monocular vision odometer with light stream method and feature point matching method integrated
WO2021017291A1 (en)*2019-07-312021-02-04平安科技(深圳)有限公司Darkflow-deepsort-based multi-target tracking detection method, device, and storage medium

Also Published As

Publication numberPublication date
CN115953437A (en)2023-04-11

Similar Documents

PublicationPublication DateTitle
CN115953437B (en) A real-time multi-target tracking method integrating visual optical flow feature point tracking and motion trend estimation
CN111178245B (en)Lane line detection method, lane line detection device, computer equipment and storage medium
CN102609953B (en)Many objects outward appearance of video camera and range-sensor data strengthens and merges
CN113723190A (en)Multi-target tracking method for synchronous moving target
CN109543641B (en)Multi-target duplicate removal method for real-time video, terminal equipment and storage medium
CN112947419B (en)Obstacle avoidance method, device and equipment
US20080181457A1 (en)Video based monitoring system and method
WO2019023921A1 (en)Gesture recognition method, apparatus, and device
CN107564034A (en)The pedestrian detection and tracking of multiple target in a kind of monitor video
CN108388879A (en)Mesh object detection method, device and storage medium
CN112001378B (en)Lane line processing method and device based on feature space, vehicle-mounted terminal and medium
CN111401196A (en)Method, computer device and computer readable storage medium for self-adaptive face clustering in limited space
CN103366155B (en)Temporal coherence in unobstructed pathways detection
CN115063454B (en)Multi-target tracking matching method, device, terminal and storage medium
CN112580565B (en) Lane detection method, device, computer equipment and storage medium
CN110348332A (en)The inhuman multiple target real-time track extracting method of machine under a kind of traffic video scene
JP7165353B2 (en) Image feature output device, image recognition device, image feature output program, and image recognition program
KR20180071947A (en)Apparatus and method for processing image
CN116567418A (en)Image processing method, movement detection system, electronic device, and storage medium
Vajak et al.A rethinking of real-time computer vision-based lane detection
KR101437228B1 (en)Obstacle detection device and method using boundary weighting
Chan et al.Partially occluded object detection by finding the visible features and parts
CN117314991A (en)Depth estimation method, device, computer equipment and storage medium
JP7548183B2 (en) MOVING OBJECT DETERMINATION DEVICE AND MOVING OBJECT DETERMINATION PROGRAM
US11989889B2 (en)Method for determining a relative movement using a digital image sequence

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp