File Exchange

image thumbnail

Face Detection using Support Vector Machine (SVM)

version 1.2 (172 KB) by

Face Detection using Gabor feature extraction and support vector machines (SVMs)

95 Downloads

Updated

View License

Editor's Note: Popular File 2013

This program is the clone of 'Face Detection System' in MATLAB
but instead of Neural Networks, It is based on Support Vector Machine (SVM)

Face Detection System (Neural Network)
http://www.mathworks.com/matlabcentral/fileexchange/11073-face-detection-system

    1- copy all files and directories to the MATLAB's work folder
     * In order to run the program you must have Image Processing and Neural Networks Toolboxes

    2- find the file named "main.m"

    3- Double click on this file or type "main" in the command window

    4- a menu will be shown . click on "Create SVM" and wait until the program is done with the training.

    5- click on "Test on Photos". A dialog box will be appeared. Select a .jpg photo

    6- Wait until the program detects some faces

For more information please visit the website. Thank you.
http://www.facedetectioncode.com

Comments and Ratings (20)

Troy Smith

索引超出矩阵维度,出错svmclassify(line 109) sample(:,c) = svmStruct.ScaleData.scaleFactor(c)*...;出错imscan(line 54)Cell.net(y,x) = svmclassify(net,im2vec(imcut)');出错main(line 43)im_out = imscan(net,im);Thx.

AAAA

AAAA (view profile)

Omid would like to change the dimension of the face and non face instead of 27x18. What variables do I need to change? many thanks

Shakeel Ahmed

Very Nice Work SIR
when i click on "TEST on Photos"
Error using images.internal.imageDisplayParsePVPairs (line 71)
The parameter, notruesize, is not recognized by imageDisplayParsePVPairs

Error in images.internal.imageDisplayParseInputs (line 69)
[common_args,specific_args] = images.internal.imageDisplayParsePVPairs(varargin{:});

Error in imshow (line 222)
      images.internal.imageDisplayParseInputs({'Parent','Border','Reduce'},preparsed_varargin{:});

Error in main (line 45)
            figure;imshow(im_out,'notruesize');

Manoj Kumar

Hi omid
I am facing following error
" Error using imshow>preParseInputs (line 429)
The syntax IMSHOW(...,'notruesize') has been removed. Use the IMSHOW(...,'InitialMagnification','fit')
syntax instead.

Error in imshow (line 214)
varargin_translated = preParseInputs(varargin{:});

Error in main (line 45)
figure;imshow(im_out,'notruesize');"

please help

NAVANEETHA

Hi omid
I am facing following error
" Error using imshow>preParseInputs (line 429)
The syntax IMSHOW(...,'notruesize') has been removed. Use the IMSHOW(...,'InitialMagnification','fit')
syntax instead.

Error in imshow (line 214)
varargin_translated = preParseInputs(varargin{:});

Error in main (line 45)
figure;imshow(im_out,'notruesize');"

please help urgently

msm Rasel

Hi omid
I am facing following error
" Error using imshow>preParseInputs (line 429)
The syntax IMSHOW(...,'notruesize') has been removed. Use the IMSHOW(...,'InitialMagnification','fit')
syntax instead.

Error in imshow (line 214)
  varargin_translated = preParseInputs(varargin{:});

Error in main (line 45)
            figure;imshow(im_out,'notruesize');"

please help urgently
 

chuanpeng

abbas

abbas (view profile)

سلام
آقا امید در انتهای اجرای برنامه خطای زیر وجود دارد
Error using imshow>preParseInputs (line 430)
The syntax IMSHOW(...,'notruesize') has been removed. Use the
IMSHOW(...,'InitialMagnification','fit') syntax instead.

Error in imshow (line 215)
  varargin_translated = preParseInputs(varargin{:});

Error in main (line 45)
            figure;imshow(im_out,'notruesize');
چطوری باید حلش کرد؟
با تشکر

vaibhava

provide this service very very nice
and again this system provide to notes continous

Natalie Luu

Great code! Quick question, can we train the code to detect more faces, by adding more sample faces in the face folder? I would like to have the code detect the face when the person only shows one side of his/her face. Thank you

Natalie Luu

Great code! Quick question, can we train the code to detect more faces, by adding more sample faces in the face folder? I would like to have the code detect the face when the person only shows one side of his/her face.

Thank you

Thanks a lot for the code...It's showing some error in svmtrain function. Can you please check? I have the bioinformatic tool box. It's showing error in parameter passing to svmtrain().
Thanks anyway I am studying svm now, may be able to solve this problem later.
Thanks.

Caelyn Low

great job, but i not very understand with the imscan.m file code (first section, second section and third section). Is there any pdf file or source that can provide so that i can more understand about the coding? thanks.

Chen yuan

After the face_folder and non_face_folder variables modified to the right directory, programme works well, thanks for sharing.

Aladdin

Hello Omid, Thank's a lot for this work, it's perfect, but i have a problem on it, when i want to change the database, i want to use the X2MVTS database, it don't work, do you have any idea why ?!

PS: your script work only for 27x18 images ?!!

Thx again

Omid Sakhi

Omid Sakhi (view profile)

Hey Steve! Thank you for your comment. Unfortunately svmclassify and svmtrain functions are part of the Bioinformatic toolbox. So if you do not have that toolbox, there is no way to run this program. Sorry ...

Steve

Steve (view profile)

Hi Omid, thank you for taking the time to upload your code. However, I am unable to get it working... When I click the 'Create SVM' button I get the following error...

??? Undefined function or method 'svmtrain' for input arguments of type 'struct'.

Error in ==> trainnet at 18
net =
svmtrain(P',T','Kernel_Function','linear','Polyorder',2,'quadprog_opts',options);

Error in ==> main at 32
        net = trainnet(IMGDB);

(fyi, I am using matlab ver 7.10.0)

Thank you in advance, I would like to try out your code if you can help me get it working

Mark

Mark (view profile)

Great stuff! However when it comes to place the rectangles over the faces I get the following error:

??? Undefined function or variable 'Threshold'.

Error in ==> imscan at 74
xy_ = Cell.net > Threshold;

(as the 'Threshold' variable is not defined anywhere). What should it be set to?

Updates

1.2

fix: The Threshold in imscan.m is replaced with 0.

MATLAB Release
MATLAB 7.1.0 (R14SP3)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video