you extract high frequency information in image. The necessary condition of high filter, the sum of filter gb(x,y) is 0 (x=0..N-1 , y=0..N-1) (N=3,5,7.. or windows 3x3 or 5x5 or 7x7 or 9x9 or 11x11, ...31x31). gb(x,y) is your filter, the value of filter is real (your choice the cos or sin, your result is dephased PI/2 compared sin, no need to use complex Gabor filter). It's very simple.It's high passe oriented filter.
% See http://en.wikipedia.org/wiki/Gabor_filter.
x_theta=x*cos(theta)+y*sin(theta);
y_theta=-x*sin(theta)+y*cos(theta);
gb= exp(-.5*(x_theta.^2/sigma_x^2+y_theta.^2/sigma_y^2)).*cos(2*pi/lambda*x_theta+psi);
Def
C = conv2(A, B) performs the 2-D convolution of matrices A and B.
If [ma,na] = size(A), [mb,nb] = size(B), and [mc,nc] = size(C), then
mc = max([ma+mb-1,ma,mb]) and nc = max([na+nb-1,na,nb]).
ma,na size of filter not same size of mb and nb. ma
Example, if you have the image 128x128 pixel resolution, the filter size is only na<128, and ma<128. The filter should not be very large.
Or
filter2 Two-dimensional digital filter.
Y = filter2(B,X,SHAPE) filters the data in X with the 2-D FIR
filter in the matrix B. The result, Y, is computed
using 2-D correlation and is the same size as X (SHAPE is 'same').
is same thing, but the B is the filter. I choice the second. SHAPE value is,
'same' - (default) returns the central part of the
correlation that is the same size as X.
'valid' - returns only those parts of the correlation
that are computed without the zero-padded
edges, size(Y) < size(X).
'full' - returns the full 2-D correlation,
size(Y) > size(X).