Target tracking method, system, device and storage medium
11821986 · 2023-11-21
Assignee
Inventors
Cpc classification
G06F18/21345
PHYSICS
G06F17/147
PHYSICS
G06N3/0985
PHYSICS
International classification
G01S17/66
PHYSICS
G01S17/00
PHYSICS
G06F17/14
PHYSICS
G06F18/2134
PHYSICS
G06N3/0985
PHYSICS
Abstract
The present invention provides a target tracking method, system, device and storage medium, which includes: Determining a target area based on the current frame of a training sample, extracting and fusing histogram of oriented gradient (HOG), color naming (CN), and color space HSV features of the target area to obtain a target template; Determining a target function according to the target template and a spatial regularization weight factor; Introducing the Sherman-Morrison formula into the alternating direction method of multipliers (ADMM) to accelerate the solution of the target function and obtain the response value; Iterating the target tracking model when the response value meets the preset confidence threshold until training is completed to obtain a trained target tracking model, and tracking the target in the video to be observed by using the trained target tracking model.
Claims
1. A target tracking method, the method comprises: determining a target area based on a current frame of a training sample in a video, extracting and fusing histogram of oriented gradient (HOG), color naming (CN), and color space HSV features of the target area to obtain a target template; determining a target function according to the target template and a spatial regularization weight factor; introducing the Sherman-Morrison formula into an alternating direction method of multipliers (ADMM) to accelerate solving the target function and obtain a response value; iterating the target tracking model until the response value meets a preset confidence threshold to complete training to obtain a trained target tracking model, and tracking the target in the video to be observed by using the trained target tracking model; wherein the steps of introducing the Sherman-Morrison formula into the alternating direction method of multipliers (ADMM) to accelerate solving the target function and obtain the response value comprises: constructing an auxiliary variable and substituting the auxiliary variable into a loss function of a filter to obtain a converted loss function, wherein, the auxiliary variable is substituted into the loss function of the filter to obtain the converted loss function as: =[
.sub.1.sup.T, . . . ,
.sub.K.sup.T].sup.T is the Lagrangian vector in the Fourier domain of size dt×1, {circumflex over ( )} represents the Fourier transform of the variable, ω is the trained filter coefficient, β is the auxiliary variable, θ is the weight factor, the discrete Fourier transform of a one-dimensional signal a is represented as â=√{square root over (t)}Fa, wherein, F is the orthogonal Fourer transform matrix of size t×t, ŷ=[ŷ(1), ŷ(2), . . . , ŷ(t)], {circumflex over (X)}=[diag({circumflex over (x)}.sub.1).sup.T, . . . , diag({circumflex over (x)}.sub.d).sup.T], in size t×dt, wherein the steps of introducing Sherman-Morrison formula into the alternating direction method of multipliers (ADMM) to accelerate solving the Lagrange function comprises: using the alternating direction method of multipliers (ADMM) to decompose the augmented Lagrange function into multiple subproblems; wherein the alternating direction method of multipliers (ADMM) is used to decompose the augmented Lagrange function into multiple subproblems:
=[
.sub.1.sup.T, . . . ,
.sub.K.sup.T].sup.T is the Lagrangian vector in the Fourier domain of size dt×1, {circumflex over ( )} represents the Fourier transform of the variable, ω is the trained filter coefficient, β is the auxiliary variable, θ is the weight factor, the discrete Fourier transform of a one-dimensional signal a is represented as â=√{square root over (t)}Fa, wherein, F is the orthogonal Fourer transform matrix of size t×t, ŷ=[ŷ(1), ŷ(2), . . . , ŷ(t)], {circumflex over (X)}=[diag({circumflex over (x)}.sub.1).sup.T, . . . , diag({circumflex over (x)}.sub.d).sup.T], in size t×dt, which is a matrix composed of multi-channel cyclic samples, {circumflex over (β)}=[{circumflex over (β)}.sub.1.sup.T, . . . , {circumflex over (β)}.sub.d.sup.T], in size dt×1; sample {circumflex over (X)} is a banded sparse matrix, so each element in ŷ(s)=[ŷ(1), ŷ(2), . . . , ŷ(t)] is only related to k in {circumflex over (x)}(s)=[{circumflex over (x)}.sub.1(t), . . . , {circumflex over (x)}.sub.k(t)].sup.T and {circumflex over (β)}(s)=[conj({circumflex over (β)}.sub.1(t)), . . . , conj({circumflex over (β)}.sub.k(t))].sup.T, operator conj applies complex conjugate to complex vectors; therefore, {circumflex over (β)} in the above equation can be equivalent to t independent small targets {circumflex over (β)}(s),s=[1, . . . , t]; decomposing each subproblem into preset multiple independent small targets based on the banded sparse matrix of the samples, wherein, each subproblem is decomposed into preset independent small targets based on the banded sparse matrix of samples:
(s)={circumflex over (x)}(s).sup.T{circumflex over (x)}, Ŝ
.sub.(s)={circumflex over (x)}(s).sup.T
,
(s)={circumflex over (x)}(s).sup.T{circumflex over (ω)}, b=
(s)+μt.
2. The target tracking method of claim 1, wherein determining the target function according to the target template and spatial regularization weight factor comprises: the loss function after introducing weight factor θ is:
θ(m,n)=θ.sub.base+θ.sub.shift(m,n) where, m and n represents the offset of cyclic samples, θ.sub.base represents the basic weight of spatial regularization as a constant, and θ.sub.shift represents the regularization weight offset of training samples; θ.sub.shift is defined as:
3. The target tracking method of claim 1, wherein the steps of scale adaptation comprises: constructing a scale pool based on the size of the template for the current frame in the training sample; performing sliding sampling on the next frame image in the training sample based on different scales in the scale pool to obtain samples of different scales; calculating the response values of samples at each scale based on the preset scale filter to obtain the samples at the scale with the highest response value; the sample with the largest scale of the response value is adjusted to the same dimension as the template of the current frame by the bilinear interpolation to obtain the candidate region of the image of the next frame in the training sample.
4. The target tracking method of claim 1, wherein the steps of iterating a target tracking model when the response value meets a preset confidence threshold comprises: obtaining the correlation peak mean difference ratio (CPMDR) based on the distribution map corresponding to the response values; obtaining a model update rate based on the correlation peak mean difference ratio (CPMDR), and updating the target model based on the model update rate.
5. A target tracking system, comprising: a construction template circuit determining a target area based on a current frame of a training sample in a video, extracting and fusing histogram of oriented gradient (HOG), color naming (CN), and color space HSV features of the target area to obtain a target template; a target function circuit determining a target function according to the target template and a spatial regularization weight factor; a model training circuit introducing the Sherman-Morrison formula into an alternating direction method of multipliers (ADMM) to accelerate solving the target function and obtain a response value; a target tracking circuit iterating the target tracking model until the response value meets a preset confidence threshold to complete training to obtain a trained target tracking model, and tracking the target in the video to be observed by using the trained target tracking model; wherein the steps of introducing the Sherman-Morrison formula into the alternating direction method of multipliers (ADMM) to accelerate solving the target function and obtain the response value include: constructing an auxiliary variable and substituting the auxiliary variable into a loss function of a filter to obtain a converted loss function, wherein, the auxiliary variable is substituted into the loss function of the filter to obtain the converted loss function as: =[
.sub.1.sup.T, . . . ,
.sub.K.sup.T].sup.T is the Lagrangian vector in the Fourier domain of size dt×1, {circumflex over ( )} represents the Fourier transform of the variable, ω is the trained filter coefficient, β is the auxiliary variable, θ is the weight factor, the discrete Fourier transform of a one-dimensional signal a is represented as â=√{square root over (t)}Fa, wherein, F is the orthogonal Fourer transform matrix of size t×t, ŷ=[ŷ(1), ŷ(2), . . . , ŷ(t)], {circumflex over (X)}=[diag({circumflex over (x)}.sub.1).sup.T, . . . , diag({circumflex over (x)}.sub.d).sup.T], in size t×dt, wherein the steps of introducing Sherman-Morrison formula into the alternating direction method of multipliers (ADMM) to accelerate solving the Lagrange function comprises: using the alternating direction method of multipliers (ADMM) to decompose the augmented Lagrange function into multiple subproblems; wherein the alternating direction method of multipliers (ADMM) is used to decompose the augmented Lagrange function into multiple subproblems:
=[
.sub.1.sup.T, . . . ,
.sub.K.sup.T].sup.T is the Lagrangian vector in the Fourier domain of size dt×1, {circumflex over ( )} represents the Fourier transform of the variable, ω is the trained filter coefficient, β is the auxiliary variable, θ is the weight factor, the discrete Fourier transform of a one-dimensional signal a is represented as â=√{square root over (t)}Fa, wherein, F is the orthogonal Fourer transform matrix of size t×t, ŷ=[ŷ(1), ŷ(2), . . . , ŷ(t)], {circumflex over (X)}=[diag({circumflex over (x)}.sub.1).sup.T, . . . , diag({circumflex over (x)}.sub.d).sup.T], in size t×dt, which is a matrix composed of multi-channel cyclic samples, {circumflex over (β)}=[{circumflex over (β)}.sub.1.sup.T, . . . , {circumflex over (β)}.sub.d.sup.T], in size dt×1; sample {circumflex over (X)} is a banded sparse matrix, so each element in ŷ=[ŷ(1), ŷ(2), . . . , ŷ(t)], {circumflex over (X)}=[diag({circumflex over (x)}.sub.1).sup.T, . . . , diag({circumflex over (x)}.sub.d).sup.T] and {circumflex over (β)}=[conj({circumflex over (β)}.sub.1(t)), . . . , conj({circumflex over (β)}.sub.k(t))].sup.T, and operator conj applies complex conjugate to complex vectors; therefore, {circumflex over (β)} in the above equation can be equivalent to t independent small targets {circumflex over (β)}(s),s=[1, . . . , t]; decomposing each subproblem into preset multiple independent small targets based on the banded sparse matrix of the samples, wherein, each subproblem is decomposed into preset independent small targets based on the banded sparse matrix of samples:
(s)={circumflex over (x)}(s).sup.T{circumflex over (x)}, Ŝ
.sub.(s)={circumflex over (x)}(s).sup.T
,
(s)={circumflex over (x)}(s).sup.T{circumflex over (ω)}, b=
(s)+μt.
6. An electronic device, comprising a memory and a processor, which are used to execute computer management programs stored in the memory and implement on the processor the steps of a target tracking method as claimed in claim 1.
7. A non-transitory computer-readable storage medium with a computer management program is stored on the non-transitory computer-readable storage medium, and the step of implementing the target tracking method as claimed in claim 1 when the computer management program is executed by a processor.
Description
BRIEF DESCRIPTION OF DRAWINGS
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
DETAILED DESCRIPTION OF THE EMBODIMENTS
(13) The following will provide a further detailed description of the specific embodiments of the present invention in conjunction with the accompanying drawings and embodiments. The following embodiments are used to illustrate the present invention, but are not intended to limit its scope.
(14)
(15) Step S100: Determining a target area based on the current frame of a training sample, extracting and fusing histogram of oriented gradient (HOG), color naming (CN), and color space HSV features of the target area to obtain a target template;
(16) It should be noted that the execution subject of the method in this embodiment may be a computer terminal device with data processing, network communication, and program running functions, such as a computer, tablet computer, etc; it may also be a server device with similar functions, or a cloud server with similar functions, which is not limited by this embodiment. For ease of understanding, this and the following embodiments will be illustrated with a server device as an example.
(17) It will also be appreciated that the above training sample may be a training sample using the OTB50 dataset, or a training sample using the OTB100 dataset, or a training sample using the data collected by itself according to the actual needs, which is not limited by this embodiment.
(18) It should be understood that the above histogram of oriented gradient (HOG) is a feature descriptor applied in the field of computer vision and image processing for target detection, and the above histogram of oriented gradient (HOG) technique is a statistical value used to calculate the orientation information of local image gradients. The HOG descriptor is computed on a grid-dense cell of uniform size, and an overlapping local contrast normalization technique is also used to improve performance.
(19) It will also be appreciated that the above process of feature fusion may be to fuse the above three features to obtain the corresponding 45-dimensional integrated features, as shown in
(20) Refer to
(21) Step S200: Determining a target function according to the target template and a spatial regularization weight factor;
(22) In specific implementation, in the existing KCF correlation filtering algorithm, the regularization factor is a constant. During the training process, the regularization factor treats the samples in the background area as the same as the samples in the target area. However, in actual tracking, the target area is more weighted than the background area. Therefore, the regularization weight of the samples in the target area should be less than the regularization weight of the background part. For this reason, we introduce the spatial regularization weight factor and construct the spatial regularization correlation filter to weaken the interference of the background area and improve the classification ability of the classifier in the cluttered background. At the same time, we can also use this feature to expand the search area and solve the problem of target loss due to rapid movement.
(23) Step S300: Introducing the Sherman-Morrison formula into the alternating direction method of multipliers (ADMM) to accelerate the solution of the target function and obtain the response value;
(24) In the specific implementation, after determining the target function, it is necessary to solve the filter coefficients, which is the core problem in related filtering algorithms. With the continuous research and improvement of related filter trackers, algorithms such as CFLB and BACF have introduced spatial constraints in the training of filters to handle boundary effects, it makes the filter model more complex and the calculation speed slower, and the advantage of correlation filtering algorithms in computational speed is becoming increasingly unclear, although the algorithm solves the problem of boundary effects. To solve this problem, we introduced the alternating direction method of multipliers (ADMM) to solve the relevant filters. ADMM divides a large optimization problem into multiple subproblems that can be solved simultaneously in a distributed manner, and the approximate solution of the filter can be obtained quickly by iterating over the subproblems, thus greatly improving the computational efficiency.
(25) Step S400: Iterating the target tracking model when the response value meets the preset confidence threshold until training is completed to obtain a trained target tracking model, and tracking the target in the video to be observed by using the trained target tracking model.
(26) It should be noted that the preset confidence threshold mentioned above may be set by the administrator based on experience or updated after confirming experimental results, which is not limited by this embodiment. Satisfying the preset confidence level above can mean that the model is updated only when the part of the target frame in the current frame has a high confidence level (the target is not obscured or blurred).
(27) In the specific implementation, when the response value meets the preset confidence threshold, the target tracking model is iteratively updated based on the current frame until the trained target tracking model is obtained after the target tracking is completed, and the above target tracking model is used to track the targets in the observed video.
(28) It will be appreciated that, based on the shortcomings in the background art, the embodiment of the present invention proposes a target tracking method. The steps of the method include determining a target area based on the current frame of a training sample, extracting and fusing histogram of oriented gradient (HOG), color naming (CN), and color space HSV features of the target area to obtain a target template; determining a target function based on the target template and a spatial regularization weight factor; introducing the Sherman-Morrison formula into the alternating direction method of multipliers (ADMM) to accelerate the solution of the target function and obtain the response value; iterating the target tracking model when the response value meets the preset confidence threshold until training is completed to obtain a trained target tracking model, and tracking the target in the video to be observed by using the trained target tracking model. The present invention enhances the discriminability of feature response, improves the discrimination of targets, and enhances the stability of targets in deformation and light changes by extracting and fusing the features of histogram of oriented gradient (HOG), color naming (CN), and color space HSV in the target area, additionally, the present invention determines the target function through the spatial regularization based on the alternating direction method of multipliers (ADMM), so that while introducing the spatial regularization penalty boundary, the ADMM algorithm is used to reduce the iteration complexity, weaken the boundary effect, improve the operation efficiency of the algorithm, thus greatly improving the stability and tracking speed of the correlation filter tracking algorithm in target tracking.
(29) In one possible embodiment, the step of determining the target function according to the target template and spatial regularization weight factor includes: The loss function after introducing weight factor θ is:
(30)
(31) Where, ⊙ is the dot product operation, ψ.sub.t is the training error of the classifier at the t-th frame, t is the sequence number of the current frame, i is the sequence number of the history frame, x.sub.i is the input sample of the i-th frame, f(x.sub.i) is the response score after the input sample of the i-th frame, y.sub.i is the expected response of the sample of the i-th frame, ω is the trained filter coefficient, j is the number of channels of the filter, d is the dimension of the classifier, and the regularization weight is defined as:
θ(m,n)=θ.sub.base+θ.sub.shift(m,n);
(32) Where, m,n represents the offset of cyclic samples, θ.sub.base represents the basic weight of spatial regularization as a constant, and θ.sub.shift represents the regularization weight offset of training samples;
(33) θ.sub.shift is defined as:
(34)
(35) Where, m,n represents the offset of the cyclic sample, ρ.sub.width and ρ.sub.height represent the width and height of the search image, θ.sub.width and θ.sub.height represent the weight factors of the horizontal and vertical methods, respectively. The farther the training sample is from the target center, the greater the θ.sub.shift value is, that is, the greater the regularization weight of the background area and the smaller the weight of the target area.
(36) In the method of this embodiment, space regularization penalty boundary is introduced into the target tracking algorithm, and the corresponding regularization weight is set according to the position information of training samples and target space, thus the purpose of weakening the boundary effect is achieved.
(37) In one possible embodiment, the steps of introducing the Sherman-Morrison formula into the alternating direction method of multipliers (ADMM) to accelerate the solution of the target function and obtain the response value include: Step S301: Constructing auxiliary variable β and substituting the auxiliary variable β into the loss function of the filter to obtain the converted loss function; Step S302: Performing Fourier transform of the loss function to obtain the corresponding frequency domain formula; Step S303: Constructing an augmented Lagrange function based on the frequency domain formula, and introducing the Sherman-Morrison formula into the alternating direction method of multipliers (ADMM) to accelerate the solution of the Lagrange function and obtain the response value.
(38) In the method of this embodiment, the iteration complexity is reduced and the operation efficiency of the target tracking algorithm is improved by introducing the Sherman-Morrison formula to accelerate the solution of the target function in the solution process of the target tracking algorithm.
(39) In one possible embodiment, the steps of introducing Sherman-Morrison formula into the alternating direction method of multipliers (ADMM) to accelerate the solution of the Lagrange function include: Step S3031: Using the alternating direction method of multipliers (ADMM) to decompose the augmented Lagrange function into multiple subproblems; Step S3032: Decomposing each subproblem into preset multiple independent small targets based on the banded sparse matrix of the samples; Step S3033: Accelerating the solution of each independent small target according to the Sherman-Morrison formula.
(40) In the method of this embodiment, the iteration complexity is reduced and the operation efficiency of the target tracking algorithm is improved by introducing the Sherman-Morrison formula to accelerate the solution of the target function in the solution process of the target tracking algorithm.
(41) In one possible embodiment, the process of accelerated solution of spatial regularization based on ADMM can be:
(42) In the KCF correlation filtering algorithm, the classifier is trained with cyclic shift samples to obtain the optimal classifier under the minimum mean square error. The loss function in the training process is defined as
(43)
(44) Where, ψ.sub.t is the training error of the classifier at the t-th frame, t is the sequence number of the current frame, i is the sequence number of the history frame, x.sub.i is the input sample of the i-th frame, f (x.sub.i) is the response score after the input sample of the i-th frame, y.sub.i is the expected response of the sample of the i-th frame, ω is the trained filter coefficient, j is the number of channels of the filter, a.sub.i is the classifier learning weight factor for the i-th frame, d is the dimension of the classifier, λ is the regularization factor to prevent over-fitting, which is a constant.
(45) It can be seen from the above formula that the regularization factor λ is a constant. During the training process, it treats the samples in the background area as the same as the samples in the target area. However, in actual tracking, the target area is more weighted than the background area. Therefore, the regularization weight of the samples in the target area should be less than the regularization weight of the background part. For this reason, we introduce the spatial regularization weight factor θ and construct the spatial regularization correlation filter to weaken the interference of the background area and improve the classification ability of the classifier in the cluttered background. At the same time, we can also use this feature to expand the search area and solve the problem of target loss due to rapid movement.
(46) After introducing the weight factor θ, the original formula can be changed to
(47)
(48) Where, ⊙ is a dot product operation, and when θ=√{square root over (λ)}, equations (3-1) and (3-2) are the same. We define the regularization weight as
θ(m,n)=θ.sub.base+θ.sub.shift(m,n) (3-3)
(49) Where, m,n represents the offset of the cyclic sample, and θ.sub.base represents the basic weight of spatial regularization, which is a constant, θ.sub.shift represents the regularization weight offset of training samples, and θ.sub.shift is defined as
(50)
(51) Where, ρ.sub.width and ρ.sub.height represent the width and height of the search image, while θ.sub.width and θ.sub.height represent the weight factors in the horizontal and vertical directions, respectively. It can be seen from Formula (3-4) that the farther the training sample is from the target center, the greater the value of θ.sub.shift, that is, the greater the regularization weight of the background area, and the smaller the weight of the target area.
(52) The next main task, like the KCF tracker, is to solve the filter coefficient ω, which is the core problem in related filtering algorithms. With the continuous research and improvement of related filter trackers, algorithms such as CFLB and BACF have introduced spatial constraints in the training of filters to handle boundary effects, it makes the filter model more complex and the calculation speed slower, and the advantage of correlation filtering algorithms in computational speed is becoming increasingly unclear, although the algorithm solves the problem of boundary effects.
(53) To solve this problem, we introduced the alternating direction method of multipliers (ADMM) to solve the relevant filters. ADMM divides a large optimization problem into multiple subproblems that can be solved simultaneously in a distributed manner, and the approximate solution of the filter can be obtained quickly by iterating over the subproblems.
(54) The ADMM algorithm is typically used to solve minimization problems in the following forms:
(55)
(56) The augmented Lagrangian function for this problem is defined as
(57)
(58) The classic ADMM algorithm framework is as follows:
(59) Initialize y.sup.0, .sup.0, μ>0, and set k>0;
(60) The iteration steps are:.sup.k+1:=
.sup.k+μ(Ax.sup.k+1+By.sup.k+1−c) (3-7)
(61) If the termination condition is met, stop the iteration and output the result. Otherwise, return to continue the iteration.
(62) Therefore, we can transform equation (3-2) into the form of an augmented Lagrangian function. Since ADMM iteration requires two variables, we construct auxiliary variable β and let β=ω.
(63) Then Equation (3-2) is converted to
(64)
(65) Convert it to the frequency domain to obtain
(66)
(67) Where, {circumflex over ( )} represents the Fourier transform of the variable, the discrete Fourier transform of a one-dimensional signal a is represented as â=√{square root over (t)}Fa, wherein, F is the orthogonal Fourier transform matrix of size t×t, ŷ=[ŷ(1), ŷ(2), . . . , ŷ(t)], {circumflex over (X)}=[diag({circumflex over (x)}.sub.1).sup.T, . . . , diag({circumflex over (x)}.sub.d).sup.T], in size t×dt, which is a matrix composed of multi-channel cyclic samples, {circumflex over (β)}=[{circumflex over (β)}.sub.1.sup.T, . . . , {circumflex over (β)}.sub.d.sup.T], h=[h.sub.1.sup.T, . . . , h.sub.d.sup.T], in size dt×1.
(68) The augmented Lagrangian expression is:
(69)
(70) Where, μ is the penalty factor and =[
.sub.1.sup.T, . . . ,
.sub.K.sup.T].sup.T is the Lagrangian vector in the Fourier domain of size dt×1. We can iteratively solve the above equation using the ADMM algorithm according to formula (3-7), and each subproblem ω and {circumflex over (β)} have a closed form solution.
(71) For subproblem {circumflex over (β)}:
(72)
(73) The complexity of directly solving this equation is O(t.sup.3d.sup.3), because every ADMM iteration requires solving {circumflex over (β)}, which greatly affects the real-time performance of the algorithm. However, sample {circumflex over (X)} is a banded sparse matrix, so each element in ŷ(s)=[ŷ(1), ŷ(2), . . . , ŷ(t))].sup.T, is only related to k in {circumflex over (x)}(s)=[{circumflex over (x)}.sub.1(t), . . . , {circumflex over (x)}.sub.k(t)].sup.T and {circumflex over (β)}(s)=[conj({circumflex over (β)}.sub.1(t)), . . . , conj({circumflex over (β)}.sub.k(t))].sup.T, and operator conj applies complex conjugate to complex vectors. Therefore, {circumflex over (β)} in the above equation can be equivalent to t independent small targets {circumflex over (β)}(s), s=[1, . . . , t].
(74)
(75) Where, {circumflex over (ω)}(s)=[{circumflex over (ω)}.sub.1(s), . . . , {circumflex over (ω)}.sub.k(s)] and {circumflex over (ω)}.sub.k=√{square root over (t)}Fω.sub.k are solved as follows
(76)
(77) The computational complexity of formula (3-13) is O(td.sup.3). This process still needs to deal with t independent linear system of K×K. Here, because the variables on the denominator are all d-dimensional, we introduce the Sherman-Morrison formula ((uv.sup.T+A).sup.−1=A.sup.−1−(v.sup.TA.sup.−1u).sup.−1A.sup.−1uv.sup.TA.sup.−1) to accelerate the operation. We set A=μtI.sub.k and u=v={circumflex over (x)}(s). The original formula can be simplified as
(78)
(79) Where, Ŝ.sub.x(s)={circumflex over (x)}(s).sup.T{circumflex over (x)}, Ŝ(s)={circumflex over (x)}(s).sup.T
, Ŝ.sub.ω(s)={circumflex over (x)}(s).sup.T{circumflex over (ω)}, b=Ŝ.sub.x(s)+μt. At this point, the computational complexity of the formula decreases to O(td).
(80) Iterative update:.sup.k+1:=
.sup.k+μ({circumflex over (β)}.sup.k+1−{circumflex over (ω)}.sup.k+1) (3-16)
(81) Where {circumflex over (β)}.sup.k+1 and ω.sup.k+1 represent the current solution of the above subproblem by iterating step k+1 in ADMM. {circumflex over (ω)}.sup.k+1=√{square root over (t)}Fω.sup.k+1, μ.sup.k+1=min(μ.sub.max,αμ.sup.k).
(82) In this embodiment, the alternating direction method of multipliers (ADMM) and Sherman-Morrison formula are used to simplify the computational complexity and greatly improve the solving speed of target tracking algorithm.
(83) In one possible embodiment, the steps of scale adaptation also include: Step S001: Constructing a scale pool based on the size of the template for the current frame in the training sample; Step S002: Performing sliding sampling on the next frame image in the training sample based on different scales in the scale pool to obtain samples of different scales; Step S003: Calculating the response values of samples at each scale based on the preset scale filter to obtain the samples at the scale with the highest response value; Step S001: The sample with the largest scale of the response value is adjusted to the same dimension as the template of the current frame by the bilinear interpolation to obtain the candidate region of the image of the next frame in the training sample.
(84) Refer to
(85) Refer to
(86) In the implementation example of the present invention, by adding an adaptive scale pool to the target tracking algorithm, a scale pool containing 7 scale sizes is proposed, which enables the target tracking algorithm to adapt well to changes in scale. This solves the problem of the previous target scale being unable to adaptively adjust according to the target size, which affects tracking accuracy. During the target tracking process, when the target scale is reduced, it causes a large amount of background information to be included in the selected image block; when the target scale is expanded, it will cause the selected image block to only contain local information of the target, improving the adaptability of the target tracking algorithm.
(87) In one possible embodiment, the steps of iterating a target tracking model when the response value meets a preset confidence threshold include: Step S401: Obtaining the correlation peak mean difference ratio (CPMDR) based on the distribution map corresponding to the response values; Step S402: Obtaining a model update rate based on the correlation peak mean difference ratio (CPMDR), and updating the target model based on the model update rate.
(88) In the current existing target tracking algorithms, the model is almost updated every frame, without considering the accuracy of target detection. If the new tracking results are not accurate, the obtained results will still update the model, which will contaminate the model and cause target tracking drift. Therefore, the embodiment of the invention proposes to update the model only when the part in the target frame of the current frame has high confidence (the target is not occluded or blurred), so that the model update strategy based on high confidence can not only solve the problem of model contamination, improve the robustness of the tracking algorithm to occlusion and other problems, but also improve the tracking speed and prevent over-fitting.
(89) From a large number of experiments on KCF, it can be found that when accurately tracking, the response distribution graph of KCF has and only has a very obvious peak, and its overall distribution is approximately a two-dimensional Gaussian distribution. However, when complex situations occur during the tracking process (especially occlusion, loss, blurring, etc.), the response graph will experience severe oscillations. The peak and fluctuation of the response graph can reflect the confidence level of the tracking results to a certain extent. When the detected target matches the correct target very well, the ideal response graph should only have one peak, and other areas will tend to be smooth. The higher the correlation peak, the better the positioning accuracy. If the positioning is not accurate enough, the response graph will oscillate violently, and its shape will differ significantly from the shape when correctly matched. Based on this, we adopt a judgment formula, the correlation peak mean difference ratio (CPMDR):
(90)
(91) Where, f.sub.max represents the maximum value in the response graph, f.sub.min represents the minimum value in the response graph, f.sub.m,n represents the value at (m,n) in the response graph, and M, N represent the peak value.
(92) The correlation peak mean difference ratio (CPMDR) can reflect the fluctuation of the response graph. When it is less than a certain threshold, it can be determined that the target was lost, obstructed or left the field of view during the target tracking process. In traditional KCF tracking, a simple model update method is used:
{circumflex over (x)}.sub.model.sup.(f)=(1=η){circumflex over (x)}.sub.model.sup.(f-1)+η{circumflex over (x)}.sub.model.sup.(f);
(93) Where, η is the model update rate. According to this method, each frame of the classifier needs to be updated, and once the tracking fails, it cannot continue tracking. To solve this problem, we use an update strategy of a high confidence model with adaptive learning rate. To prevent model contamination, when the target area is obstructed, the target model should not be updated again. It can only be updated when the CPMDR value exceeds a certain threshold. We set the model update rate to be positively correlated with the CPMDR value. Let
(94)
If we set η.sub.1 to 0.02, the adaptive update model is:
(95)
(96) We use this updated model to calculate {circumflex over (β)}(s), Ŝ.sub.x(s), Ŝ(s) and Ŝ.sub.ω(s).
(97) According to experimental measurements, when the CPMDR value is greater than 50, it can be considered as accurate tracking, so we set the threshold to 0.0196.
(98) Referring to
(99) Refer to
(100) In the embodiment of the present invention, the use of correlation peak mean difference ratio (CPMDR) to determine the occlusion state achieves adaptive updating of the model, addresses the model pollution problem caused by target occlusion, and improves the stability of the algorithm.
(101)
(102) A construction template module 100, for determining a target area based on the current frame of a training sample, extracting and fusing histogram of oriented gradient (HOG), color naming (CN), and color space HSV features of the target area to obtain a target template; a target function module 200, for determining a target function based on the target template and a spatial regularization weight factor; a model training module 300, for introducing the Sherman-Morrison formula into the alternating direction method of multipliers (ADMM) to accelerate the solution of the target function and obtain the response value; and a target tracking module 400, for iterating the target tracking model when the response value meets the preset confidence threshold until training is completed to obtain a trained target tracking model, and tracking the target in the video to be observed by using the trained target tracking model.
(103) It will be appreciated that the target tracking system provided by the present invention corresponds to the target tracking methods provided in the aforementioned embodiments. The relevant technical features of the target tracking system can refer to the relevant technical features of the target tracking method, and will not be repeated herein.
(104) Please refer to
(105) Determining a target area based on the current frame of a training sample, extracting and fusing histogram of oriented gradient (HOG), color naming (CN), and color space HSV features of the target area to obtain a target template; determining a target function based on the target template and a spatial regularization weight factor; introducing the Sherman-Morrison formula into the alternating direction method of multipliers (ADMM) to accelerate the solution of the target function and obtain the response value; iterating the target tracking model when the response value meets the preset confidence threshold until training is completed to obtain a trained target tracking model, and tracking the target in the video to be observed by using the trained target tracking model.
(106) Please refer to
(107) Determining a target area based on the current frame of a training sample, extracting and fusing histogram of oriented gradient (HOG), color naming (CN), and color space HSV features of the target area to obtain a target template; determining a target function based on the target template and a spatial regularization weight factor; introducing the Sherman-Morrison formula into the alternating direction method of multipliers (ADMM) to accelerate the solution of the target function and obtain the response value; iterating the target tracking model when the response value meets the preset confidence threshold until training is completed to obtain a trained target tracking model, and tracking the target in the video to be observed by using the trained target tracking model.
(108) The present invention provides a target tracking method, system, electronic device and storage medium, wherein the steps of the method include determining a target area based on the current frame of a training sample, extracting and fusing histogram of oriented gradient (HOG), color naming (CN), and color space HSV features of the target area to obtain a target template; determining a target function based on the target template and a spatial regularization weight factor; introducing the Sherman-Morrison formula into the alternating direction method of multipliers (ADMM) to accelerate the solution of the target function and obtain the response value; iterating the target tracking model when the response value meets the preset confidence threshold until training is completed to obtain a trained target tracking model, and tracking the target in the video to be observed by using the trained target tracking model. The present invention enhances the discriminability of feature response, improves the discrimination of targets, and enhances the stability of targets in deformation and light changes by extracting and fusing the features of histogram of oriented gradient (HOG), color naming (CN), and color space HSV in the target area, additionally, the present invention determines the target function through the spatial regularization based on the alternating direction method of multipliers (ADMM), so that while introducing the spatial regularization penalty boundary, the ADMM algorithm is used to reduce the iteration complexity, weaken the boundary effect, improve the operation efficiency of the algorithm, thus greatly improving the stability and tracking speed of the correlation filter tracking algorithm in target tracking.
(109) It should be noted that in the above embodiments, the descriptions of each embodiment have their own emphasis. For the parts that are not described in detail in one embodiment, please refer to the relevant descriptions of other embodiments.
(110) Those skilled in the art should understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention may be in the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may be in the form of a computer program product implemented on one or more computer available storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer available program code.
(111) The present invention is described with reference to the flowchart and/or block diagram of the method, device (system), and computer program product according to the embodiments of the present invention. It should be understood that each process and/or box in a flowchart and/or block diagram can be implemented by computer program instructions, as well as the combination of processes and/or boxes in the flowchart and/or block diagram. These computer program instructions can be provided to processors of general-purpose computers, specialized computers, embedded computers, or other programmable data processing devices to generate a machine that generates instructions executed by processors of computers or other programmable data processing devices for implementing functions specified in a flowchart or multiple flows and/or a block diagram or multiple boxes.
(112) These computer program instructions can also be stored in computer readable memory that can guide a computer or other programmable data processing device to work in a specific way, causing the instructions stored in the computer readable memory to generate a manufacturing product including instruction devices, which implement the functions specified in one or more processes and/or blocks of a flowchart.
(113) These computer program instructions can also be loaded onto a computer or other programmable data processing device to perform a series of operational steps on the computer or other programmable device to generate computer-implemented processing. The instructions executed on the computer or other programmable device provide steps for implementing the functions specified in a flowchart or multiple processes and/or a block diagram or multiple boxes.
(114) Although preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have knowledge of the basic creative concepts. Therefore, the attached claims are intended to be interpreted as including preferred embodiments and all changes and modifications falling within the scope of the present invention.
(115) Obviously, technicians in this field can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. In this way, if these modifications and variations of the present invention fall within the scope of the claims and their equivalents, the present invention is also intended to include these modifications and variations.