资源简介
matlab版本的红外目标跟踪的代码,供大家参考查阅,有一定的价值

代码片段和文件信息
%Meanshift Function:
%Created a simple convergence algorithm which looks in windows of varying
%sizes. This function is called by wrapper programs such as single
%track.This algorithm identifies the first window that is stable.
function [s_win x_c y_c] = camshift(I_curr s_win)
%Constant Parameters:
T = .5; % Threshold of convergence (in pixels)
del = T; %Pixel delta defaults at T
max_iterations = 200;
%Input the initial search window (location and size)
ix = s_win(1); %Initial x location
iy = s_win(2); %Initial y location
sx = s_win(3); %Search window size in x
sy = s_win(4); %Search window size in y
for x_f = .5:.1:1.5
for y_f = .5:.1:1.5
x_c = round(ix + sx/2);
y_c = round(iy + sy/2);
iterations = 0;
%While the solution is still converging as long as we haven‘t been
%searching for too many iterations
while (iterations < max_iterations && del >= T)
%Save the previous ix and iy:
x_p = x_c;
y_p = y_c;
% Compute centroid of search window
x_min = round(x_c - x_f * sx);
x_max = round(x_c + x_f * sx);
y_min = round(y_c - y_f * sy);
y_max = round(y_c + y_f * sy);
TS = double(0);
for i = x_min:x_max
for j = y_min:y_max
if i < size(I_curr2)&& j < size(I_curr1)&& i > 1&& j > 1
%Calculate the sum over the area:
TS = TS + double(I_curr(ji));
end
end
end
I_x = double(0);
for i = x_min:x_max
for j = y_min:y_max
if i < size(I_curr2)&& j < size(I_curr1)&& i > 1&& j > 1
%Calculate the weighted value:
I_x = I_x + i * double(I_curr(ji));
end
end
end
I_y = double(0);
for i = x_min:x_max
for j = y_min:y_max
if i < size(I_curr2)&& j < size(I_curr1)&& i > 1&& j > 1
%Calculate the weighted value:
I_y = I_y + j * double(I_curr(ji));
end
end
end
%Find the centroid:
x_c = round(I_x/TS);
y_c = round(I_y/TS);
%Calculate Current Error
del = abs(x_p-x_c) + abs(y_p-y_c);
iterations = iterations + 1;
end
if del <= T
break;
end
end
if del <= T
break;
end
end
sx = min(max(round(x_f * sx)1)size(I_curr2));
sy = min(max(round(y_f * sy)1)size(I_curr1));
ix = min(max(round(x_c - x_f * sx/2)1)size(I_curr2));
iy = min(max(round(y_c - y_f * sy/2)1)size(I_curr1));
%Set return varaibles for new window location
s_win(1) = ix; %Initial x location
s_win(2) = iy; %Initial y location
s_win(3) = sx; %Search window size in x
s_win(4) = sy; %Search window size in y
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-03-02 18:43 ob
文件 2098 2015-03-02 18:43 ob
文件 2002 2015-03-02 18:43 ob
文件 1465 2015-03-02 18:43 ob
文件 21980 2015-03-02 18:43 ob
文件 19518 2015-03-02 18:43 ob
文件 832 2015-03-02 18:43 ob
文件 4049 2015-03-02 18:43 ob
文件 4078 2015-03-02 18:43 ob
文件 18485 2015-03-02 18:43 ob
文件 18541 2015-03-02 18:43 ob
文件 3738 2015-03-02 18:43 ob
文件 2932 2015-03-02 18:43 ob
文件 3113 2015-03-02 18:43 ob
文件 810 2015-03-02 18:43 ob
- 上一篇:matlab的copula相关程序
- 下一篇:prony算法的具体步骤
相关资源
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
评论
共有 条评论