% Version : 5.4
% Date : 12.26.2010
% Author  : Omid Sakhi
% http://www.facedetectioncode.com

function IMVECTOR = im2vec_gabor (I)

load gabor;
I = adapthisteq(I,'Numtiles',[8 3]); 
Features135x144 = cell(5,8);
for s = 1:5
    for j = 1:8
        Features135x144{s,j} = mminmax(abs(ifft2(G{s,j}.*fft2(double(I),32,32),size(I,1),size(I,2))));
    end
end
Features = cell2mat(Features135x144);

Features(3:3:end,:)=[];
Features(2:2:end,:)=[];
Features(:,3:3:end)=[];
Features(:,2:2:end)=[];

IMVECTOR = reshape (Features,[1 size(Features,1)*size(Features,2)]);
