Ask Your Question
1

how to extract gabor feature using opencv?

asked 2014-09-03 21:42:32 -0600

tidy gravatar image

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

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
5

answered 2014-09-04 00:21:09 -0600

berak gravatar image

updated 2014-09-04 02:46:15 -0600

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)

edit flag offensive delete link more

Comments

This is nice! Since when this function exists?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2014-09-04 02:34:40 -0600 )edit
2

a good year or so.

berak gravatar imageberak ( 2014-09-04 02:47:09 -0600 )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 ( 2014-09-15 14:17:57 -0600 )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 ( 2014-09-15 14:25:04 -0600 )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 ( 2014-11-16 09:58:48 -0600 )edit

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

berak gravatar imageberak ( 2014-11-16 13:57:48 -0600 )edit

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

Araneo gravatar imageAraneo ( 2014-11-17 11:48:16 -0600 )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 ( 2014-11-17 12:05:23 -0600 )edit

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

berak gravatar imageberak ( 2014-11-17 12:11:23 -0600 )edit

Question Tools

Stats

Asked: 2014-09-03 21:42:32 -0600

Seen: 4,723 times

Last updated: Sep 04 '14