gfcheckfilter.m

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

M
109
字号
%GFCHECKFILTER Check filter parameters.%%   GFCHECKFILTER(F0,GAMMA,N,PT,PF)  Checks the constraints of the%   discrete Gabor filter for given parameters and prints out%   warning messages.%%     F0    - Central frequency%     GAMMA - Sharpness factor%     N     - Size of the filter%     PT    - Time domain percent factor%     PF    - Frequency domain Percent factor%%   Examples%%     gfcheckfilter(1/64, 1, 64, 0.998, 0.998);%%   See also GFCREATEFILTER, GFCREATEFILTERF.%% 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 %   [2] Kamarainen, Joni-Kristian, Feature Extraction with Gabor%       Filters, PhD thesis, Lappeenranta University of Technology,%       2003. %% 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.7 $  $Date: 2003-05-02 12:11:06 $%function []=gfcheckfilter(f0,gamma,N,PT,PF)% Set checking valuesalpha = f0/gamma;nyqf = 0.5; % Nyquist frequency %% 1. Checking Nyquist criterionif (abs(f0) > nyqf)  warning(['Nyquist criterion violated. Allowed intervals are' ...	  ' ]0,0.5[ for positive and ]-0.5,0[ for negative frequencies']);end;%% 2. Checking zero frequency constraintif (f0 == 0)  error(['Zero frequency is not allowed due to the filter normalization ' ...	 '(division by zero).']);end;%% 3. Checking frequency constraint%% from [1]%fPF = erf(pi/alpha*f0);% more strict from [2] - works for positive and negative frequenciesf = f0;L = N;fPF = 1/2*erf(gamma*pi)+1/2*erf((gamma*pi)/abs(f)*(1/2-1/L)-gamma*pi);if (fPF < PF)  warning(['Filter envelope insufficiently located in the frequency domain. '...	   ' Requested minimum envelope area inside domain is '...	   num2str(100*PF) ' percent and currently area is ' ...	   num2str(100*fPF)]);end;%% 4. Checking time constraint% Symmetric part of the filter must contain pt percent of the% full filter envelope %% from [1]%fPT = erf(alpha*floor((N-1)/2));fPT = erf(abs(f)/gamma*(L/2-1));if (fPT < PT)  warning(['Spatial filter size may be too small. '...	   ' Requested minimum spatial envelope size is '...	   num2str(PT*100) ' percent and current size is '...	   num2str(100*fPT)]);end;

⌨️ 快捷键说明

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