Search code examples
opencvimage-processingpattern-matchingcomputer-visionobject-recognition

Big differences in image filtered with rotated Gabor kernels


I have calculated 8 Gabor filters with Theta rotation m*PI/8.

Parameters of the Gabor kernel given as input to OpenCv cv2.getGaborKernel: ksize = 11, theta = m*PI/8 lambd = 16/3 sigma = (5.09030 * 8.0) / (3.0 * PI) gamma = 0.5890 psi = 0

kernel = cv2.getGaborKernel(ksize = (ksize,ksize), sigma = sigma, 
               theta = theta, lambd = lambd, 
                               gamma = gamma, psi = psi)

The parameters are designed according to "Features Extraction using a Gabor filter family", Zhen, Zhao, Wang. The formula adopted is the one of the third family of Gabor filters.

The 8 filters obtained are:

Obtained Gabor filters

The original image is:

enter image description here

The images obtained by filtering the images are:

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

They are calculated with cv2.filter2D

fimg = cv2.filter2D(img, cv2.CV_64F, kernel)

Why the gabor filters with theta = 0 and theta = PI / 2.0 have a really different continuous component compared to the others? It does not really make sense to me.


Solution

  • The reason was the PSI param that I set to 0. The problem is immediatly fixed is psi is kept at the default value PI/2.