Face Counter Using MATLAB

Vivek Panchabhaiya


This program helps count the number of persons present in a meeting hall or classroom at a time. The program logic can also be used in other applications, such as automatic temperature control which depends on the number of persons in a room. Video camera plays a very important role in this project.

If you try to count a large number of people in a hall, you may take time to count them and probably also make a mistake. With the help of this program, you can get the number of people instantly and more accurately using a camera and image processing.

Fig. 1: Face-counter program output
Fig. 2: Face counter using MATLAB

Software program

Fig. 3: Checking the device ID

A graphic user interface (GUI) allows users to perform tasks interactively through such controls as switches and sliders. You can create GUI and run it in MAT LAB or as standalone application. The initial program output of this project is shown in Fig. 1 and its output after face detection is shown in Fig. 2.


  1. please send me ppt of this project.
    and also code because it is not working. It take an issue after running program.
    can u send a videos also with running program and also one ppt on this project.

  2. hello sir i am ravi kumar sir mene face counter project par work kiya use matlab me code kiya but error aa rha hia me error ko yaha copy kar deta hu aap check kar please mujhe solution bta de
    >> count
    Maximum recursion limit of 500 reached. Use set(0,’RecursionLimit’,N)
    to change the limit. Be aware that exceeding your available stack
    space can
    crash MATLAB and/or your computer.

    Error in count

  3. i am not getting my device id sir it is saying like this sir
    Error using imaqhwinfo (line 109)
    Invalid ADAPTOR specified. Type ‘imaqhwinfo’ for a list of installed ADAPTORs. Image acquisition adaptors may be
    available as downloadable support packages. Open Support Package Installer to install additional vendors.

    can you please help sir??

    • Seems your webcam is not supported. You need either an inbuilt-camera or an external webcam to test the project. If you dont have camera it wont work. After connecting external camera you need to note the camera device ID.

  4. can u send me source code of this program please npmscare@gmail.com
    While running of i am getting following errors
    Error event occurred at 16:55:25 for video input object: YUY2_640x480-winvideo-1.
    GETDATA timed out before FRAMES were available.
    Error using imaqdevice/getdata (line 149)
    GETDATA timed out before FRAMES were available.

    Error in count>count_Callback (line 108)
    image = getdata(vid); %store that frame
    in ‘image’

    Error in gui_mainfcn (line 96)

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

    Error in @(hObject,eventdata)count(‘count_Callback’,hObject,eventdata,guidata(hObject))

    Error while evaluating uicontrol Callback

  5. m getting the following error..

    ??? function varargout = count(varargin)
    Error: Function definitions are not permitted in this context

  6. Hello Sir;
    I am sumair saeed,kindly send me the code of this project and please send some details like Requirements for this project etc.

  7. Good day!

    This article is a big help as a reference for my project. In line with that, I’d like to talk with you through e-mail regarding face recognition and face tracking, if possible. This is my e-mail: japitanj@gmail.com

    Looking forward to talk with you soon!

  8. Hello EFY Team,
    I am very impressed with your project. I had downloaded the source code and also run the program , but unfortunetly got many errors can please send me your source code my email id as soon as posssible. It will be very kind of you..
    aamirshariff2013@gmail.com this is my email Id…


Please enter your comment!
Please enter your name here