Ask Your Question
0

How to use Gabor Filter using Opencv Java API

asked May 8 '15

RB gravatar image

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.

Preview: (hide)

Comments

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.
berak gravatar imageberak (May 8 '15)edit

1 answer

Sort by » oldest newest most voted
0

answered Aug 15 '15

pankra gravatar image

updated Aug 15 '15

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.

Preview: (hide)

Question Tools

2 followers

Stats

Asked: May 8 '15

Seen: 1,576 times

Last updated: Aug 14 '15