2017-10-05 82 views
-1

我已經看到了3種gabor濾波器方程(複數,實數,虛數),但我仍然對這裏實現的方程式感到困惑?有人能告訴我瞭解Gabor濾波器組

  1. 什麼是fu?
  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 

回答