资源简介
tracking.m
代码片段和文件信息
function d = tracking(video)
if ischar(video)
% Load the video from an avi file.
avi = aviread(video);
pixels = double(cat(4avi(1:2:end).cdata))/255;
clear avi
else
% Compile the pixel data into a single array
pixels = double(cat(4video{1:2:end}))/255;
clear video
end
% Convert to RGB to GRAY SCALE image.
nframes = size(pixels4);
for f = 1:nframes
% F = getframe(gcf);
% [xmap]=frame2im(F);
% imwrite(x‘fln.jpg‘‘jpg‘);
% end
pixel(::f) = (rgb2gray(pixels(:::f)));
end
rows=240;
cols=320;
nrames=f;
for l = 2:nrames
d(::l)=(abs(pixel(::l)-pixel(::l-1)));
k=d(::l);
% imagesc(k);
% drawnow;
% himage = imshow(‘d(::l)‘);
% hfigure = figure;
% impixelregionpanel(hfigure himage);
% datar=imageinfo(imagesc(d(::l)));
% disp(datar);
bw(::l) = im2bw(k .2);
bw1=bwlabel(bw(::l));
imshow(bw(::l))
hold on
% % for h=1:rows
% for w=1:cols
%
% if(d(::l)< 0.1)
% d(hwl)=0;
% end
% end
%
% end
% % disp(d(::l));
% % size(d(::l))
cou=1;
for h=1:rows
for w=1:cols
if(bw(hwl)>0.5)
% disp(d(hwl));
toplen = h;
if (cou == 1)
相关资源
- SNN-STLAPID.m
- 基于Matlab的ASKFSKPSK仿真数字调制技术
- Hamming.m
- Standard_Rectifier_PI_SV2.mdl
- Matlab2014_(32and64).txt
- 麻雀搜索算SSA优化SVM_matlab.rar
- 商人过河MATLAB.rar
- adapt.m
- MatlabR2017aWin64Crack.rar
- matlab程序实现.vip
- PID算法Matlab仿真程序和C程序[doc.xueh
- 雷英杰《MATLAB遗传算法工具箱与应用
- Matlab编程.doc
- 低通滤波.ms14
-
基于Matlab_Simuli
nk的空气悬架非线性 - erweijiaochashang.m
- threephasePWMrectifier.mdl
- mimo_detection.m
- quanxixue.m
- 虚拟同步发电机孤岛模式以及切换的
-
simuli
nk光伏并网逆变器仿真,可运行 - matlab2017b百度网盘地址.txt
- ssa.m
- pettittFunctionUser.m
- zw_Matlab余弦相似度算法.zip
- chuanghanshu.m
- LSD直线提取算法MATLAB.rar
- Itti-Matlab.rar
- zipf.m
- wavelet.m
评论
共有 条评论