summaryrefslogtreecommitdiff
path: root/gaborFilter.m
blob: 8cf926024cf1b5c628a3c88796a58a095e8bec6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
function fout = gaborFilter(gamma,theta,lambda,sigma)
    sigma_x = sigma;
    sigma_y = sigma/gamma;

    sz=fix(4*max(sigma_y,sigma_x));

    [x y]=meshgrid(-sz:sz,sz:-1:-sz);

    % Rotation 
    x_theta=x*cos(theta)+y*sin(theta);
    y_theta=-x*sin(theta)+y*cos(theta);

    fout=filterNorm(exp(-0.5*(x_theta.^2/sigma_x^2+y_theta.^2/sigma_y^2)).*exp(2*i*pi/lambda*x_theta));