No License

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

» Watch video

Highlights from
fdlibmex --- fast and simple face detection

5.0 | 20 ratings Rate this file 44 Downloads (last 30 days) File Size: 1.9 MB File ID: #20976 Version: 1.0
image thumbnail

fdlibmex --- fast and simple face detection



05 Aug 2008 (Updated )

An efficient and easy-to-use mex library for detecting frontal faces in images

| Watch this File

File Information

fdlibmex is a very simple face detection library for matlab. No toolboxes are required. The library consists of a single mex file with a single function that takes an image as input and outputs the locations of the frontal faces in the image.

The zip file includes mex files for the 32bit Windows, Linux and Mac platforms supported by Matlab, and an example script that illustrates the usage of the library.

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (49)
23 Aug 2016 fara zabihi

08 Oct 2015 Zhang Yi


Comment only
12 Jun 2014 Qian Yu

Great! Thanks!

05 Mar 2014 Nurul Ain

Hi, would you please send me a version that could be used in 64bit windws machine? Thanks!

Comment only
13 Dec 2013 Tran Vu


15 Feb 2013 Lian Guite

Using the values stored in 'r', i have cut out the detected faces individually from some rgb images, and i am getting all faces in grayscale which is obvious because of the rgb2gray function i have used..
But is there any way to get those cut out faces in rgb ?? How to retain its original rgb composition after running the fdlibmex ??

Comment only
29 Oct 2012 adong7639

The result of this facedetector is as good as opencv!!!

Comment only
02 Jul 2012 selim

selim (view profile)

I tried to run the demo file but got an error
??? Undefined function or variable 'fdlibmex'.

Error in ==> fdlibmex_demo at 16

Can somebody help me to solve this problem.
Please help.

Comment only
29 Nov 2011 Jason

Jason (view profile)

07 Sep 2011 Matteo

Matteo (view profile)

Hi everyone.
I'm also trying to run the library demo on maci64, but there's no way to get it work.
It's some kind of problem with the mex file.
If someone could help it will be appreciate, thx!

Comment only
06 Jun 2011 xin lu

xin lu (view profile)

hi, i met the problem of "Undefined function or method
'fdlibmex' for input arguments
of type 'uint8'.

Error in ==> fdlibmex_demo at 23
pos = fdlibmex(img);"

I guess the binary file is compiled in 32bit compiler. Is that right? If that is the case, would you please send me a version that could be used in 64bit linux machine? Thanks!

Comment only
01 Jun 2011 weike yin

can u send the source code of dll to me,my
thank you!

11 May 2011 emir

emir (view profile)

i got an error
??? Undefined function or method 'mblbp_featlist' for input arguments of type 'double'Can somebody help me to solve this problem.

Comment only
26 Feb 2011 kiran nalawade

I tried to run the demo file but got an error
??? Undefined function or variable 'fdlibmex'.

Error in ==> fdlibmex_demo at 16

Can somebody help me to solve this problem.
Please help.

Comment only
26 Feb 2011 Siddharth Patil

I am not able to detect faces in color image. Is there any way to do this ?

Comment only
08 Feb 2011 tjipto tjupu

mr wolf kienzle, im student in im do my final exame.but i have problem in face wolf can i know the contain of fdlibmex.dll ??
thanks before.

01 Feb 2011 Computer Vision

Excellent work! Congratulations!
I submit one more request for the algorithm you use!

Comment only
01 Feb 2011 Computer Vision

11 Jan 2011 grace solomon

Nice work on the face detector, seems to work well! Thanks for posting it.Would you like to tell us your algorithm?Please help.

30 Nov 2010 Mariam Z

I got it... thanks

Comment only
29 Nov 2010 Mariam Z

m unable to c the image wid the face detected.
I have not used this part of the code
fprintf('\n--- fdlibmex example ---\n');
fprintf('\n\t%d faces detected in \''%s\'' (see figure 1)\n\n', ...
size(pos,1), imgfilename);
as its not clear how to use it
can u please help me wid this?

09 May 2010 Hoang

Hoang (view profile)

Great job!
Would you like to tell us your algorithm? and how to analysis features to build your algorithm?
Thank you!

22 Apr 2010 Frank

Frank (view profile)

I second the request for a 64bit windows version. :)


Comment only
17 Apr 2010 zhijun yao

Great work. Thank you.

Comment only
24 Feb 2010 Robert Delano

Wow this is great! Is there any way to get it to take a picture each time it recognizes a face?

Thanks again, Great job!

21 Nov 2009 Bhuvan Goradia

I tried to run the demo file but got an error "Undefined function or variable fdlibmex"
Do we need to load the dll library and if yes how to do this as the load library function requires a header which is no provided.
Please help.

Comment only
03 Nov 2009 Vitomir Struc

Vitomir Struc (view profile)

Great job.

04 Oct 2009 Wolf Kienzle

Hi Alfian,

if you don't get an error message, then everything should be working OK. If not, here's a few things you may want to check: Have you tested it with the example image I provided? Are the faces in your images large enough (about 25x25 pixels)? Are they somewhat evenly illuminated and frontal (not rotated, no side views)? Have you tried cranking up the detection threshold?

Hope that helps!

Comment only
01 Oct 2009 Alfian Abdul Halin

Hi Wolf :)

I was trying to use your code... but it didn't work for any of my test images. I am working with football (soccer) videos.. and I tested on some frames (640X480)...

Image quality is quite ok (not excellent). All are in JPEG extension (not JPG)... but no errors were given... I had to add extra code to change from RGB to Grayscale tho.

Do you know why this is happening? I was expecting it to work because of the many good reviews ure getting. Anyway... I still believe it could work. Maybe I need to add some things here and there? thankx

Comment only
03 Sep 2009 Janayna

Very nice work. What database did you use? I work with face recognition I need help to find a large number of train images.


Comment only
24 Aug 2009 pin pin

heloo... how to use this using visual foxpro or visual basic?
how to declare it?

Comment only
19 May 2009 ddt99999 Tong

Is it possible to have mex files for 64bit Windows? Thanks a lot..

18 May 2009 Daniel N


08 May 2009 Zhe ‹

very nice work, it is so fast. how can i get more accuracy result from this demo. thanks

30 Apr 2009 PEDRO GARCIA

It's fast to find a face with this code. The fastest code I have found on the web.

Could you provide any estimation about when the publication will be available?


05 Mar 2009 Hanaa

Hanaa (view profile)

Hi all!

I'm doing my final year project on 'Image Processing Methods for facial recognition using Matlab'. I've got Visual Studio 2005 background but never used MatLab before. I've just started on with research, video tutorials and reading.

Can anyone please help me with a guide, where can I start this from? Does this face detection code helps?

Your help would be very much appreciated! :))

Comment only
15 Jan 2009 Gerardo Rosiles

Sorry, I did not read all the comments above. Are there any updates on the publlication and will it be protected by a patent?

15 Jan 2009 Gerardo Rosiles


Great work. Thanks for posting it. Are you using still using the Rank Deficient Faces algorithm? If this is another algorithm can you provide a reference at this point?



Comment only
22 Dec 2008 Wolf Kienzle


bhupala: the library cannot detect eyes and nose directly. but the face detection result should be a good starting point for where to look for eyes, nose, etc.

james: thanks! the algorithm uses a cascaded classifier, however, unlike viola/jones, it does not use integral images or haar wavelets. i hope i will manage to write up something soon. when that happens, i'll definitely post a link in here. :)

happy holidays!


Comment only
26 Nov 2008 James C

Hi Wolf,

Great program, its reliable and quick. I was wondering if you know when you are going to publish a journal? Also is you algorithm based on a particular type of face detection (e.g. active shape modeling or image integrals...)


Comment only
26 Nov 2008 James C

24 Nov 2008 sri hari bhupala haribhakta

Dear Wolf,

is there any way to detect eyes, nose and lips using this code?


Comment only
22 Nov 2008 Wolf Kienzle

hi angela,

there is an optional sensitivity parameter, you just call pos = fdlibmex(img, threshold). threshold makes most sense around -10..10.

unfortunately, there are no scores :( however, you can get an idea of the confidence by running the detector again with a higher threshold and checking which detections remain.

good luck!

Comment only
14 Nov 2008 Angela

Angela (view profile)

Hi Wolf,

Nice work on the face detector, seems to work well! Two questions though: (1) Is there any way gain access to parameters to adjust for precision and (2) are there any scores / confidences attached to each face detection?


Comment only
13 Sep 2008 Help the Noob

I am very curious of me but and want to
try out this stuff...
but do i need Mathworks Matlab R2008a to make this work?

Comment only
05 Sep 2008 Jordi Palacin

Very nice and fast.

03 Sep 2008 Peter Gehler

Worked out of the box with good results

12 Aug 2008 Wolf Kienzle

The library implements a new algorithm (i.e. not Viola/Jones or the like) that has not been published yet. That's why there are no references, sorry.

Comment only
10 Aug 2008 Sebastien PARIS

Why don't you offer the source code ? or indicate any references ?.

Comment only
06 Aug 2008

file description extended

Contact us