📄 compute_grad.m.svn-base
字号:
function grad = compute_grad(M,options)
% compute_grad - compute the gradient of an image using central differences
%
% grad = compute_grad(M,options);
%
% 'options' is a structure:
% - options.h is the sampling step size on both direction (default 1).
% - options.h1 is the sampling step size on X direction (default 1).
% - options.h2 is the sampling step size on Y direction (default 1).
% - options.type is the kind of finite difference.
% type==2 is fwd differences, ie.
% y(i) = (x(i)-x(i-1))/h, with special
% care at boundaries.
% type==1 is forward differences bilinearly interpolated in the
% middle of each pixel (be aware that you have a shift of 1/2 on X and Y for
% the location of the gradient).
% type==1 is backward differences bilinearly interpolated in the
% middle of each pixel (be aware that you have a shift of -1/2 on X and Y for
% the location of the gradient).
%
% Copyright (c) 2004 Gabriel Peyr
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -