资源简介
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的copula相关程序
- matlab中text函数在显示字符串时的使用
- jpeg压缩的matlab程序
- PIIFD描述符matlab源代码
- 自动驾驶多目标检测.7z
- 使用QQ监控Matlab程序运行
- 登月挺软着陆MATLAB仿真
- 图像分割的多种算法MATLAB代码
- matlab实现图像模板匹配
- 光伏MPPT模型
- RS编码和纠错算法 matlab
- Matlab2010b的license.txt
- 基于matlab的自动报靶系统.rar
- matlab声线图源代码
- 神经网络理论与Matlab R2007实现
-
matlab simuli
nk 离合器模型 - 多车型车辆路径问题Matlab程序
- GPS/INS组合导航Matlab仿真源码包含实验
- Delaunay三角划分的Matlab实现
- isight联合matlab仿真
- 利用MATLAB优化电力系统稳定器
- BPA转matpower格式Matlab程序
- 基于C MEX S函数的研华PCI1716驱动程序
- 最小二乘法 MATLAB
- aodv和dsr的matlab实现
- 回溯法解决资源约束下的二维动态规
- rgb2lab颜色空间转换的MATLAB代码
- polar程序MATLAB编译码
- 目标跟踪常速度CV及常加速度CA模型程
- matlab基于SAD的区域立体匹配方法
评论
共有 条评论