gfresp2.m

来自「外国人写matlab 的gobor特征运算工具箱」· M 代码 · 共 72 行

M
72
字号
%GFRESP2 2-D filter response using spatial domain filters.%%   [R] = GFRESP2(GF,S) calculates the response R of%   Gabor filter GF for the 2-D signal S. GF should be given in%   spatial space (use GFCREATEFILTER2) and S in spatial space%   (gray level image, etc.) If GF is normalized Gabor filter%   (GFCREATEFILTER2) then the response can be considered as%   normalized response.%%   [R] = GFRESPF2(GF,S,X0,Y0) returns the response at location%   (Y,X)%%     --------> x%     |%     |%     |%     V y%%   Examples%%   See also GFCREATEFILTER2.%% References:%   [1] Kamarainen, J.-K., Kyrki, V., Kalviainen, H., Gabor%       Features for Invariant Object Recognition, Research%       report 79, Department of Information Technology,%       Lappeenranta University of Technology %% Author(s):%    Joni Kamarainen <Joni.Kamarainen@lut.fi>%    Ville Kyrki <Ville.Kyrki@lut.fi>%% Copyright:%%   The Gabor Features in Signal and Image Processing Toolbox is%   Copyright (C) 2000 by Joni Kamarainen and Ville Kyrki.%%%   $Name:  $ $Revision: 1.1 $  $Date: 2003-12-23 07:27:55 $%function [r]=gfresp2(gf_, s_, varargin);% calculate only at several locationsif (nargin > 2)  x0 = diag(diag(varargin{1}));  y0 = diag(diag(varargin{2}));  subimg = zeros(size(s_));    for coordInd = 1:length(x0)        rn = [rn; r(y0(coordInd), x0(coordInd))];  end;end;% spatial centered signal -> uncentered frequency spectra ffts = fft2(ifftshift(s_));% response matrixr = fftshift(ifft2(ffts.*gf_));% only at some given coordinatesif (nargin > 2) % coordinates given  x0 = diag(diag(varargin{1}));  y0 = diag(diag(varargin{2}));  rn = [];  for coordInd = 1:length(x0)    rn = [rn; r(y0(coordInd), x0(coordInd))];  end;  r = rn;end;

⌨️ 快捷键说明

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