matlab练习程序(Gabor Filter)

clear all;
close all;
clc;

img=imread('lena.jpg');
imshow(img);

phi=pi/2;
theta=2;
sigma=0.65*theta;
filterSize=6;

G=zeros(filterSize);

for i=(0:filterSize-1)/filterSize
    for j=(0:filterSize-1)/filterSize
        xprime=j*cos(phi);
        yprime=i*sin(phi);
        K=exp(2*pi*theta*sqrt(-1)*(xprime+yprime));
        G(round((i+1)*filterSize),round((j+1)*filterSize))=exp(-(i^2+j^2)/(sigma^2))*K;
    end
end

J=conv2(double(img),G);
figure,imshow(uint8(J));

参考:

1.http://stackoverflow.com/questions/7419409/image-processing-using-gabor-filter

2.http://en.wikipedia.org/wiki/Gabor_filter

3.http://blog.csdn.net/abcjennifer/article/details/7360436

posted @ 2012-04-29 15:07  Dsp Tian  阅读(4779)  评论(0编辑  收藏  举报