资源简介
经典的光流计算,用matlab编写的程序,希望对学习者有所帮助
代码片段和文件信息
function [usvs] = HSoptflow(Xrgbn)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Author: Gregory Power gregory.power@wpafb.af.mil
% This MATLAB code shows a Motion Estimation map created by
% using a Horn and Schunck motion estimation technique on two
% consecutive frames. Input requires.
% Xrgb(hwdN) where X is a frame sequence of a certain
% height(h) width (w) depth (d=3 for color)
% and number of frames (N).
% n= is the starting frame number which is less than N
% V= the output variable which is a 2D velocity array
%
% Sample Call: V=HSoptflow(X3);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[hwdN]=size(Xrgb)
if n>N-1
error(1‘requested file greater than frame number required‘);
end;
%get two image frames
if d==1
Xn=double(Xrgb(::1n));
Xnp1=double(Xrgb(::1n+1));
elseif d==3
Xn=double(Xrgb(::1n)*0.299+Xrgb(::2n)*0.587+Xrgb(::3n)*0.114);
Xnp1=double(Xrgb(::1n+1)*0.299+Xrgb(::2n+1)*0.587+Xrgb(::3n+1)*0.114);
else
error(2‘not an RGB or Monochrome image file‘);
end;
%get image size and adjust for border
size(Xn)
hm5=h-5; wm5=w-5;
z=zeros(hw); v1=z; v2=z;
相关资源
- 改进的中值滤波MATLAB程序
- Matlab图像处理——小波变换去噪声、
- Matlab图像处理程序——去噪、边缘增
- 基于Matlab的数字信号处理仿真系统实
- 窗函数法设计FIR数字滤波器Matlab程序
- Matlab实现音频的分贝图
- EM算法完整matlab代码
- 小波融合代matlab源代码
- Gabor滤波特征提取方法 matlab程序
- matlab取目标轮廓坐标
- MATLAB课程设计数字拼图游戏.7z
- 基于BP神经网络的系统建模辨识与预测
- matlab程序之滤波器
- 元胞自动机的Matlab代码.m
- 孤立语音识别
- 语音识别matlab
- 用matlab编写的二维最大熵和最小交叉
- 一维最大熵阈值分割
- 模糊神经网络matlab代码
- 拉普拉斯算法matlab实现
- LBM模拟二维平板流matlab代码
- dwt算法matlab实现
- DE算法MATLAB代码
- NSGA2自定义优化函数MATLAB代码
- SURF等5种特征点检测代码matlab
- 数字图像置乱技术及其Matlab实现
- PLICP和matlabicp代码
- Camshift目标跟踪matlab实现
- QPSK调制解调的MATLAB程序仿真
- 小型火箭Matlab求解
评论
共有 条评论