资源简介
目标跟踪
代码片段和文件信息
%% Copyright (c) 2007 Christopher Wellons
%%
%% Permission to use copy modify and distribute this software for any
%% purpose with or without fee is hereby granted provided that the
%% above copyright notice and this permission notice appear in all
%% copies.
%%
%% THE SOFTWARE IS PROVIDED “AS IS“ AND THE AUTHOR DISCLAIMS ALL
%% WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
%% WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
%% AUTHOR BE LIABLE FOR ANY SPECIAL DIRECT INDIRECT OR CONSEQUENTIAL
%% DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE DATA OR
%% PROFITS WHETHER IN AN ACTION OF CONTRACT NEGLIGENCE OR OTHER
%% TORTIOUS ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR
%% PERFORMANCE OF THIS SOFTWARE.
function project3(folder alpha)
% Chris Wellons
% Ron Ledwich
% Ben Hvostal
% CSE 486 Project 3
% Set number of frames (images) based on folder entered
frames = length(dir(fullfile(folder ‘f*jpg‘)));
% Set alpha
if ~exist(‘alpha‘ ‘var‘)
alpha = .25;
end
% object tracking colors
color_list = [];
color_list = [color_list {[1 0 0]}]; % Red
color_list = [color_list {[0 1 0]}]; % Green
color_list = [color_list {[0 0 1]}]; % Blue
color_list = [color_list {[0 1 1]}]; % Cyan
color_list = [color_list {[1 0 1]}]; % Fuchsia (sp?)
color_list = [color_list {[1 1 1]}]; % White
color_list = [color_list {[1 .5 0]}]; % Orange
color_list = [color_list {[.914 .5882 .4784]}]; % Dark Salmon
color_list = [color_list {[0 1 .5]}]; % Spring green
color_list = [color_list {[.42 .557 .137]}]; % Olive drab
image_list = [{} {} {} {} {}];
% Initialize some variables and stuff
tic; figure;
boxes = [];
SE = strel(‘disk‘ 3);
outm = [];
impad = 5; % Padding around ncc box
ncc_thresh = 0.8; % Threshold for good ncc match
timeave = 0;
% Adaptive Background Subtraction
for i=1:frames
% Figure out time left
timeave = (toc+6*timeave)/7;
timeleft = timeave * (frames - i);
minutes = floor(timeleft/60);
seconds = floor(mod(timeleft60));
tic;
disp([‘Working on frame ‘ num2str(i) ‘ (‘ num2str(minutes) ‘:‘ num2str(seconds) ‘ left)‘]);
[I cI] = getimage(folder i);
% Initialize B
if ~exist(‘B‘ ‘var‘)
B = I;
end
% Get difference data
diff = abs(B - I) * 255;
M = threshold(diff 15);
% Prepare next B
B = alpha*I + (1-alpha)*B;
% Initalize current frame box data
curbox = [];
ncc_pass = 0;
ncc_fail = 0;
% Dilate the difference image
dim = imdilate(M SE);
% Find each object
for j = 1:size(dim 1)
for k = 1:size(dim 2)
if dim(jk) == 1
doit = 0;
% Trace out the object
T = bwtraceboundary(dim [jk] ‘E‘);
% Filter small objects
if length(T) > 100
doit = 1;
end
% Convert trace into a blob
T = full(spconvert([T ones(length(T) 1)]));
[x1 y1 x2 y2] = find_bounds(T);
T(y1:y2x1:x2) = ones(y2-y1+1x2-x1+1);
% Find original parts and draw a box
if doit
C = and(T
- 上一篇:wavelet.m
- 下一篇:Matlab仿真IEEE 802.11a系统.zip
相关资源
- matlab 目标检测算法
- 帧间差法进行视频目标检测
- 基于深度学习的汽车目标检测
- Vibe算法matlab
- 均值建模法
- MATLAB程序实现视频中运动的目标的跟
- MATLAB+背景减除目标检测+鱼头截取
- 基于空间分形特性差异的海杂波目标
- 多类分类 目标检测
- 视频监控阴影去除
- CPHD的方法实现多目标跟踪
- 小波变换的水下图像目标检测
- 一种显著性特征检测算法
- 深度学习汽车目标检测matlab2017
- 运动目标检测的matlab代码
- 运动目标检测与跟踪算法 Matlab
- 多目标检测追踪算法MATLAB实现
- 红外图像的弱小目标检测与跟踪
- 弱小目标检测与跟踪 (Small Target De
- matlab机动微弱目标检测前跟踪
- SAR-GMTI 星座SAR动目标检测
- 改进的VIBE运动目标检测算法
- 改进的混合高斯背景模型
- MotionDetection 静止背景下运动目标检测
- automsft 该程序初始时使用背景差分法
- MutiTargetDetection 多目标检测与跟踪算法
- shadow-removal 该代码用于在视觉智能监
- Ship-detection 复杂杂波背景下
- Moving-target-detection 运动目标检测的一
- Soft_Morphology_Top_Hat 改进的数学形态学
评论
共有 条评论