I have troubles understanding in an intuitive way (not by writing complicated math formulas) what is the meaning of the lambda parameter in the Gabor functions. (I have basic math understanding, grad level, but this look a bit too much for me)
Is it a parameter that controls the sinusoidal part of the function? Or the gaussian part of it? And why those funny effects at $\pi/2$ ?
Here is the formula, from Wiki (real part of the equation): $ g(x, y; \lambda, \theta, \psi, \sigma, \gamma) = \exp \left(- \frac{x'^2 + \gamma^2 y'^2}{2 \sigma^2} \right) \cos \left( 2\pi \frac{x'}{\lambda} + \psi \right)$
Were
$x' = x \cos \theta + y \sin \theta$
and
$y' = -x \sin \theta + y \cos \theta$
And here are some pictures, where I varied lambda:
$\lambda = \pi$
$\lambda = \pi/2$
$\lambda = \pi/4$
The other parameters are as follows: $ \sigma = 3 \\ \theta = -\pi/4 \\ \gamma = 1 \\ \psi = \pi $
Edit The code I use is below (taken from OpenCV)
cv::Mat cv::getGaborKernel( Size ksize, double sigma, double theta, double lambd, double gamma, double psi, int ktype ) { double sigma_x = sigma; double sigma_y = sigma/gamma; int nstds = 3; int xmin, xmax, ymin, ymax; double c = cos(theta), s = sin(theta); if( ksize.width > 0 ) xmax = ksize.width/2; else xmax = cvRound(std::max(fabs(nstds*sigma_x*c), fabs(nstds*sigma_y*s))); if( ksize.height > 0 ) ymax = ksize.height/2; else ymax = cvRound(std::max(fabs(nstds*sigma_x*s), fabs(nstds*sigma_y*c))); xmin = -xmax; ymin = -ymax; CV_Assert( ktype == CV_32F || ktype == CV_64F ); Mat kernel(ymax - ymin + 1, xmax - xmin + 1, ktype); double scale = 1/(2*CV_PI*sigma_x*sigma_y); double ex = -0.5/(sigma_x*sigma_x); double ey = -0.5/(sigma_y*sigma_y); double cscale = CV_PI*2/lambd; // Here is the interesting part. What happens here? for( int y = ymin; y <= ymax; y++ ) for( int x = xmin; x <= xmax; x++ ) { double xr = x*c + y*s; double yr = -x*s + y*c; double v = scale*exp(ex*xr*xr + ey*yr*yr)*cos(cscale*xr + psi); if( ktype == CV_32F ) kernel.at(ymax - y, xmax - x) = (float)v; else kernel.at(ymax - y, xmax - x) = v; } return kernel; }