繁体   English   中英

了解 Gabor 滤波器组

[英]Understanding Gabor filter bank

我见过 3 种类型的 gabor 滤波器方程(复数、实数、虚数),但我仍然对这里实现的方程感到困惑? 谁能告诉我

  1. 什么是福?
  2. 为什么 fmax=0.25(它是什么?)?
  3. 这里使用哪个方程(gFilter(x,y))?
  4. 为什么 eta & gama = sqrt(2)?

[函数 gaborArray = gaborFilterBank(u,v,m,n)

   % GABORFILTERBANK generates a custum Gabor filter bank. 
   % It creates a u by v cell array, whose elements are m by n matrices; 
   % each matrix being a 2-D Gabor filter.
   % 
   % 
   % Inputs:
   %u   :   No. of scales (usually set to 5) 
   %v   :   No. of orientations (usually set to 8)
   % m  :   No. of rows in a 2-D Gabor filter (an odd integer number, 
   %usually set to 39)
   % n  :   No. of columns in a 2-D Gabor filter (an odd integer number, 
   %usually set to 39)
   % 
   % Output:
   % gaborArray: A u by v array, element of which are m by n 
   % matries; each matrix being a 2-D Gabor filter   
   % 
   % 
   % Sample use:
   % 
   % gaborArray = gaborFilterBank(5,8,39,39);
   % 
   if (nargin ~= 4)    % Check correct number of arguments
   error('There must be four input arguments (Number of scales and 
   orientations and the 2-D size of the filter)!')
   end

    %% Create Gabor filters
    % Create u*v gabor filters each being an m by n matrix
    m=double(int32(m));
    n=double(int32(n));
    gaborArray = cell(u,v);
    fmax = 0.25;
    gama = sqrt(2);
    eta = sqrt(2);

    for i = 1:u

    fu = fmax/((sqrt(2))^(i-1));
    alpha = fu/gama;
    beta = fu/eta;

    for j = 1:v
    tetav = ((j-1)/v)*pi;
    gFilter = zeros(m,n);

    for x = 1:m
        for y = 1:n
            xprime = (x-((m+1)/2))*cos(tetav)+(y-((n+1)/2))*sin(tetav);
            yprime = -(x-((m+1)/2))*sin(tetav)+(y-((n+1)/2))*cos(tetav);
            gFilter(x,y) = (fu^2/(pi*gama*eta))*exp(-((alpha^2)*(xprime^2)+(beta^2)*(yprime^2)))*exp(1i*2*pi*fu*xprime);
        end
    end
    gaborArray{i,j} = gFilter;

end
end

您是否考虑过使用 MATLAB 中已有的 Gabor 过滤功能?

https://www.mathworks.com/help/images/ref/gabor.html https://www.mathworks.com/help/images/ref/imgaborfilt.html

试图理解这段代码可能是一个更好的选择。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM