From: Ravi Bhanushali on
can anybody tell me that,
is this code is correct...

clear all;
close all;
clc;
I = imread('1.pgm');
%I = imread('k110.jpg');
%I = rgb2gray(I);
I = imresize(I,[140,140]);
%figure,imshow(I);
I=NormalizeFace(I);
I=padarray(I,[50/2,50/2],'symmetric','both');
%figure,imshow(uint8(I));
sx=3.7;
sy=8.0;
%pi=22/7;
t=0;
%F=128/256;
%F=0.117188;
F=0.1058
%generate elliptical gabor filter
for x=1:50
for y=1:50
x1=x*cos(t)+y*sin(t);
y1=y*cos(t);-x*sin(t);
g=(1.0/(2.0*3.14*sx*sy))* exp((-1.0/2.0)*((x1/sx)^2 + (y1/sy)^2));
G(x,y)=g * exp(F*sqrt(x^2+y^2)*2.0*3.14*i);
end
end
%Imgabout = conv2(double(I),double(imag(G)),'same');
%Regabout = conv2(double(I),double(real(G)),'same');
%gabout = uint8(sqrt(Imgabout.*Imgabout + Regabout.*Regabout));
%plot(G);
%figure,mesh(Imgabout);
%figure,mesh(Regabout);
%figure,imshow((G));
%figure,imshow((Imgabout));
%figure,imshow((Regabout));
%figure,imshow((gabout));
rsImg = zeros(140,140); %result image
%applying elliptical gabor filter to an image
for x=1:140
for y=1:140
SI=I(x:x+50-1,y:y+50-1);
IF=double(SI) .* G;
sm=sum(IF(:))./2500;
rsImg(x,y)=sm;
end
end
have i applied the filter to an image in right way???
From: Bruno Luong on
"Ravi Bhanushali" <ravimav2000(a)yahoo.com> wrote in message <houj6b$bpo$1(a)fred.mathworks.com>...

> x1=x*cos(t)+y*sin(t);
> y1=y*cos(t);-x*sin(t);

The semicolon in the middle of the second statement looks fishy to me.

Bruno