How to use Gabor Filter using Opencv Java API

i want to use Gabor filter usin gopencv with java API. i referred to the docs, and it is as follows:

getGaborKernel

 public static Mat getGaborKernel(Size ksize,
double sigma,
double theta,
double lambd,
double gamma,
double psi,
int ktype)


my problem is that i do not know how to specify the parameters, for an exampel, the Size, should it be the size of the image or what?

please provided brief explanation concerning how to use the parameters.

edit retag close merge delete

2

stolen from here:

• ksize Size of the filter returned.
• sigma Standard deviation of the gaussian envelope.
• theta Orientation of the normal to the parallel stripes of a Gabor function.
• lambda Wavelength of the sinusoidal factor.
• gamma Spatial aspect ratio.
• psi Phase offset.
• ktype Type of filter coefficients. It can be CV_32F or CV_64F.
( 2015-05-08 06:58:36 -0500 )edit

Sort by » oldest newest most voted

ksize - si the size of the window, not the entire matrix. i.e. 17x17, 21x21, ... always odd number.
lambda - wavelenght, the thickness of the wave. can be 10, 15, 20, 30 or whatever you want.
sigma - standard deviation. it's defined like X*lambda, 0< X < 1. But you also can asign any number.
theta - is the orientation (in degrees) of your filter. can be 0 to 360.
gamma - is de width of the wave (elipticity). between 0.02 and 1. 1 is round, 0.02 is practically a line.
psi - is the offset of phase(in degrees). can be 0, 90, -90, 180, -180. if you want the wave to process the image as it. is, you should asign 0.
ktype - is CvType.CV_32F or CvType.CV_64F.

more