function [gb_r, gb_i] = get_gabor_kernel(theta, sigma, gamma, lambda)

%creation of grid
[X, Y] = meshgrid(-20:20);

%rotation of local coord system with theta
rot_x = X.*cos(theta) + Y.*sin(theta);
rot_y = -X.*sin(theta) + Y.*cos(theta);

%calculation of the real and imaginary part of the gabor filter
gb_r = exp(-(rot_x.^2 + gamma^2*(rot_y).^2)/(2*sigma^2)) .* cos(2 * pi * rot_x./lambda);
gb_i = exp(-(rot_x.^2 + gamma^2*(rot_y).^2)/(2*sigma^2)) .* sin(2 * pi * rot_x./lambda);
end
