Code covered by the BSD License  

Highlights from
Gabor Feature Extraction

4.78947
4.8 | 44 ratings Rate this file 642 Downloads (last 30 days) File Size: 2.49 KB File ID: #44630
image thumbnail

Gabor Feature Extraction

by

 

06 Dec 2013 (Updated )

This program generates a custom Gabor filter bank; and extracts the image features using them.

| Watch this File

File Information
Description

First function named "gaborFilterBank" generates a custom-sized Gabor filter bank. It creates a u*v array, whose elements are m by n matrices; each matrix being a 2-D Gabor filter.
Second function named "gaborFeatures" extracts the Gabor features of the image.
It creates a column vector, consisting of the image's Gabor features.
At the end of each file there is a Show section that plots the filters and shows the filtered images. These are only for illustration purpose, and you can comment them as you wish.
 
Details can be found in:
 
M. Haghighat, S. Zonouz, M. Abdel-Mottaleb, "Identification Using Encrypted Biometrics," Computer Analysis of Images and Patterns, Springer Berlin Heidelberg, pp. 440-448, 2013.

Required Products Image Processing Toolbox
Signal Processing Toolbox
MATLAB
MATLAB release MATLAB 8.4 (R2014b)
MATLAB Search Path
/
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (129)
24 Mar 2015 aniseija

sir,could you please send your paper and matlab code.I am working on face detection system using gabor filter.my email is eijaazman92@gmail.com
thanks

23 Mar 2015 Pervez Bhan

Hello Mohammad , Could you please send your paper and matlab code. my email is pervezbhan219@yahoo.com
Best regards
Bhan

Comment only
18 Mar 2015 bluer Xing

Hi Mohammad,I am doing something about character recognition,your work is so helpful for it, Can you please send me your paper to my email bluer411945935@gmail.com?
Thanks

13 Mar 2015 PhingPhing  
13 Mar 2015 qu

qu (view profile)

May I ask you some questions? If I use the program to recognize the texture of tongue,how to change the parameters,such as fmax,gama,eta,is there any rule to choose the value of parameters?Thank you!

10 Mar 2015 Charles

Hi Mohammad, nice work. Can you please send me your paper to my email chmabox@gmail.com?
Thanks.

04 Mar 2015 batool allami

Hello sir, could you please send me your paper with the matlab code . I am working on gabor filter. My email id is batoolallami8@gmail.com,
thanks

Comment only
02 Mar 2015 chaperon chaperon

Hello Mohammad, could you please send me your paper with the matlab code as i am interested in working on gabor filter. My email id is asmaa.touil@gmail.com,
thanks

Comment only
27 Feb 2015 amina amm

Hi Mohammad,

In your paper these steps are performed.

Dimensionality Reduction
Feature Quantization using K D tree.
Crete Predicate.
Generate Token.
But here only second step i.e Gabor features extraction code is available, rest of steps not available in your code.
Please send these code to my email.

amm.amina85@gmail.com
Thanks
Akshay Gore

Comment only
24 Feb 2015 NCTU

NCTU (view profile)

Could you send me the paper "Identification Using Encrypted Biometrics," pls. Thanks a lot!
joannahsu82@hotmail.com

23 Feb 2015 Mohammad Haghighat

Thank you for your comments and interest.
I just sent you the paper.

Comment only
20 Feb 2015 hemavathi N

Hello Sir, can you please send me your paper for reference.
My email id is hema15sg@gmail.com
Regards
Hema

19 Feb 2015 Naser

Naser (view profile)

Hello Mohammad , Could you please send your paper and matlab code. my email is naser46912@gmail.com
Best regards
Naser

19 Feb 2015 Annatoma Arif

Hi, could you please send me your paper along with the matlab code as i am interested in working on gabor filter. My email id is annatoma_arif@yahoo.com

Comment only
16 Feb 2015 Danny Prasetyo

Hello Mohammad , Could you please send your matlab code ? cz im working on project about gabor .. my email : khokhodhannie@gmail.com

Comment only
11 Feb 2015 Purvi Shetty

sir could you please send me the above sited paper to purvishetty24@gmail.com
sir do i need to make any changes for palm print recognition

08 Feb 2015 avinash biradar

Sir,please send me matlab code of feature extraction using gabor wavelet and also send ur paper of how to extract the feature from an image on my email avibiradar10@gmail.com

Comment only
01 Feb 2015 Eucassio Lima Júnior

Hi, Mohammad sir, could you please send your paper to my mail id eucassiojr@gmail.com

Comment only
31 Jan 2015 A B

A B (view profile)

Please send me your paper to basma_ammour@yahoo.com

Comment only
30 Jan 2015 Praveen

Hi, Mohammad sir, could you please send your paper to my mail id gbpraveen8@gmail.com

after applying gabor feature extraction to my image. i get feature vectors, how to get energy, and other features from the feature vectors.

Comment only
29 Jan 2015 Mohammad Haghighat

ait mohamed linda:

Your image size is small, and the size 11 is a prime number. So, it is better to set the downsampling factors to be 1 (d1=d2=1).
You should also adjust the filter size according to your image size, don't just use the default size of 39.

Comment only
28 Jan 2015 ait mohamed linda

Good day, Sir! I am using the gaborFeatures function. I always get this error: A(I) = X: X must have the same size as I (pointing to this line: featureVector(((c-1)*s+1):(c*s)) = gaborAbs;). My image size is small 11*11
please help me

28 Jan 2015 Praveen

sir could you please send the paper to gbpraveen8@gmail.com

23 Jan 2015 shawn lin

Hi, Mohammad ! Would you please send your paper to me? My email address is shawn.shuai.lin@gmail.com. Many thanks!

18 Jan 2015 Mohamed

Could you please send me your paper "Identification Using Encrypted Biometrics,"
My email is: m7md.khairy@gmail.com

Comment only
17 Jan 2015 Silas

Silas (view profile)

Please send me your paper to silasnjeru@gmail.com

Comment only
15 Jan 2015 Mohammad Haghighat

Umme:

Thank you for the 5-star vote. I just sent you the paper.

Comment only
15 Jan 2015 Mohammad Haghighat

Shailesh:

Can you please email me a sample image that you use?

Comment only
12 Jan 2015 Umme

Umme (view profile)

Could you please,send me your paper to my email ? yoko_shii@hotmail.com

Comment only
12 Jan 2015 Umme

Umme (view profile)

 
06 Jan 2015 Shailesh

Hello sir, i implemented your code on my text word image but i am getting all zeors in feature vector output. please help me...

Comment only
02 Jan 2015 Thomas Tan

Dear Sir, I facing the problem while i input the img = imread('101_1.tif');(101_1.tif is the image that i input) it will runs all the loop over and over again. such as real part and magnitude windows pop up continuously.

Comment only
01 Jan 2015 Lim

Lim (view profile)

 
31 Dec 2014 Farshad  
25 Dec 2014 mobeen net

Thank you very much for your work. Could you send your paper to this address amir_elek87@yahoo.com I really appreciate your help.

05 Dec 2014 Mohammad Haghighat

Nina:

Your image size is not a factor of 4, neither 146 nor 234. You should either resize the image or use other downsampling factors.

Comment only
01 Dec 2014 Nina Kamilla Quiazon

Good day, Sir! I am currently using the gaborFeatures function. I always get this error: A(I) = X: X must have the same size as I (pointing to this line: featureVector(((c-1)*s+1):(c*s)) = gaborAbs;). My image size is 146x234. Does that have anything in relation to the error I get? I am using d1 and d2 = 4.Thank you!

Comment only
01 Dec 2014 Nina Kamilla Quiazon

By the way, I am using d1 and d2 = 4. Your reply will be very helpful. Thank you!

Comment only
22 Nov 2014 Mohammad Haghighat

Shanmugam:

m & n define the size of filter and cannot be set to 1.

Comment only
18 Nov 2014 SHANMUGAM RAMASAMY

Hi, I am shanmugam, I am using your code for image quality assessment. I am not able to understand the usage of m and n ?
Can they be set equal to 1 , All i want is for the code to return a u*v column vector for each pixel in the image ! Thank you.

18 Nov 2014 qu

qu (view profile)

 
18 Nov 2014 qu

qu (view profile)

 
15 Nov 2014 Mohammad Haghighat

Hillol:

d1 and d2 does not have any effect on computational complexity, but m & n have direct relation. You may want to deduce m and n if you are not interested in high frequency features in your images.

Comment only
15 Nov 2014 Mohammad Haghighat

Sherko:

To the best of my knowledge, there is no relationship between the size of the image and the filter bank. The number of scales and orientations are arbitrary and mostly dependent on your application and image content and if you are interested in high frequency features or not.

Comment only
11 Nov 2014 Mehran Kh  
09 Nov 2014 HILLOL

HILLOL (view profile)

Hello Haghighat, I am using your code for scene identification purpose. Here I have around 100 240x320 images, each of the images are divided into 60x60 patches and I need to extract features from each of these patches. So computation time has become very high. Please tell me how to adjust d1,d2,m and n to reduce time as well as length of feature vector? And it would be great if you could send me your paper. my email address:
hillolchakrabarty40@gmail.com

08 Nov 2014 Sherko

Sherko (view profile)

Dear Haghighat , thanks so much for quick reply. I'm new in gabor filter, My question is that if there is any relation between filter bank and Image size? i.e What is the best way to specify the number of scales and orientations? by trial and error or any thing else?

thank you

Comment only
08 Nov 2014 Mohammad Haghighat

Sherko:

Selecting the downsampling factor is a trade-off problem, and it mostly depends on you input image and the application. For example, if you have a finely detailed image, you cannot choose a large downsampling factor, because you may loose information. But on the other hand, a smaller downsampling factor leads to a larger feature vector, which is not good either.

But for sure, (d1 & d2 ) = 64,60 or (d1 & d2) = 32,30 for an image of size 128x120 is too much! I would rather using a lower downsampling factor, like 4, and then apply a dimensionality reduction approach to reduce the feature vector size.

Thank you for your comment. I sent you the paper.

Comment only
08 Nov 2014 Sherko

Sherko (view profile)

Dear Mr. Haghighat, my image size is 128x120 when the factors for (d1 & d2 ) = 64,60 then we have 160 features , if (d1 & d2)=32,30 then the number of features will be 640 and so on. My question is that which factor is best? largest,lowest ...,etc. How the factor affect on the recognition process?

Thank you

Comment only
08 Nov 2014 Sherko

Sherko (view profile)

Please,Could you send me your paper to my email ?sherko.rahman@gmail.com

06 Nov 2014 Thuvanan

Could you please send me your paper to my email
Thuvanan.bo@up.ac.th

06 Nov 2014 Thuvanan  
05 Nov 2014 Mohammad Haghighat

Ahammed and Popy:

Thank you for the 5-star votes. I sent you the paper.

Comment only
05 Nov 2014 popy meilina

Could you please send me your paper to my email popy.meilina@gmail.com

thank you

27 Oct 2014 Ahammed

Hi, Thanks for the program. Can you please email me your paper to shahidpk74@gmail.com .

18 Oct 2014 Mohammad Haghighat

Hamid:

You can extract it from "gaborResult".

Comment only
15 Oct 2014 Hamid OUANAN

Thank you very much for your work. i have just an question: in your work you have just used the Magnitude of Gahbor features (feautrevector). how i can recover phase if i need ??
Thanks for advances

15 Oct 2014 Hamid OUANAN  
15 Oct 2014 Mohammad Haghighat

You can use the Matlab Toolbox for Dimensionality Reduction available at:

http://homepage.tudelft.nl/19j49/Matlab_Toolbox_for_Dimensionality_Reduction.html

Comment only
12 Oct 2014 Husdi

Husdi (view profile)

sarv

we had the same problem

Comment only
12 Oct 2014 sarv

sarv (view profile)

Thanks,I want to use the result of feature vector in classification but the result is too large, how can I solve this problem?

Comment only
11 Oct 2014 Husdi

Husdi (view profile)

I have read the papers that you suggest "Identification Using Encrypted Biometrics," . ' and there explained that " The feature vector is still very large even after downsampling. Therefore, we will
need to use dimensionality reduction methods [5].For dimensionality reduction, we use general discriminant analysis (GDA)" , how the sample GDA source code in matlab?

Comment only
11 Oct 2014 Husdi

Husdi (view profile)

I want to make the results of this Gabor " featureVector " for classification but vectornya very large size and computation time becomes very long .. , please help me how to use the results of Gabor feature vector size is not too big ?

Comment only
10 Oct 2014 Mohammad Haghighat

Sarv:

You choose downsampling factor of 4 but 4 is not a factor of 374 (your image size).

Comment only
10 Oct 2014 sarv

sarv (view profile)

Hi, Thanks for your code. I test your code for 'Cameraman.tif' that work properly. But when I test it by my image this error happened.
My image is 374*388 unit8, I run
img = imread('101_1.tif');
if ndims(img) == 3;img=rgb2gray(img);end
gaborArray = gaborFilterBank(5,8,39,39);
featureVector =gaborFeatures(img,gaborArray,4,4);

The error is:

In an assignment A(I) = B, the number of elements in B and I must be the same.
(line86)featureVector(((c-1)*s+1):(c*s)) = gaborAbs;

if I comment this line the output is 0

Could you please help me?


Comment only
25 Sep 2014 Mohammad Haghighat

qu:

m*n is the filter size, which is usually smaller than the image.

Comment only
24 Sep 2014 qu

qu (view profile)

Is there someone who can tell me if the parameter m/n is the size of the image i want to process?

23 Sep 2014 Vero

Vero (view profile)

Nice work. Could you please send me your paper to this address veronica.aramendia@gmail.com.
I really appreciate your help.

22 Sep 2014 Mohammad Haghighat

Yan:

Thanks for your comment and the 5-star vote. I just sent you the paper.

Comment only
22 Sep 2014 Mohammad Haghighat

Indra:

Are you sure the complexity comes from the Gabor feature extraction step? Because for the size of image you mentioned, the feature extraction takes fraction of a second.

Comment only
20 Sep 2014 Indra

Indra (view profile)

Thank you for your work. I have question regarding implementation your work. I would like to extract features from my datasets (positive and negative) in order to detect head-shoulder of human body.

However, when I apply it takes so slow and long time in processing, especially during the detection while I am using scanning window detection for the detection part. How do I speed up the processing of gabor features extraction, if have image resolution 768x649 pixel size?

Thank you

20 Sep 2014 Yan Xu

Yan Xu (view profile)

Thank you very much for your work. Could you send your paper to this address peterxu1991@gmail.com I really appreciate your help.

11 Sep 2014 Husdi

Husdi (view profile)

Thank you very much..!

27 Aug 2014 Mohammad Haghighat

Adan:

Thank you for your 5-star vote.
I just sent you the paper.

Comment only
27 Aug 2014 adan jauhary

Could you send me your paper to my email.
thank you

25 Aug 2014 Mohammad Haghighat

Salman:

Thank you for your 5-star vote.
I just sent you the paper.

Comment only
24 Aug 2014 Salman

Salman (view profile)

Could you please send me your paper to my email salnamo@yahoo.com

Thank you.

17 Aug 2014 Diatri Indradewi

Thank you so much

Comment only
16 Aug 2014 Mohammad Haghighat

Diatri:

I just sent it to you.

Comment only
15 Aug 2014 Diatri Indradewi

I need to read your paper to understand this gabor feature extraction. Could you please send it to rakatacimoet@gmail.com? Thank you

Comment only
06 Aug 2014 Mohammad Haghighat

Andre:

I just sent the paper to your e-mail.

Comment only
06 Aug 2014 Andre Lukito

Your paper available was actually limited access. Can I fully read your paper so that I can cite the paper? Could you please send it via email to andrelukitok@gmail.com. Thank you

Comment only
24 Jul 2014 Mohammad Haghighat

Sumeet:

I just sent the paper to you.

Comment only
23 Jul 2014 SUMEET

SUMEET (view profile)

Can i have your above cited paper.I dont have access to download this paper.If possible please send it to my email-id.
stylisheng90@gmail.com

I will be very much thankful to you.

Comment only
03 Jul 2014 Hua

Hua (view profile)

good

Comment only
30 Jun 2014 Mohammad Haghighat

Aini Najwa:

I just sent it to you by e-mail.
Sure, you can use it for signature verification. There are some papers that have used Gabor in this application.

Comment only
30 Jun 2014 Aini Najwa Azmi

Assalamualaikum Mohammad,
Please teach me how to get your file... I am a new user of MATLAB.Is the Gabor FE is suitable to a signature recognition system?
If someone already get this file, need your help to send to my email, aininajwa.azmi@gmail.com

Thanks so much

Comment only
25 Jun 2014 Mohammad Haghighat

Andre:

The adjacent pixels in a image are highly correlated; so, we remove the information redundancy by downsampling the feature images. A low downsampling factor will not have a noticeable effect on the recognition accuracy; however, it increases the performance of the classifier.

Comment only
24 Jun 2014 Andre Lukito

hi Mohammad. anyway thanks for the code. I have some questions. What is the impact of downsampling(d1 & d2)? does it removing some samples of the extrated feature? and Is that good to be used to face recognition process? Thanks

Comment only
12 Jun 2014 slimane

please I need to use the Gabor filter for texture analysis and extract features on medical image, there's someone there who can help me
thank you

09 Jun 2014 Mohammad Haghighat

Nawaz:

Sure, you can use it. There are actually papers that have used Gabor for OCR.

Comment only
07 Jun 2014 Nawaz Pasha

Hi, can I use this code for Feature Extraction in Handwritten Optical Character Recognition ?

Comment only
02 Jun 2014 Mohammad Haghighat

Alessandro:

The downsampling factors (d1 and d2) must be factors of the size of the image.

Comment only
01 Jun 2014 Alessandro

I have an error in line 80 of gaborFeatures

Error using downsample
Too many input arguments.

Error in gaborFeatures (line 80)
gaborAbs = downsample(gaborAbs,d1);

Comment only
20 May 2014 Mohammad Haghighat

Kushol:

In order to see the results visually, you just need to uncomment the "Show filtered images" section in the bottom of gaborFeatures.m .

Comment only
15 May 2014 Kushol Manna

how can i ckeck, whether the result is appropriate or not ??

08 May 2014 Kun

Kun (view profile)

 
26 Apr 2014 Mehul Parikh  
17 Apr 2014 shaik farook

hello sir. i want to match two images whether they belongs to same person or not. this can be done by feature extraction. can you please help how to do this. how to extract features. steps or procedure or basic code please sir

Comment only
09 Apr 2014 Mohammad Haghighat

a b:

The downsampling factors (d1 and d2) must be factors of the size of the image.

Comment only
08 Apr 2014 a b

a b (view profile)

Hi Mohammad
I have this problem
In an assignment A(I) = B, the number of elements in B
and I must be the same.

Error in gaborFeatures (line 86)
featureVector(((c-1)*s+1):(c*s)) = gaborAbs;

Error in testGabor (line 11)
featureVector = gaborFeatures(img,gaborArray,4,4); %
Extracts Gabor features

I test my image it is grayscale image tif

Comment only
07 Apr 2014 Mohammad Haghighat

Maithri:

It works on every image on my computer. Maybe your images were RGB! I just took care of that problem. Please download the updated code.

Comment only
07 Apr 2014 Mohammad Haghighat

Mohammad:

There is no recursive loops with any limitations in the code. Most probably the problem is with one of the internal functions of you Matlab. Do you know in which line of the code it happens?

Comment only
07 Apr 2014 Mohammad Haghighat

Milton:

Getting a vector of zeros is very unlikely. Can you please send me the input image that you are using? Then, I may get what the problem is.

Comment only
05 Apr 2014 Maithri

It is working for only 'cameraman.tif' image.. Plzz tell what changes can be made so that we can extract features from other images??

Comment only
04 Apr 2014 Maithri

Thanks.. It works very well..

Comment only
25 Mar 2014 mohammad hossein torabi motlagh fard

the system shows still this error :

Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N) to change the limitation.
I use set(0,'RecursionLimit',1000).still there is error.which part recursively run ?

Comment only
25 Mar 2014 mohammad hossein torabi motlagh fard

the system shows still this error :

Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N) to change the limi

Comment only
24 Mar 2014 mohammad hossein torabi motlagh fard

Thanks for your code mohammad. I run the code but it works same loop . endless .
I want to see feature vector to apply for similarity measurement.
please guide me how to solve the problem .

Comment only
21 Mar 2014 Milton

Milton (view profile)

Hi, thanks to the code , but when i use it to get features in some images i get a vector of zeros,do you mind there is any reason for that ?

Comment only
18 Mar 2014 Steve

Steve (view profile)

Thanks for the update.

14 Mar 2014 Bao Ngoc Nguyen Thi

Do you use a difference formula of gabor filter?

12 Mar 2014 Mohammad Haghighat

Mark:

You are totally right. I first wrote the "gaborFilterBank" code for 8 orientations, and it was still there ;-)
Thank you for letting me know.
I just updated the code.

Comment only
12 Mar 2014 Mohammad Haghighat

Ashok:

You need to specify the input arguments. Please read the help and "sample use" provided in the codes.

Comment only
01 Mar 2014 Ashok BM

??? Error using ==> gaborFilterBank at 35
There should be four inputs.

??? Error using ==> gaborFeatures at 41
use correct number of input arguments

Comment only
27 Feb 2014 Mark Veillette

Thanks for posting the code.
If I'm not mistaken, shouldn't line 55 in gaborFilterBank.m read

tetav = ((j-1)/v)*pi;

In my version it says

tetav = ((j-1)/8)*pi;

Comment only
29 Jan 2014 putria

putria (view profile)

how to use this feature vector, into knn?, because, your wavelet only output 1 kolumn...?

Comment only
27 Jan 2014 putria

putria (view profile)

thank's Mohammad, that's run, but why the results feature extraction so much?,

Comment only
26 Jan 2014 Mohammad Haghighat

Putria:

If you read the short help added in the mfile, the downsampling factors (d1 and d2) must be factors of the size of the image.

Comment only
26 Jan 2014 putria

putria (view profile)

after try, img = rgb2gray(img); ,i get an another error,
In an assignment A(I) = B, the number of elements in B and
I must be the same.

Error in ==> gaborFeatures at 80
featureVector(((c-1)*s+1):(c*s)) = gaborAbs;

Error in ==> testing at 4
featureVector = gaborFeatures( (img),gaborArray,4,4); % Extracts Gabor features

Comment only
26 Jan 2014 Mohammad Haghighat

Putria:

Be aware that your images are in grayscale, not RGB.
You may try: img = rgb2gray(img); before feeding it into gaborFeatures.

Comment only
26 Jan 2014 Mohammad Haghighat

Akshay:

This is only the code for Gabor Feature Extraction step.

Comment only
26 Jan 2014 putria

putria (view profile)

 
26 Jan 2014 putria

putria (view profile)

after run,your reply. i get an error

Undefined function or method 'conv2' for input arguments of type 'double' and attributes 'full 3d
complex'.

Error in ==> gaborFeatures at 54
gaborResult{i,j} = conv2(img,gaborArray{i,j},'same');

Error in ==> test_gabor at 3
featureVector = gaborFeatures(img,gaborArray,4,4); % Extracts Gabor features
how, to fix it...

Comment only
24 Jan 2014 Akshay Gore

Hi Mohammad,
I recently read your paper "Identification Using Encrypted Biometrics"
In your paper these steps are performed.
1. Face Detection is performed.
2. Gabor Features Extraction.
3. Dimensionality Reduction
4. Feature Quantization using K D tree.
5. Crete Predicate.
6. Generate Token.
But here only second step i.e Gabor features extraction code is available, rest of steps not available in your code.
Please update it or send to me.
Thanks
Akshay Gore
akshaygore@live.com

Comment only
22 Jan 2014 Mohammad Haghighat

img = imread('imageName.jpg'); % Reads the image
gaborArray = gaborFilterBank(5,8,39,39); % Generates the Gabor filter bank
featureVector = gaborFeatures(img,gaborArray,4,4); % Extracts Gabor features

Comment only
20 Jan 2014 putria

putria (view profile)

how to get image / img from JPG n make feature of it?

Comment only
07 Jan 2014 Akshay Gore  
06 Dec 2013 Steve

Steve (view profile)

 
Updates
20 Dec 2013

Added a reference

12 Mar 2014

Fixed a bug

18 Mar 2014

Added description

07 Apr 2014

Take care of the RGB images

07 Apr 2014

Took care of the RGB images

02 Nov 2014

MATLAB Toolbox File Format

31 Jan 2015

MATLAB Toolbox File Format

Contact us