⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 computelkflowparms.m

📁 a matlab code on duper resolution
💻 M
字号:
% [Ht, G]=ComputeLKFlowParms(img)
%
% Computes the optical flow parameters. The image is derived in DX and DY
% directions and matrix G is computed.
%
% Inputs:
% img - The image to compute optical flow parameters. Note that the image
%       must contain a border of size 1 since the DX and DY operation work
%       on 3x3 regions.
%
% Outpus:
% Ht - The transpose of matrix H, which defines the LK affine approximation of an shifted
% image
%
% G  - The matrix G=H'*H
%
function [Ht, G]=ComputeLKFlowParms(img)

% Compute Ix and Iy derivatives using sobel operator
Hdy = fspecial('sobel');
Hdx = Hdy';

Ix=imfilter(img, Hdx);
Iy=imfilter(img, Hdy);

Ix=Ix(2:end-1,2:end-1);
Iy=Iy(2:end-1,2:end-1);

% Compute G
H = [Ix(:) Iy(:)];
Ht=H';
G=Ht*H;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -