MATLAB Answers

im very new to matlab...i downloaded the code from net..bet when i try to run it it shows an error "not enough input arguments"...please help me

1 view (last 30 days)
sujithra krishnan
sujithra krishnan on 28 Apr 2015
Answered: Hassan Dehghani on 28 Apr 2015
%The second it that one needs to convert the image into the frequency
%domain, multiply the spectra and then take the inverse of the result.
function [G,gabout] = gaborfilter2(I,Sx,Sy,f,theta)
if isa(I,'double')~=1 I = double(I); end
for x = -fix(Sx):fix(Sx) for y = -fix(Sy):fix(Sy) xPrime = x * cos(theta) + y * sin(theta); yPrime = y * cos(theta) - x * sin(theta); G(fix(Sx)+x+1,fix(Sy)+y+1) = exp(-.5*((xPrime/Sx)^2+(yPrime/Sy)^2))*cos(2*pi*f*xPrime); end end
Imgabout = conv2(I,double(imag(G)),'same'); Regabout = conv2(I,double(real(G)),'same');
gabout = sqrt(Imgabout.*Imgabout + Regabout.*Regabout);

  0 Comments

Sign in to comment.

Answers (1)

Hassan Dehghani
Hassan Dehghani on 28 Apr 2015
this is a function, I, Sx, Sy, f, theta are the inputs. try typing something like this,
[G,gabout] = gaborfilter2(1,2,3,4,30)
I don't know what I, Sx,Sy,and f are, so you should change them.

  0 Comments

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by