gfcreatefilterf.m

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

M
78
字号
%GFCREATEFILTERF Create normalized 1-D Gabor filter in the frequency domain.%%   [G] = GFCREATEFILTERF(F0,GAMMA,N,...) creates a normalized Gabor%   filter G of size N with central frequency F0, normalized width GAMMA.%%   G = GFCREATEFILTER(...,'PF',PF) determines that at least%   P percent of the Gaussian envelope of the filter must be%   included in the filter in frequency domain. For default,%   PF=0.998. %%   G = GFCREATEFILTER(...,'PT',PT) determines that at least%   P percent of the Gaussian envelope of the filter must be%   included in the filter in time domain. For default,%   PT=0.998. %%   Examples%%   See also GFCREATEFILTER, GFCHECKFILTER.%% 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.10 $  $Date: 2003-02-23 16:27:44 $%function [g]=gfcreatefilterf(f0,gamma,N,varargin)%% Setting default valuesalpha = f0/gamma;PT = 0.998;PF = 0.998;%% Parameter parsingcurrentarg = 1;while (length(varargin) > currentarg)  [param,value]=deal(varargin{currentarg:currentarg+1});  switch lower(param)   case 'pt'    PT = value;   case 'pf'    PF = value;   otherwise    error(['Unknown parameter ''' param '''.']);  end;  currentarg=currentarg+2;end;% Check filter constraintsgfcheckfilter(f0,gamma,N,PT,PF);% Creating the bankn = -N:1:N;nyqf = 0.5; % Nyquist frequency u = n/N; % frequencies that bank contains% Create filter valuesg = zeros(1,N);gf = exp(-(pi^2/alpha^2)*(u-f0).^2); g = gf((N+1):(2*N)); % frequencies from 0 to (N-1)/Ng = g+gf(1:N); % aliased frequencies

⌨️ 快捷键说明

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