📄 gfcheckfilter.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html><head> <title>Description of gfcheckfilter</title> <meta name="keywords" content="gfcheckfilter"> <meta name="description" content="GFCHECKFILTER Check filter parameters."> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="generator" content="m2html © 2003 Guillaume Flandin"> <meta name="robots" content="index, follow"> <link type="text/css" rel="stylesheet" href="../m2html.css"></head><body><a name="_top"></a><div><a href="../index.html">Home</a> > <a href="index.html">gabortb-v0.4.1</a> > gfcheckfilter.m</div><!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png"> Master index</a></td><td align="right"><a href="index.html">Index for gabortb-v0.4.1 <img alt=">" border="0" src="../right.png"></a></td></tr></table>--><h1>gfcheckfilter</h1><h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>GFCHECKFILTER Check filter parameters.</strong></div><h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>function []=gfcheckfilter(f0,gamma,N,PT,PF) </strong></div><h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre class="comment">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 <a href="gfcreatefilter.html" class="code" title="function [g]=gfcreatefilter(f0,gamma,n,varargin)">GFCREATEFILTER</a>, <a href="gfcreatefilterf.html" class="code" title="function [g]=gfcreatefilterf(f0,gamma,N,varargin)">GFCREATEFILTERF</a>. 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 $</pre></div><!-- crossreference --><h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>This function calls:<ul style="list-style-image:url(../matlabicon.gif)"></ul>This function is called by:<ul style="list-style-image:url(../matlabicon.gif)"><li><a href="gfcreatefilter.html" class="code" title="function [g]=gfcreatefilter(f0,gamma,n,varargin)">gfcreatefilter</a> GFCREATEFILTER Create normalized 1-D Gabor filter in time domain.</li><li><a href="gfcreatefilterf.html" class="code" title="function [g]=gfcreatefilterf(f0,gamma,N,varargin)">gfcreatefilterf</a> GFCREATEFILTERF Create normalized 1-D Gabor filter in the frequency domain.</li></ul><!-- crossreference --><h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre>0001 <span class="comment">%GFCHECKFILTER Check filter parameters.</span>0002 <span class="comment">%</span>0003 <span class="comment">% GFCHECKFILTER(F0,GAMMA,N,PT,PF) Checks the constraints of the</span>0004 <span class="comment">% discrete Gabor filter for given parameters and prints out</span>0005 <span class="comment">% warning messages.</span>0006 <span class="comment">%</span>0007 <span class="comment">% F0 - Central frequency</span>0008 <span class="comment">% GAMMA - Sharpness factor</span>0009 <span class="comment">% N - Size of the filter</span>0010 <span class="comment">% PT - Time domain percent factor</span>0011 <span class="comment">% PF - Frequency domain Percent factor</span>0012 <span class="comment">%</span>0013 <span class="comment">% Examples</span>0014 <span class="comment">%</span>0015 <span class="comment">% gfcheckfilter(1/64, 1, 64, 0.998, 0.998);</span>0016 <span class="comment">%</span>0017 <span class="comment">% See also GFCREATEFILTER, GFCREATEFILTERF.</span>0018 <span class="comment">%</span>0019 <span class="comment">% References:</span>0020 <span class="comment">% [1] Kamarainen, J.-K., Kyrki, V., Kalviainen, H., Gabor</span>0021 <span class="comment">% Features for Invariant Object Recognition, Research</span>0022 <span class="comment">% report 79, Department of Information Technology,</span>0023 <span class="comment">% Lappeenranta University of Technology</span>0024 <span class="comment">% [2] Kamarainen, Joni-Kristian, Feature Extraction with Gabor</span>0025 <span class="comment">% Filters, PhD thesis, Lappeenranta University of Technology,</span>0026 <span class="comment">% 2003.</span>0027 <span class="comment">%</span>0028 <span class="comment">% Author(s):</span>0029 <span class="comment">% Joni Kamarainen <Joni.Kamarainen@lut.fi></span>0030 <span class="comment">% Ville Kyrki <Ville.Kyrki@lut.fi></span>0031 <span class="comment">%</span>0032 <span class="comment">% Copyright:</span>0033 <span class="comment">%</span>0034 <span class="comment">% The Gabor Features in Signal and Image Processing Toolbox is</span>0035 <span class="comment">% Copyright (C) 2000 by Joni Kamarainen and Ville Kyrki.</span>0036 <span class="comment">%</span>0037 <span class="comment">%</span>0038 <span class="comment">% $Name: $ $Revision: 1.7 $ $Date: 2003-05-02 12:11:06 $</span>0039 <span class="comment">%</span>0040 <a name="_sub0" href="#_subfunctions" class="code">function []=gfcheckfilter(f0,gamma,N,PT,PF)</a>0041 0042 <span class="comment">% Set checking values</span>0043 alpha = f0/gamma;0044 nyqf = 0.5; <span class="comment">% Nyquist frequency</span>0045 0046 <span class="comment">%</span>0047 <span class="comment">% 1. Checking Nyquist criterion</span>0048 <span class="keyword">if</span> (abs(f0) > nyqf)0049 warning([<span class="string">'Nyquist criterion violated. Allowed intervals are'</span> <span class="keyword">...</span>0050 <span class="string">' ]0,0.5[ for positive and ]-0.5,0[ for negative frequencies'</span>]);0051 <span class="keyword">end</span>;0052 0053 0054 <span class="comment">%</span>0055 <span class="comment">% 2. Checking zero frequency constraint</span>0056 <span class="keyword">if</span> (f0 == 0)0057 error([<span class="string">'Zero frequency is not allowed due to the filter normalization '</span> <span class="keyword">...</span>0058 <span class="string">'(division by zero).'</span>]);0059 <span class="keyword">end</span>;0060 0061 0062 <span class="comment">%</span>0063 <span class="comment">% 3. Checking frequency constraint</span>0064 0065 <span class="comment">%% from [1]</span>0066 <span class="comment">%fPF = erf(pi/alpha*f0);</span>0067 0068 <span class="comment">% more strict from [2] - works for positive and negative frequencies</span>0069 f = f0;0070 L = N;0071 fPF = 1/2*erf(gamma*pi)+1/2*erf((gamma*pi)/abs(f)*(1/2-1/L)-gamma*pi);0072 0073 <span class="keyword">if</span> (fPF < PF)0074 warning([<span class="string">'Filter envelope insufficiently located in the frequency domain. '</span><span class="keyword">...</span>0075 <span class="string">' Requested minimum envelope area inside domain is '</span><span class="keyword">...</span>0076 num2str(100*PF) <span class="string">' percent and currently area is '</span> <span class="keyword">...</span>0077 num2str(100*fPF)]);0078 <span class="keyword">end</span>;0079 0080 0081 <span class="comment">%</span>0082 <span class="comment">% 4. Checking time constraint</span>0083 0084 <span class="comment">% Symmetric part of the filter must contain pt percent of the</span>0085 <span class="comment">% full filter envelope</span>0086 0087 <span class="comment">%% from [1]</span>0088 <span class="comment">%fPT = erf(alpha*floor((N-1)/2));</span>0089 0090 fPT = erf(abs(f)/gamma*(L/2-1));0091 0092 <span class="keyword">if</span> (fPT < PT)0093 warning([<span class="string">'Spatial filter size may be too small. '</span><span class="keyword">...</span>0094 <span class="string">' Requested minimum spatial envelope size is '</span><span class="keyword">...</span>0095 num2str(PT*100) <span class="string">' percent and current size is '</span><span class="keyword">...</span>0096 num2str(100*fPT)]);0097 <span class="keyword">end</span>;0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108</pre></div><hr><address>Generated on Fri 23-Nov-2007 14:52:42 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -