资源简介
有两篇文章:Pyramidal Implementation of the Lucas Kanade Feature Tracker Description of the algorithm
以及它的翻译(当然不是我翻译的 如果有侵权的话联系我我就删啊 QAQ)
还有matlab计算光流 看文章有助于理解程序  ̄▽ ̄ y
代码片段和文件信息
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%DENSE LUCAS KANADE PYRAMIDAL + ITERATIVE REFINMENT
%J.MARZAT - ENSEM / INRIA Rocquencourt (France) julien.marzat@gmail.com
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Data acquisition
im1=single((imread(‘yos_img_10.pgm‘)));
im2=single((imread(‘yos_img_11.pgm‘)));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%parameters : levels number window size iterations number regularization
numLevels=3; %Lm:height of the pyramid.(234)
window=9;% integration window
iterations=1;
alpha = 0.001;
hw = floor(window/2); %WxWy?
t0=clock;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%pyramids creation
pyramid1 = im1;
pyramid2 = im2;
%init
for i=2:numLevels
im1 = impyramid(im1 ‘reduce‘);
im2 = impyramid(im2 ‘reduce‘);
pyramid1(1:size(im11) 1:size(im12) i) = im1;
pyramid2(1:size(im21) 1:size(im22) i) = im2;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Processing all levels
for p = 1:numLevels
%current pyramid
im1 = pyramid1(1:(size(pyramid11)/(2^(numLevels - p))) 1:(size(pyramid12)/(2^(numLevels - p))) (numLevels - p)+1);
im2 = pyramid2(1:(size(pyramid21)/(2^(numLevels - p))) 1:(size(pyramid22)/(2^(numLevels - p))) (numLevels - p)+1);
%init
if p==1
u=zeros(size(im1));%Vx
v=zeros(size(im1));%Vy
else
%resizing
u = 2 * imresize(usize(u)*2‘bilinear‘);
v = 2 * imresize(vsize(v)*2‘bilinear‘);
end
%refinment loop
for r = 1:iterations
u=round(u);
v=round(v);
%every pixel loop
for i = 1+hw:size(im11)-hw
for j = 1+hw:size(im22)-hw
patch1 = im1(i-hw:i+hw j-hw:j+hw);
%moved patch
lr = i-hw+v(ij);
hr = i+hw+v(ij);
lc = j-hw+u(ij);
hc = j+hw+u(ij);
if (lr < 1)||(hr > size(im11))||(lc < 1)||(hc > size(im12))
%Regularized least square processing
else
patch2 = im2(lr:hr lc:hc);
fx = conv2(patch1 0.25* [-1 1; -1 1]) + conv2(patch2 0.25*[-1 1; -1 1]);
fy = conv2(patch1 0.25* [-1 -1; 1 1]) + conv2(patch2 0.25*[-1 -1; 1 1]);
ft = conv2(patch1 0.25*ones(2)) + conv2(patch2 -0.25*ones(2));
Fx = fx(2:window-12:window-1)‘;
Fy = fy(2:window-12:window-1)‘;
Ft = ft(2:window-12:window-1)‘;
A = [Fx(:) Fy(:)];
G=A‘*A;
G(11)=G(11)+alpha; G(22)=G(22)+alpha;
U=1/(G(11)*G(22)-G(12)*G(21))*[G(22) -G(12);-G(21) G(11)]*A‘*-Ft(:);
u(i
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1334 2010-03-08 04:31 LKPR-marzat\license.txt
文件 3324 2013-10-15 09:41 LKPR-marzat\LKPR.m
文件 270836 2012-12-11 18:17 LKPR-marzat\Pyramidal_Implementation_of_the_Lucas_Kanade_Feature_Tracker_Desc
文件 1285 2008-04-30 15:34 LKPR-marzat\showmap3.m
文件 79647 2003-04-18 21:18 LKPR-marzat\yos_img_10.pgm
文件 79647 2003-04-18 21:18 LKPR-marzat\yos_img_11.pgm
文件 350669 2012-12-11 21:13 LKPR-marzat\基于金字塔的LK特征点跟踪算法.pdf
目录 0 2013-10-15 13:30 LKPR-marzat
----------- --------- ---------- ----- ----
786742 8
相关资源
- matlab写的分水岭算法对粘连东西进行
- RANSAC算法matlab包
- 瑞利衰落信道的matlab仿真程序
- 海龟策略的matlab代码
- 凸透镜轴上成像的相差(matlab模拟)
- RRT路径规划matlab源代码
- Matlab调用Snopt中文用户手册
- 预报误差法参数辨识-松弛算法(单输
- 多级最小二乘法Matlab程序
- 混合同余法产生随机数和M序列产生方
- 人工免疫算法程序-故障检测matlab
- 数字图像处理——基于视频的车流量
- CMI编码与解码系统设计MATLAB实现
- 无线传感器网络定位算法matlab代码
- 自适应贝叶斯算法matlab源码
- 自适应小波阈值算法matlab源码
- 使用MATLAB三秒钟提取任意流域CMADSV1
- BCH (15 5)码MATLAB编译码仿真过程
- 基于核回归 Kernel regression 的图像处理
-
基于simuli
nk直接序列扩频通信 - HSPICE TOOLBOX FOR MATLAB
- Jakes模型MATLAB仿真
- matlab数字图像处理 有约束最小平方恢
- 图像加密matlab代码
- Matlab_2011b
- adaboost算法matlab实现
- 计算信号盒维数的MATLAB代码
- MATLAB实现V-BLAST系统及其检测算法
- 带高斯白噪声的Kalman滤波Matlab代码带
- 一种基于turbo码的matlab仿真
评论
共有 条评论