Ask Your Question
1

how to extract gabor feature using opencv?

asked Sep 4 '14

tidy gravatar image

Does the latest OpenCV version have the function to get this feature?

Preview: (hide)

1 answer

Sort by » oldest newest most voted
5

answered Sep 4 '14

berak gravatar image

updated Sep 4 '14

yes.

you create a Gabor Kernel (beware, 3.0 docs only), then use it with filter2d .

cv::Mat kernel = cv::getGaborKernel(cv::Size(kernel_size,kernel_size), sig, th, lm, gm, ps);
cv::filter2D(src_f, dest, CV_32F, kernel);

(both in opencv2/imgproc/imgproc.hpp)

Preview: (hide)

Comments

This is nice! Since when this function exists?

thdrksdfthmn gravatar imagethdrksdfthmn (Sep 4 '14)edit
2

a good year or so.

berak gravatar imageberak (Sep 4 '14)edit

What are you supposed to do with dest to get a feature out of it. I though you had to sum the squares of the pixel values to get the 'Gabor energy', however, this seems to loose the sign of the Gabor filter, see my question here: http://answers.opencv.org/question/42056/does-using-gabor-energy-disregard-the-sign-of-the/

_Robert gravatar image_Robert (Sep 15 '14)edit

@_Robert, no idea, what you want from the energy, i.e i use the filtered dest img to get an lbp histogram (use it as an edge filter), [well a bank of 4 filters, and concatenate the resulting histograms]

berak gravatar imageberak (Sep 15 '14)edit

@berak could you post somewhere a piece of code with getting lpb histograms? I don't know how to connect gaborFilter output with features extraction...

Araneo gravatar imageAraneo (Nov 16 '14)edit

@Areano, maybe similar to this one ? (you'll probably want a more 'rectangular' grid for your iris example)

berak gravatar imageberak (Nov 16 '14)edit

@berak thank you very much for your respone. Really appreciate it.

Araneo gravatar imageAraneo (Nov 17 '14)edit

@berak in the begining, I want to apologize for disturbing you, but I have a question - It will be okay if I just replace your square grid to rectangular one? For example 16x8? I really don't get it. :(

Araneo gravatar imageAraneo (Nov 17 '14)edit

@Araneo, yes, definitely , for your iris case you'd wnat/need a rectangular one.

berak gravatar imageberak (Nov 17 '14)edit

Question Tools

Stats

Asked: Sep 4 '14

Seen: 4,752 times

Last updated: Sep 04 '14