Sunday, May 6, 2012

OpenCV Face Recognition using PCA technique


Step 1 :  Download and Install OpenCV 2.1.0 .
              OpenCV 2.1.0 installation on Visual Studio 2008 guide is here .

Step 2 :  Start with a new C++ Console win32 Application project on Visual studio.
              Then create a new  NearestTest.cpp   file within that project.

Step 3 :  Then create a face database with using several images as follows,
              Database folder  ->     

                             
    
                     


Step 4 : Mainly this app consisting with two parts,
                     1. Image Training Part  -
                                  first you have to train Face Images from train.txt
                                  training images.
                           ->   learn()  method                            
                     2. Image Recognition Part -
                                 then using test.txt testing images, recognize each
                                 and every face through training images (facedata.xml).
                           ->  recognize() method

               

- After doing training ->  it will create facedata.xml with using PCA technique.
- Then using facedata.xml, recognition will be done.


Step 5 :  Create the Project Folder Structure as follows and then download all the
              coding stuffs from  above and then add to NearestTest.cpp file.

             

Step 6 : After creating folder structure and .cpp file build the whole project.
                1. first train the images-->  facedata.xml will be generated.
      

              2. then test the app using test images--> output is as follows,

       

         

6 comments:

  1. Nice work jayan..
    Hope you'll post more valuable posts in future...

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. hi jayan. my name is joanne. im a final year student and im doing fyp on face recognition using PCA. Im completely new to programming. could you guide me through in setting up the whole system. i have my faces database using the at&t database. i really hope u can help me. thanks in advance.

    jcsk_z@hotmail.com

    ReplyDelete
  4. Hi, Jayan
    Can you hepl me:
    1. Why images in jayan folder have pgm format, not format .jpg or .png...? how to create file .pgm?
    2. How to gait recognition using PCA, silhouette? Can you help me code?
    Thank you very much!

    ReplyDelete
  5. please,can you explain me the source code
    davidamine05@gmail.com

    ReplyDelete