File Exchange

image thumbnail

fdlibmex --- fast and simple face detection

version (1.9 MB) by Wolf Kienzle
An efficient and easy-to-use mex library for detecting frontal faces in images


Updated 02 Sep 2008

No License

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.

Cite As

Wolf Kienzle (2021). fdlibmex --- fast and simple face detection (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (51)

Abhind A

Pranav Misra

I am trying to run this on a 64 bit machine, and am getting the error

Undefined function or method

Kindly email me the 64-bit version on

fara zabihi

Zhang Yi


Qian Yu

Great! Thanks!

Nurul Ain

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

Tran Vu



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 ??


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


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.



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!

xin lu

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!

weike yin

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


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

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.

Siddharth Patil

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

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.

Computer Vision

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

Computer Vision

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.

Mariam Z

I got it... thanks

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?


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


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


zhijun yao

Great work. Thank you.

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!

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.

Vitomir Struc

Great job.

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!

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


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


pin pin

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

ddt99999 Tong

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

Daniel N


Zhe ‹

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


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?



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! :))

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?

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?



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!


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...)


James C

Dear Wolf,

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


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!


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?


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?

Jordi Palacin

Very nice and fast.

Peter Gehler

Worked out of the box with good results

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.

Sebastien PARIS

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

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!