Hello I am working on converting a Matlab implementation of gabor filtering to Java using OpenCV 3.1
I am using the PhD face recognition toolbox to implement the gabor filtering in Matlab. Here is the documentation for this toolbox: [PhD Toolbox pdf](http://luks.fe.uni-lj.si/sl/osebje/vitomir/pub/PhD_manual.pdf)
getGaborKernel's corresponding PhD function is construct_Gabor_filters_PhD. Here is its prototype:
> filter_bank => construct_Gabor_filters_PhD(num_of_orient,> num_of_scales, size, fmax, ni, gamma,> separation);
The documentation defines the parameters in this way:
> Parameters:>> num_of_orient - a scalar value> determining the number of filter > orientations of the filter bank (obligatory> argument)>> num_of_scales - a scalar value> determining the number of filter> scales of the filter bank (obligatory argument)> size - a scalar value> or matrix of size 1x2, which> determines the size of the constructed Gabor > filters; the size has to be equal to the size of > the image that you would like to filter; if you > provide only a scalar a bank of square filters of > size "size x size" will be build (obligatory> argument)>> fmax - the maximal> frequency of the filters in the bank> (default: 0.25)>> gamma - a scalar value> determining the x-axis sharpness; > default: gamma = sqrt(2)>> ni - a scalar value> determining the y-axis sharpness; > default: ni = sqrt(2)>> separation - a scalar value> determinig the step between two> consequtive filter scales; default: sqrt(2)
I am not sure how the construct_Gabor_filters_PhD prototype and parameters relate to OpenCV's getGaborKernel. Can anyone explain the relationship between the two sets of parameters?
>Mat getGaborKernel(Size ksize, double sigma, double theta, double lambd, double gamma, double psi=CV_PI*0.5, >int ktype=CV_64F )>>Parameters: >>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
>>lambd – 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
Here is the specific line of code I am trying to convert:
>filterbank = construct_Gabor_filters_PhD(8,5,196*180);
So far I know I need to create 40 filters using getGaborKernel 40 times with varying "filter orientations" and "filter scales". I'm guessing the variation in orientation and scale should correspond to variations in theta and lambd? As for the rest of the conversion, I am unsure. Any help and guidance in completing this conversion would be greatly appreciated
↧