Object detection and tracking are important in many computer vision applications, including activity recognition, automotive safety and surveillance. Presented here is an face detection using MATLAB system that can detect not only a human face but also eyes and upper body.

Fig. 1: Program output screen
Fig. 1: Program output screen

Face detection is an easy and simple task for humans, but not so for computers. It has been regarded as the most complex and challenging problem in the field of computer vision due to large intra-class variations caused by the changes in facial appearance, lighting and expression. Such variations result in the face distribution to be highly nonlinear and complex in any space that is linear to the original image space.

Face detection is the process of identifying one or more human faces in images or videos. It plays an important part in many biometric, security and surveillance systems, as well as image and video indexing systems.

Fig. 2: Checking the device ID
Fig. 2: Checking the device ID

This face detection using MATLAB program can be used to detect a face, eyes and upper body on pressing the corresponding buttons. The program output screen is shown in Fig. 1.

Software program

This real-time face detection program is developed using MATLAB version R2012a. A graphic user interface (GUI) allows users to perform tasks interactively through controls like switches and sliders. You can easily create a GUI and run it in MATLAB or as a stand-alone application. The initial program output of this project is shown in Fig. 1.

Viola-Jones algorithm. There are different types of algorithms used in face detection. Here, we have used Viola-Jones algorithm for face detection using MATLAB program. This algorithm works in following steps:
1. Creates a detector object using Viola-Jones algorithm
2. Takes the image from the video
3. Detects features
4. Annotates the detected features


  1. Though we have not tested it on Ubuntu, it is working well in Windows.
    Download the code from our website or DVD, make sure that you put all the files in one folder as it is. Then run the program again.

  2. Hi EFY. I had tried this project on my laptop. It worked well, but when i try to change from face to eyes when pressing stop button i am getting some errors.
    after pressing face button,face gets detected. then i pressed stop. then the following errors occured.
    Error using imaqdevice/trigger (line 48)
    OBJ must be running before TRIGGER is used.

    Error in testing>face_Callback (line 102)

    Error in gui_mainfcn (line 95)

    Error in testing (line 42)
    gui_mainfcn(gui_State, varargin{:});

    Error in

    Error while evaluating UIControl Callback

  3. hi i am doing project in matlab for fault detection in the railway track circuits. can i do in real time and how ? please help me.


Please enter your comment!
Please enter your name here