资源简介
利用matlab实现LK光流法对目标的跟踪
代码片段和文件信息
function largeIm = Expand(im);
%EXPAND Compute large layer of Gaussian pyramid
% Sohaib Khan Feb 16 2000
%Algo
%Gaussian mask = [0.05 0.25 0.4 0.25 0.05]
% Insert zeros in every alternate row position and conv with mask
% insert zeros in every alternate clmn position in result and conv with mask‘
mask = 2*[0.05 0.25 0.4 0.25 0.05]; %factor of 2 is there because each pixel gets contribution
% either from 0.05 0.4 0.05 or from 0.25 0.25
% insert zeros in every alternate position in each row
rowZeros = [im; zeros(size(im))];
rowZeros = reshape(rowZeros size(im1) 2*size(im2));
%conv with horiz mask
newIm = conv2(rowZeros mask);
newIm = newIm(:3:size(newIm2)-2);
% insert zeros in every alternate position in each col
colZeros = newIm‘;
colZeros = [colZeros; zeros
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 983 2000-02-29 14:46 LKguangliu\LKmatlab\Expand.m
文件 3392 2008-12-11 19:33 LKguangliu\LKmatlab\HierarchicalLK.m
文件 1823 2003-10-23 01:47 LKguangliu\LKmatlab\LucasKanade.m
文件 2850 2003-07-27 20:09 LKguangliu\LKmatlab\LucasKanadeRefined.m
文件 582 2000-02-29 14:46 LKguangliu\LKmatlab\Reduce.m
评论
共有 条评论