Ask Your Question

Revision history [back]

According to the source code of the getGaborKernel() function (see here or refer to the source of OpenCV 2.4.9), it only returns the real part of a Gabor filter (see more at Gabor filter at wiki). For the imaginary part, you can change the source code line from:

double v = scale*std::exp(ex*xr*xr + ey*yr*yr)*cos(cscale*xr + psi);

to:

double v2 = scale*std::exp(ex*xr*xr + ey*yr*yr)*sin(cscale*xr + psi);

and return the Mat object containing all the needed values.