summaryrefslogtreecommitdiff
path: root/gaborFilter.m
blob: 8cac0bdefd3d36f21f7017946e5cafcc9f14b8d2 (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)).*cos(2*pi/lambda*x_theta));