Anti-occlusion target tracking method fusing Kalman filtering and particle filtering

By fusing Kalman filtering and particle filtering, the problem of insufficient accuracy and stability of the target tracking algorithm in occlusion scenarios is solved, and efficient target tracking in complex scenarios is achieved, which has important application value.

CN119399243APending Publication Date: 2025-02-07SHANDONG NEWCOWITEL ELECTRONIC CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411288977.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

Existing target tracking algorithms are difficult to maintain accuracy and stability in occlusion scenarios, which can easily lead to target loss.

Method used

The anti-occlusion target tracking method using a fusion Kalman filter and particle filtering is used to predict the target state through Kalman filtering, and the predicted value remains unchanged when the target is occluded. Combined with particle filtering particle diffusion and resampling, the occlusion situation is improved. Adaptability.

Benefits of technology

It significantly improves the robustness and accuracy of the target tracking algorithm in occlusion scenarios, avoids the loss of target tracking due to occlusion, reduces the system hardware cost, and makes the target tracking algorithm simpler and lighter.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399243A_ABST
    Figure CN119399243A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing and machine vision, in particular to an anti-occlusion target tracking method integrating Kalman filtering and particle filtering, which is low in cost, low in complexity, high in real-time performance and high in stability, and compared with the prior art, the robustness and the accuracy of a target tracking algorithm in an occlusion scene can be remarkably improved, and the target tracking method has the advantages of high robustness and high robustness. Target tracking loss caused by shielding is effectively avoided; according to the invention, the anti-shielding function is realized only depending on the algorithm, the hardware cost of the system is reduced, and the target tracking algorithm is simpler, more convenient and lighter in engineering application, so that the anti-shielding target tracking method provided by the invention has the characteristics of low cost, low complexity, strong real-time performance and high stability; the target can be continuously tracked in a complex scene, and the method has important application value and wide application prospect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of image processing and machine vision technology, and in particular to a low-cost, low-complexity, strong real-time and high-stability anti-occlusion target tracking method integrating Kalman filtering and particle filtering. Background Art

[0002] Object tracking is one of the core problems in the field of computer vision. Its main task is to select the object of interest in the initial frame of an image sequence or video stream, and continuously predict the size and position of the object in subsequent frames. It should be noted that the target category selected in the initial frame is arbitrary. This task faces many challenges, including changes in target size, changes in posture, occlusion, and complex background. In application areas that require rapid response to changing scenes, real-time performance and accuracy become key indicators of object tracking.

[0003] With the development of deep learning technology, target tracking algorithms based on deep learning twin networks have gradually become mainstream. The algorithm improves adaptability to complex scenes by learning the feature representation of the target. Compared with traditional methods, the twin network structure not only improves sample utilization and feature extraction capabilities, but also ensures accuracy and speed. However, target tracking still faces a series of challenges, such as occlusion, interference from similar objects, and jitter, so continuous research and innovation are needed to further improve the performance of the algorithm.

[0004] In target tracking, occlusion refers to the partial or complete obstruction of the target object by other objects or obstacles, resulting in partial or complete invisibility of the target in the video or image sequence. Occlusion may cause changes in the appearance of the target, such as part of the target may become invisible, the shape may change, and the color may be affected. If occlusion is not detected and handled in time, these changes will cause the tracking algorithm to fail. In addition, occlusion may also cause misjudgment of the target position because the target may move during the occlusion process. If occlusion is not taken into account, the tracking algorithm may misjudge the target position as the position of the occluder, resulting in tracking offset. When the target is completely occluded, the target tracking algorithm may not be able to correctly identify the target. Faced with the challenges brought by occlusion, the tracking algorithm needs to be adaptable to handle the situation where the target is partially or completely occluded, thereby improving the reliability of the tracking system in actual complex environments. Summary of the invention

[0005] In view of the shortcomings and deficiencies in the prior art, the present invention proposes a low-cost, low-complexity, strong real-time and high-stability anti-occlusion target tracking method that integrates Kalman filtering and particle filtering.

[0006] The present invention is achieved by the following measures:

[0007] A method for tracking an anti-occlusion target by integrating Kalman filtering and particle filtering, characterized in that it comprises the following steps:

[0008] Step S1: Initialization, select the tracked target in the k=1 frame I1 of the video stream or image sequence as a template, input it into the template branch of the twin network target tracker, and initialize the particle and Kalman filters;

[0009] Step S2: Calculate the tracking state and read the k-th frame image I k , input the search area into the search branch of the Siamese network target tracker, and calculate the tracking state s k ;

[0010] Step S3: Target tracker tracks, if s k =1, then the tracking state is judged to be normal, the prediction vector of the Kalman filter is calculated, the prediction result of the target tracker is used as the tracking result of this frame, the position and size of the particle are given by the tracking result, the tracking result is input into the search branch of the twin network tracker, and the step S2 is returned to calculate the s of the k+1th frame k+1 ;

[0011] Step S4: Kalman prediction, if s k = 0, at this time, the target is judged to be blocked, the acceleration prediction values ​​of the target center point in the x-direction and y-direction are kept unchanged, and the predicted values ​​of the aspect ratio and height of the target are kept unchanged, and the Kalman filter prediction vector is used as the tracking result of this frame;

[0012] Step S5: particle diffusion. To ensure that the direction of particle diffusion is consistent with the target's motion state, the mean of each particle's position and size is given by the prediction vector of Kalman prediction, and the variance conforms to the Gaussian distribution.

[0013] Step S6: Particle filtering, calculate the number of particles in image I after each diffusion. k The HSV histogram of the corresponding area in the image is obtained, and the Bhattacharyya distance between the HSV histogram template is calculated to measure the similarity between these particles and the template, and the particle weight is updated. After obtaining the optimal position estimate of the particle, resampling is performed;

[0014] Step S7: Repeat the iteration, repeat steps S4 to S6, and in each iteration process, the optimal position is estimated in image I k The corresponding area in is input into the search branch of the twin network target tracker to calculate s for the k+1th frame. k+1 , if s is satisfied k+1 =1, then return to step S2.

[0015] The initialization in step S1 of the present invention specifically includes the following steps:

[0016] Step S101: Let the total number of particles be N p , read image I at the kth frame k , image I k Each particle in contains the following properties:

[0017]

[0018] Among them, n p =1,2,...,N p , For nth p Particles in image I k The pixel coordinates in and The nth p Particles in image I k The aspect ratio of the corresponding area and high;

[0019] Step S102: Initialize the Kalman filter when the initial frame k=1, select the target to be tracked in the image I1, and use the selected target as a template. Define the 8-dimensional state space vector x of the target k for:

[0020]

[0021] Among them, x k and k are the pixel coordinates of the target center point in the kth frame in the x and y directions, respectively, k is the aspect ratio of the target, calculated as a k =w k / h k , w k and h k are the width and height of the target, respectively. and x k ,y k 、w k and h k The speed at the kth frame, Location and size information and Given by the initial target state x1, the speed and The value of is 0;

[0022] Step S103: Initialize N at the target center point when k=1 in the initial frame p particles, the size and position of each particle are the same as the size and position of the initial target box, and the weight of each particle is 1 / N p, In particular, the HSV histogram information of the initial target area is represented as γ1, which is the HSV histogram template.

[0023] The calculation tracking state described in step S2 of the present invention specifically includes the following steps:

[0024] Step S201: Introduce the average peak correlation energy APCE to assist in evaluating the current tracking status. Suppose that at the kth frame, the tracking algorithm outputs a score map of is the size of the output score map, then the calculation formula of APCE is:

[0025]

[0026] Among them, 1≤i,j≤os, is the highest score output by the tracking algorithm, is the minimum score output by the tracking algorithm, for The score at position (i, j) in the graph, mean(·) represents the mean operation;

[0027] Step S202: Set A k is the APCE value of the kth frame, is the score of the kth frame, is the historical average APCE value, is the historical average score, and defines the tracking quality s of the kth frame k The calculation method is

[0028]

[0029] Among them, α1 and α2 are parameters with values ​​between 0 and 1. If the APCE value or score of the prediction box of the current frame is lower than its historical average, the tracking quality s k = 0, the target may be in an obscured state. On the contrary, if the APCE value and score of the prediction box in the current frame are higher than their historical averages, the tracking quality is s. k =1, the target is in normal tracking state. This judgment condition comprehensively evaluates the target occlusion state by considering the two evaluation indicators of score and APCE to improve the accuracy of judgment.

[0030] The target tracker tracking in step S3 of the present invention specifically includes the following steps:

[0031] Step S301: If in the kth frame, s k=1, perform Kalman prediction and update, assuming that the target moves in a straight line at a constant speed in each time step in the picture. In the kth frame, the state space vector of the target is predicted by the state transfer matrix, as shown in the following formula:

[0032]

[0033] P k|k-1 =FP k-1|k-1 F T +Q

[0034] in, is the state transfer matrix, is the state filter update value of the previous moment, is the state prediction value at the current moment, P k-1|k-1 is the covariance matrix of the filtering error at the previous moment, P k|k-1 is the covariance matrix of the prediction error at the current moment, and Q is the covariance matrix of the noise;

[0035] Step S302: vector z k Given by the output of the tracking algorithm, when obtaining the measurement vector z k Then, calculate the Kalman gain matrix:

[0036] K k =P kk-1 H T (HP kk-1 H T +R) -1

[0037] Where H is the measurement matrix, H = [I4 O4], R is the covariance matrix of the measurement noise;

[0038] Step S303: Use the Kalman gain matrix to combine the predicted value with the observed value to obtain a filter update value, as shown in the following formula:

[0039]

[0040] P k|k =P k|k-1 -K k HP k|k-1

[0041] Step S304: The prediction result z of the tracking algorithm is k As a result of tracking, the position and size of each particle are given by z k Given, return to step S2.

[0042] The Kalman prediction in step S4 of the present invention specifically includes the following steps:

[0043] If in frame k, sk = 0, the target is judged to be blocked, and the prediction vector given by the Kalman filter is make

[0044]

[0045] That is, keep the predicted values ​​of the acceleration of the target center point in the x and y directions unchanged, and let

[0046]

[0047] That is, keep the aspect ratio and height prediction value of the target unchanged and change the filter prediction vector As a tracking result.

[0048] The particle diffusion in step S5 of the present invention specifically includes the following steps:

[0049] In order to ensure that the direction of particle diffusion is consistent with the target's motion state, the position and size information of each particle is

[0050]

[0051] in, and They obey Gaussian distribution and are independent of each other. and By prediction vector Given.

[0052] The particle filtering in step S6 of the present invention comprises the following steps:

[0053] Step S601: Calculate the particle size in image I k The corresponding area in

[0054]

[0055] in, is the HSV histogram information of the particle corresponding area, For nth p The weight information of each particle ranges from 0 to 1 and satisfies:

[0056]

[0057] Step S602: Set RGB image The corresponding HSV image is Divide the value range of H channel [0,180] into The value range of the S channel [0,256] is divided into For the (i,j)th interval, the normalized histogram calculation method is:

[0058]

[0059] in, is the i-th interval of the H channel, is the jth interval of the S channel, is the indicator function, which is defined as:

[0060]

[0061] Step S603: Calculate the number of particles in image I after diffusion k Corresponding area HSV histogram By calculation The Bhattacharyya distance with γ1 measures the similarity between the HSV histograms corresponding to these particles and the HSV histogram template. Here, the Bhattacharyya distance is a measure used to measure the similarity between two probability distributions. The calculation formula of Bhattacharyya distance with γ1 is:

[0062]

[0063] The value range of Bhattacharyya distance is [0, ∞). The smaller the value, the more similar the two are, and the larger the value, the less similar the two are.

[0064] Step S604: Based on the Bhattacharyya distance results calculated for each particle, the particle weights are updated and normalized. This allows particles with higher similarity to obtain higher weights. The calculation formula for particle weight update is:

[0065]

[0066] The particle weight normalization formula is:

[0067]

[0068] Step S605: Set N p The particles are sorted from large to small according to the normalized weights, and the particle with the largest weight is selected as the optimal position estimation particle. This particle represents the optimal estimate of the target position. The optimal estimate result is

[0069]

[0070] in, is the coordinate of the center point of the optimal estimation result, is the aspect ratio and height of the optimal estimation result;

[0071] Step S606: resample the particles, that is, delete the particles with too small weights and copy the particles with larger weights to ensure that the total number of particles remains N. p , which increases the chances that particles that meet the target characteristics will be retained.

[0072] The repeated iteration in step S7 of the present invention comprises the following steps: repeating steps S4 to S6, estimating the optimal position in each iteration process In the image I k The corresponding area in is input into the search branch of the twin network tracking algorithm to calculate s of the k+1th frame k+1 If s is satisfied k+1 =1, then return to step S2.

[0073] Compared with the prior art, the present invention can significantly improve the robustness and accuracy of the target tracking algorithm in occlusion scenarios, and effectively avoid the loss of target tracking due to occlusion; the present invention only relies on the algorithm to achieve the anti-occlusion function, which reduces the hardware cost of the system and makes the target tracking algorithm simpler and lighter in engineering applications. Therefore, the anti-occlusion target tracking method proposed in the present invention has the characteristics of low cost, low complexity, strong real-time performance, and high stability. It can maintain continuous tracking of the target in complex scenarios, and has important application value and broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION

[0075] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0076] In one embodiment, Figure 1 As shown, a method for anti-occlusion target tracking by integrating Kalman filtering and particle filtering is provided, and the method is applied to a terminal as an example for explanation, including the following steps:

[0077] Step S1: Initialization, in the k=1th frame I of the video stream or image sequence k Select the target to be tracked, use the target as a template, input it into the template branch of the twin network target tracker, and initialize the particle and Kalman filters;

[0078] Specifically, in this embodiment, step S1 specifically includes:

[0079] Step S101: Let the total number of particles be N p , read image I at the kth framek , image I k Each particle in contains the following properties:

[0080]

[0081] Among them, n p =1,2,...,N p , For nth p Particles in image I k The pixel coordinates in and The nth p Particles in image I k The aspect ratio of the corresponding area and high.

[0082] Step S102: Initialize the Kalman filter at the initial frame k=1. Select the target to be tracked in image I1 and use the selected target as a template. Define the target's 8-dimensional state space vector x k for

[0083]

[0084] Among them, x k and k are the pixel coordinates of the target center point in the kth frame in the x and y directions, respectively, k is the aspect ratio of the target, calculated as a k =w k / h k , w k and h k are the width and height of the target, respectively. and x k ,y k 、w k and h k The velocity at the kth frame. Location and size information and Given by the initial target state x1, the speed and The value of is 0.

[0085] Step S103: Initialize N at the target center point when k=1 in the initial frame p particles. The size and position of each particle are the same as the size and position of the initial target box, and the weight of each particle is 1 / N p In particular, the HSV histogram information of the initial target area is represented as γ1, which is the HSV histogram template.

[0086] Step S2: Calculate the tracking state. Read the k-th frame image I k , input the search area into the search branch of the Siamese network target tracker, and calculate the tracking state s k .

[0087] Specifically, in this embodiment, step S2 specifically includes:

[0088] Step S201: Introduce the average peak correlation energy APCE to assist in evaluating the current tracking status. Assume that in the kth frame, the tracking algorithm outputs a score map of is the size of the output score map, then the calculation formula of APCE is

[0089]

[0090] Among them, 1≤i,j≤os, is the highest score output by the tracking algorithm, is the minimum score output by the tracking algorithm, for The score at position (i, j) in , and mean(·) represents the mean operation.

[0091] Step S202: Set A k is the APCE value of the kth frame, is the score of the kth frame, is the historical average APCE value, is the historical average score. Define the tracking quality s of the kth frame k The calculation method is

[0092]

[0093] Among them, α1 and α2 are parameters with values ​​between 0 and 1. If the APCE value or score of the prediction box of the current frame is lower than its historical average, the tracking quality s k = 0, the target may be in an obscured state. On the contrary, if the APCE value and score of the prediction box in the current frame are higher than their historical averages, the tracking quality is s k =1, the target is in normal tracking state. This judgment condition comprehensively evaluates the target occlusion state by considering the two evaluation indicators of score and APCE to improve the accuracy of judgment.

[0094] Step S3: Target tracker tracking. If s k=1, the target tracking state is normal, the prediction vector of the Kalman filter is calculated, and the prediction result of the target tracker is used as the tracking result of this frame. The position and size of the particle are given by the tracking result. The tracking result is input into the search branch of the twin network tracker, and the calculation of s for the k+1th frame is returned to step S2. k+1 .

[0095] Specifically, in this embodiment, step S3 specifically includes:

[0096] Step S301: If in the kth frame, s k = 1, Kalman prediction and update are performed. Assume that the target moves in a straight line at a constant speed in each time step in the picture. In the kth frame, the state space vector of the target is predicted by the state transfer matrix, as shown in the following formula:

[0097]

[0098] P k|k-1 =FP k-1|k-1 F T +Q

[0099] in, is the state transfer matrix, is the state filter update value of the previous moment, is the state prediction value at the current moment, P k-1|k-1 is the covariance matrix of the filtering error at the previous moment, P k|k-1 is the covariance matrix of the prediction error at the current moment, and Q is the covariance matrix of the noise.

[0100] Step S302: vector z k Given by the output of the tracking algorithm. k Then, calculate the Kalman gain matrix:

[0101] K k =P kk-1 H T (HP kk-1 H T +R) -1

[0102] Where H is the measurement matrix, H = [I4 O4], and R is the covariance matrix of the measurement noise.

[0103] Step S303: Use the Kalman gain matrix to combine the predicted value with the observed value to obtain a filter update value, as shown in the following formula:

[0104]

[0105] P k|k =P k|k-1-K k HP k|k-1

[0106] Step S304: The prediction result z of the tracking algorithm is k As a result of tracking, the position and size of each particle are given by z k Return to step S2.

[0107] Step S4: Kalman prediction. If in the kth frame, s k = 0, the target is judged to be blocked, and the prediction vector given by the Kalman filter is make

[0108]

[0109] That is, keep the predicted values ​​of the acceleration of the target center point in the x and y directions unchanged, and let

[0110]

[0111] That is, keep the aspect ratio and height prediction value of the target unchanged and change the filter prediction vector As a tracking result.

[0112] Step S5: Particle diffusion. In order to ensure that the direction of particle diffusion is consistent with the target's motion state, the position and size information of each particle is

[0113]

[0114] in, and They obey Gaussian distribution and are independent of each other. and By prediction vector Given.

[0115] Step S6: Particle filtering. For each diffused particle, calculate its k The HSV histogram of the corresponding area in the image is obtained, and the Bhattacharyya distance between it and the HSV histogram template is calculated to measure the similarity between these particles and the template. The particle weights are updated to obtain the optimal position estimate of the particles. Finally, resampling is performed.

[0116] Specifically, in this embodiment, step S6 specifically includes:

[0117] Step S601: Calculate the particle size in image I k The corresponding area in

[0118]

[0119] in, is the HSV histogram information of the particle corresponding area, For nth p The weight information of each particle ranges from 0 to 1 and satisfies

[0120]

[0121] Step S602: Set RGB image The corresponding HSV image is Divide the value range of H channel [0,180] into The value range of the S channel [0,256] is divided into For the (i,j)th interval, the normalized histogram calculation method is:

[0122]

[0123] in, is the i-th interval of the H channel, is the jth interval of the S channel, is the indicator function, which is defined as

[0124]

[0125] Step S603: Calculate the number of particles in image I after diffusion k Corresponding area HSV histogram By calculation The Bhattacharyya distance with γ1 measures the similarity between the HSV histograms corresponding to these particles and the HSV histogram template.

[0126] Bhattacharyya distance is a measure of the similarity between two probability distributions. The calculation formula of Bhattacharyya distance with γ1 is:

[0127]

[0128] The value range of Bhattacharyya distance is [0, ∞). The smaller the value, the more similar the two are, and the larger the value, the less similar the two are.

[0129] Step S604: Update and normalize the particle weights based on the Bhattacharyya distance results calculated for each particle. This allows particles with higher similarity to obtain higher weights. The calculation formula for particle weight update is:

[0130]

[0131] The particle weight normalization formula is:

[0132]

[0133] Step S605: Set N p The particles are sorted from large to small according to the normalized weights, and the particle with the largest weight is selected as the optimal position estimation particle, which represents the optimal estimate of the target position. The optimal estimation result is

[0134]

[0135] in, is the coordinate of the center point of the optimal estimation result, is the aspect ratio and height of the optimal estimation result.

[0136] Step S606: resample the particles, that is, delete the particles with too small weights and copy the particles with larger weights to ensure that the total number of particles remains N. p Doing so increases the chances that particles that match the target characteristics will be retained.

[0137] Step S7: Repeat the iteration. Repeat steps S4 to S6, and in each iteration, the optimal position estimate In the image I k The corresponding area in is input into the search branch of the twin network target tracker to calculate s for the k+1th frame. k+1 If s is satisfied k+1 =1, then return to step S2.

[0138] The anti-occlusion target tracking method that integrates Kalman filtering and particle filtering proposed in this example has been shown through a large number of verifications and tests that, when combined with the existing target tracking algorithm, it can significantly improve the robustness and accuracy of the target tracking algorithm in occlusion scenarios, and effectively avoid the loss of target tracking due to occlusion. This method only relies on the algorithm to implement the anti-occlusion function, which reduces the hardware cost of the system and makes the target tracking algorithm simpler and lighter in engineering applications. Therefore, the anti-occlusion target tracking method proposed in the present invention has the characteristics of low cost, low complexity, strong real-time performance, and high stability. It can maintain continuous tracking of the target in complex scenarios and has important application value and broad application prospects.

Claims

1. A method for tracking an anti-occlusion target by integrating Kalman filtering and particle filtering, characterized in that: The following steps are involved: Step S1: Initialization, select the tracked target in the k=1 frame I1 of the video stream or image sequence as a template, input it into the template branch of the twin network target tracker, and initialize the particle and Kalman filters; Step S2: Calculate the tracking state and read the k-th frame image I k , input the search area into the search branch of the Siamese network target tracker, and calculate the tracking state s k ; Step S3: Target tracker tracks, if s k =1, then the tracking state is judged to be normal, the prediction vector of the Kalman filter is calculated, the prediction result of the target tracker is used as the tracking result of this frame, the position and size of the particle are given by the tracking result, the tracking result is input into the search branch of the twin network tracker, and the step S2 is returned to calculate the s of the k+1th frame k+1 ; Step S4: Kalman prediction, if s k = 0, at this time, the target is judged to be blocked, the acceleration prediction values ​​of the target center point in the x-direction and y-direction are kept unchanged, and the predicted values ​​of the aspect ratio and height of the target are kept unchanged, and the Kalman filter prediction vector is used as the tracking result of this frame; Step S5: particle diffusion. To ensure that the direction of particle diffusion is consistent with the target's motion state, the mean of each particle's position and size is given by the prediction vector of Kalman prediction, and the variance conforms to the Gaussian distribution. Step S6: Particle filtering, calculate the number of particles in image I after each diffusion. k The HSV histogram of the corresponding area in the image is obtained, and the Bhattacharyya distance between the HSV histogram template is calculated to measure the similarity between these particles and the template, and the particle weight is updated. After obtaining the optimal position estimate of the particle, resampling is performed; Step S7: Repeat the iteration, repeat steps S4 to S6, and in each iteration process, the optimal position is estimated in image I k The corresponding area in is input into the search branch of the twin network target tracker to calculate s for the k+1th frame. k+1 , if s is satisfied k+1 =1, then return to step S2.

2. The anti-occlusion target tracking method integrating Kalman filtering and particle filtering according to claim 1, characterized in that: The initialization in step S1 specifically includes the following steps: Step S101: Let the total number of particles be N p , read image I at the kth frame k , image I k Each particle in contains the following properties: in, For nth p Particles in image I k The pixel coordinates in and The nth p Particles in image I k The aspect ratio of the corresponding area and high; Step S102: Initialize the Kalman filter when the initial frame k=1, select the target to be tracked in the image I1, and use the selected target as a template. Define the 8-dimensional state space vector x of the target k for: Among them, x k and k are the pixel coordinates of the target center point in the kth frame in the x and y directions, respectively, k is the aspect ratio of the target, calculated as a k =w k / h k , w k and h k are the width and height of the target, respectively. and x k ,y k 、w k and h k The speed at the kth frame, Location and size information and Given by the initial target state x1, the speed and The value of is 0; Step S103: Initialize N at the target center point when k=1 in the initial frame p particles, the size and position of each particle are the same as the size and position of the initial target box, and the weight of each particle is 1 / N p , In particular, the HSV histogram information of the initial target area is represented as γ1, which is the HSV histogram template.

3. The anti-occlusion target tracking method integrating Kalman filtering and particle filtering according to claim 1, characterized in that: The calculation of the tracking state described in step S2 specifically includes the following steps: Step S201: Introduce the average peak correlation energy APCE to assist in evaluating the current tracking status. Suppose that at the kth frame, the tracking algorithm outputs a score map of is the size of the output score map, then the calculation formula of APCE is: Among them, 1≤i,j≤os, is the highest score output by the tracking algorithm, is the minimum score output by the tracking algorithm, for The score at position (i, j) in the graph, mean(·) represents the mean operation; Step S202: Set A k is the APCE value of the kth frame, is the score of the kth frame, is the historical average APCE value, is the historical average score, and defines the tracking quality s of the kth frame k The calculation method is Among them, α1 and α2 are parameters with values ​​between 0 and 1. If the APCE value or score of the prediction box of the current frame is lower than its historical average, the tracking quality s k = 0, the target may be in an obscured state. On the contrary, if the APCE value and score of the prediction box in the current frame are higher than their historical averages, the tracking quality is s. k =1, the target is in normal tracking state. This judgment condition comprehensively evaluates the target occlusion state by considering the two evaluation indicators of score and APCE to improve the accuracy of judgment.

4. The anti-occlusion target tracking method integrating Kalman filtering and particle filtering according to claim 1, characterized in that: The target tracker tracking in step S3 specifically includes the following steps: Step S301: If in the kth frame, s k =1, perform Kalman prediction and update, assuming that the target moves in a straight line at a constant speed in each time step in the picture. In the kth frame, the state space vector of the target is predicted by the state transfer matrix, as shown in the following formula: P k|k-1 =FP k-1|k-1 F T +Q in, is the state transfer matrix, is the state filter update value of the previous moment, is the state prediction value at the current moment, P k-1|k-1 is the covariance matrix of the filtering error at the previous moment, P k|k-1 is the covariance matrix of the prediction error at the current moment, and Q is the covariance matrix of the noise; Step S302: vector z k Given by the output of the tracking algorithm, when obtaining the measurement vector z k Then, calculate the Kalman gain matrix: K k =P kk-1 H T (HP kk-1 H T +R) -1 Where H is the measurement matrix, H = [I4 O4], R is the covariance matrix of the measurement noise; Step S303: Use the Kalman gain matrix to combine the predicted value with the observed value to obtain a filter update value, as shown in the following formula: P kk =P kk-1 -K k HP kk-1 Step S304: The prediction result z of the tracking algorithm is k As a result of tracking, the position and size of each particle are given by z k Given, return to step S2.

5. The anti-occlusion target tracking method integrating Kalman filtering and particle filtering according to claim 1, characterized in that: The Kalman prediction in step S4 specifically includes the following steps: If in frame k, s k = 0, the target is judged to be blocked, and the prediction vector given by the Kalman filter is make That is, keep the predicted values ​​of the acceleration of the target center point in the x and y directions unchanged, and let That is, keep the aspect ratio and height prediction value of the target unchanged and change the filter prediction vector As a tracking result.

6. The anti-occlusion target tracking method integrating Kalman filtering and particle filtering according to claim 1, characterized in that: The particle diffusion in step S5 specifically includes the following steps: In order to ensure that the direction of particle diffusion is consistent with the target's motion state, the position and size information of each particle is in, and They obey Gaussian distribution and are independent of each other. and By prediction vector Given.

7. The anti-occlusion target tracking method integrating Kalman filtering and particle filtering according to claim 1, characterized in that: The particle filtering in step S6 includes the following steps: Step S601: Calculate the particle size in image I k The corresponding area in in, is the HSV histogram information of the particle corresponding area, For nth p The weight information of each particle ranges from 0 to 1 and satisfies: Step S602: Set RGB image The corresponding HSV image is Divide the value range of H channel [0,180] into The value range of the S channel [0,256] is divided into For the (i,j)th interval, the normalized histogram calculation method is: in, is the i-th interval of the H channel, is the jth interval of the S channel, is the indicator function, which is defined as: Step S603: Calculate the number of particles in image I after diffusion k Corresponding area HSV histogram By calculation The Bhattacharyya distance with γ1 measures the similarity between the HSV histograms corresponding to these particles and the HSV histogram template. Here, the Bhattacharyya distance is a measure used to measure the similarity between two probability distributions. The calculation formula of Bhattacharyya distance with γ1 is: The value range of Bhattacharyya distance is [0, ∞). The smaller the value, the more similar the two are, and the larger the value, the less similar the two are. Step S604: Based on the Bhattacharyya distance results calculated for each particle, the particle weights are updated and normalized. This allows particles with higher similarity to obtain higher weights. The calculation formula for particle weight update is: The particle weight normalization formula is: Step S605: Set N p The particles are sorted from large to small according to the normalized weights, and the particle with the largest weight is selected as the optimal position estimation particle. This particle represents the optimal estimate of the target position. The optimal estimate result is in, is the coordinate of the center point of the optimal estimation result, is the aspect ratio and height of the optimal estimation result; Step S606: resample the particles, that is, delete the particles with too small weights and copy the particles with larger weights to ensure that the total number of particles remains N. p , which increases the chances that particles that meet the target characteristics will be retained.

8. The anti-occlusion target tracking method integrating Kalman filtering and particle filtering according to claim 1, characterized in that: The repeated iteration in step S7 includes the following steps: repeating steps S4 to S6, and in each iteration process, estimating the optimal position In the image I k The corresponding area in is input into the search branch of the twin network tracking algorithm to calculate s of the k+1th frame k+1 If s is satisfied k+1 =1, then return to step S2.

Citation Information

Cited By

  • Multi-modal interaction and image processing method of AI glasses, electronic equipment and storage medium

    CN119785165A

  • Multimodal Interaction and Image Processing Methods, Electronic Devices, and Storage Media for AI Glasses

    CN119785165B