Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with Gabor codes

Status
Not open for further replies.

tebesir

Newbie level 2
Joined
Nov 16, 2006
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,302
hi friends;
i have some problems about Gabor filters. i wrote codes for the Gabor filter given below. but my results are not as same as the results in this link, **broken link removed**.

could you please write me what my mistakes are.

Thanks a lot for your helps.

The Gabor Codes:

theta=input('theta between 0-360='); theta
lamda=input('wavelength=');
if lamda<2
fprintf 'invalid value(it must be >= 2)'
lamda=input('lamda=');
end
lamda % lamda = 1/spat. freq (lamda --> pixel/cycle, freq --> cycle/pixel)

b=input('bandwidth='); % octave
sigma=(lamda/(pi))*(sqrt((log(2))/2))*(((2^b)+1)/((2^b)-1)); %standard deviation
sx=sigma, sy=sigma

for x=-fix(sx) : fix(sx) % for row
for y=-fix(sy) : fix(sy) % for coloumn
xp=x*cosd(theta)+y*sind(theta); % x'
yp=-x*sind(theta)+y*cosd(theta); % y'

G(x+fix(sx)+1,y+fix(sy)+1)=exp(-((xp^2)+(yp^2))/(2*sigma^2))*cos(((2*pi*xp/lamda))+pi/2);
end
end
G

RGB = imread('lena.jpg'); % RGB image
I = rgb2gray(RGB); % make it grayscale(intensity)

if isa(I,'double')~=1 % make it double
I =double(I);
end

Imgabout = conv2(I,double(imag(G)),'same');
Regabout = conv2(I,double(real(G)),'same');

gabout = sqrt(Imgabout.*Imgabout + Regabout.*Regabout);

subimage(uint8(I)), title('Original Image');
figure, subimage(uint8(gabout)), title('Filtered Image')
 

Re: Gabor problem

Hi,
h**p://www.csse.uwa.edu.au/~pk/studentprojects/raymondthai/RaymondThai.pdf
h**p://www.cse.msu.edu/cgi-user/web/tech/search?ANDOR=&AUTHORID=197
h**p://www.mathworks.com/matlabcentral/fileexchange/loadCategory.do?objectType=category&objectId=131&objectName=Filtering
h**p://www.mathworks.com/matlabcentral/fileexchange/saveRating.do
regards,
sanbaba
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top