1 简介

Object tracking is a well studied fifield in computer vision. The goal is to use a sensor suchas a camera or depth sensor to track an object in environments which may include occlusionor low lighting. The state of the art algorithms in this fifield uses particle fifilters to maintainestimates of an objects location and speed. These algorithms take their cue from researchstarted in the 1980s.One early work which had a large impact was Ted Broida’s “Estimation of Object MotionParameters from Noisy Images.” His work was one of the fifirst to address the problem ofobject tracking using a stochastic method such as the Kalman Filter. His method utilized theIterative Extended Kalman Filter (IEKF) as a recursive estimation procedure to determinean object’s motion parameters over a sequence of noisy images.

【目标跟踪】基于迭代扩展卡尔曼滤波算法实现目标滤波跟踪(IEKF)附Matlab代码_无人机

【目标跟踪】基于迭代扩展卡尔曼滤波算法实现目标滤波跟踪(IEKF)附Matlab代码_图像处理_02

2 部分代码

% Script to start playing around with this stuff

clc; clear all; close all


% x  = [xc xcd zc zcd p1 p2 w].'


% simulation parameters

n = 100;                             % number of frames

xint = [-35 .7 35 .4 1 3 1].';       % initial state variable 

xest = [-32 .9 32 .6 1.2 2.2 .7].';  % initial state estimates

noise = .01;


% simulate dynamics

X = f_Simulate(xint,n);


% simulate observations

[OBS, OBSn] = f_Observe(X,noise);


% make movie

f_Movie(X,OBS,'SimMovie')


% run filter 

Xp = f_IEKF(OBSn,xest);


% make movie

OBSr = f_Observe(Xp,0);

f_Movie(Xp,OBSr,'ResultsMovie')


save RunData 


% pixel values

figure; 

pos = get(gcf,'Position');

set(gcf,'Position',[pos(1)-100 pos(2)-200 1.5*pos(3) 1.5*pos(4)]);

plot(1:n,OBSn,'.-',1:n,OBSr,'.-'); grid on;

legend('X1 simulated','X2 simulated','X1 predicted','X2 predicted','Location','Best')

xlabel('Frame index (n)','FontName','Time','FontSize',15); 

ylabel('Image pixel value','FontName','Time','FontSize',15); 

title('Pixel observations with noise',...

    'FontName','Time','FontSize',15,'FontWeight','Bold'); 


Error = X - Xp;


% error (xc and zc)

figure; 

pos = get(gcf,'Position');

set(gcf,'Position',[pos(1)-100 pos(2)-200 1.5*pos(3) 1.5*pos(4)]);

plot(1:n,Error([1 3],:),'.-'); grid on;

legend('xc','zc','Location','Best')

xlabel('Frame index (n)','FontName','Time','FontSize',15); 

ylabel('Error','FontName','Time','FontSize',15); 

title('Error in xc and zc',...

    'FontName','Time','FontSize',15,'FontWeight','Bold'); 


% error (xcd and zcd)

figure; 

pos = get(gcf,'Position');

set(gcf,'Position',[pos(1)-100 pos(2)-200 1.5*pos(3) 1.5*pos(4)]);

plot(1:n,Error([2 4],:),'.-'); grid on;

legend('xcd','zcd','Location','Best')

xlabel('Frame index (n)','FontName','Time','FontSize',15); 

ylabel('Error','FontName','Time','FontSize',15); 

title('Error in \dot{xc} and \dot{zc}',...

    'FontName','Time','FontSize',15,'FontWeight','Bold'); 


% error (p1 w)

figure; 

pos = get(gcf,'Position');

set(gcf,'Position',[pos(1)-100 pos(2)-200 1.5*pos(3) 1.5*pos(4)]);

plot(1:n,Error([5 7],:),'.-'); grid on;

legend('p1','w','Location','Best')

xlabel('Frame index (n)','FontName','Time','FontSize',15); 

ylabel('Error','FontName','Time','FontSize',15); 

title('Error in p1 and w',...

    'FontName','Time','FontSize',15,'FontWeight','Bold'); 

3 仿真结果

【目标跟踪】基于迭代扩展卡尔曼滤波算法实现目标滤波跟踪(IEKF)附Matlab代码_无人机_03

【目标跟踪】基于迭代扩展卡尔曼滤波算法实现目标滤波跟踪(IEKF)附Matlab代码_图像处理_04

【目标跟踪】基于迭代扩展卡尔曼滤波算法实现目标滤波跟踪(IEKF)附Matlab代码_无人机_05

【目标跟踪】基于迭代扩展卡尔曼滤波算法实现目标滤波跟踪(IEKF)附Matlab代码_参考文献_06

4 参考文献

[1]曲志昱, 王超然, 孙萌. 基于改进迭代扩展卡尔曼滤波的3星时频差测向融合动目标跟踪方法[J]. 电子与信息学报, 2021, 43(10):7.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

【目标跟踪】基于迭代扩展卡尔曼滤波算法实现目标滤波跟踪(IEKF)附Matlab代码_无人机_07