资源简介
matlab运动估计代码.里面有源图像和运行结果.对写论文应该有帮助

代码片段和文件信息
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Name: Musawir Ali Shah
%%% Assignment #3
%%% Project title: Lucas Kanade Motion Estimation Using Pyramids (Level 4)
%%% Note: The project specification says use density of 10 in plotting
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Usage: Lucas_Kanade(‘1.bmp‘‘2.bmp‘10)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function Lucas_Kanade(file1file2density);
%% Read Images %%
img1 = im2double (imread (file1));
%% Take alternating rows and columns %%
[odd1 even1] = split (img1);
img2 = im2double (imread (file2));
[odd2 even2] = split (img2);
%% Run Lucas Kanade %%
[Dx Dy] = Estimate (odd1 odd2);
%% Plot %%
figure;
[maxImaxJ]=size(Dx);
Dx=Dx(1:density:maxI1:density:maxJ);
Dy=Dy(1:density:maxI1:density:maxJ);
quiver(1:density:maxJ(maxI):(-density):1Dx-Dy1);
axis square;
%% Run Lucas Kanade on all levels and interpolate %%
function [Dx Dy] = Estimate (img1 img2)
level = 4;
half_window_size=2;
[m n] = size (img1);
G00 = img1; G10 = img2;
if (level>0)
G01 = reduce (G00); G11 = reduce (G10);
end
if (level>1)
G02 = reduce (G01); G12 = reduce (G11);
end
if (level>2)
G03 = reduce (G02); G13 = reduce (G12);
end
if (level>3)
G04 = reduce (G03); G14 = reduce (G13);
end
l = level;
for i=level:-1:0
if (l == level)
switch (l)
case 4 Dx = zeros (size (G04)); Dy = zeros (size (G04));
case 3 Dx = zeros (size (G03)); Dy = zeros (size (G03));
case 2 Dx = zeros (size (G02)); Dy = zeros (size (G02));
case 1 Dx = zeros (size (G01)); Dy = zeros (size (G01));
case 0 Dx = zeros (size (G00)); Dy = zeros (size (G00));
end
else
Dx = expand (Dx); Dy = expand (Dy);
Dx = Dx .* 2; Dy = Dy .* 2;
end
switch (l)
case 4
W = warp (G04 Dx Dy);
[Vx Vy] = EstimateMotion (W G14 half_window_size);
case 3
W = warp (G03 Dx Dy);
[Vx Vy] = EstimateMotion (W G13 half_window_size);
case 2
W = warp (G02 Dx Dy);
[Vx Vy] = EstimateMotion (W G12 half_window_size);
case 1
W = warp (G01 Dx Dy);
[Vx Vy] = EstimateMotion (W G11 half_window_size);
case 0
W = warp (G00 Dx Dy);
[Vx Vy] = EstimateMotion (W G10 half_window_size);
end
[m n] = size (W);
Dx(1:m 1:n) = Dx(1:m1:n) + Vx; Dy(1:m 1:n) = Dy(1:m 1:n) + Vy;
smooth (Dx); smooth (Dy);
l = l - 1;
end
%% Lucas Kanade on the image sequence at pyramid step %%
function [Vx Vy] = EstimateMotion (W G1 half_window_size)
[m n] = size (W);
Vx = zeros (size (W)); Vy = zeros (size (W));
N = zeros (2*half_window_size+1 5);
for i = 1:m
l = 0;
for j = 1-half_window_size:1+half_window_size
l = l + 1;
N (l:) = getSlice (W G1 i j half_window_size);
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2006-10-05 17:57 lk
文件 64078 2003-04-08 18:03 lk\1.bmp
文件 64078 2003-04-08 18:03 lk\2.bmp
文件 21958 2003-04-07 14:03 lk\3.bmp
文件 21958 2003-04-07 14:03 lk\4.bmp
文件 169984 2004-04-18 03:57 lk\Lucas.doc
文件 6932 2004-04-18 03:07 lk\Lucas_Kanade.m
文件 298 2004-04-18 04:01 lk\tests.m
..A.SH. 20480 2006-10-05 18:07 lk\Thumbs.db
----------- --------- ---------- ----- ----
369984 10
相关资源
- 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
评论
共有 条评论