face facerecognizer using opencv

asked 2013-11-22 07:38:38 -0600

Indra gravatar image

updated 2013-11-22 07:52:56 -0600

berak gravatar image

Hi, I want to create a face data base for atleast 4 to 5 images and recognize the face in the video .

when I was going through the some site I came across with this site http://docs.opencv.org/trunk/modules/contrib/doc/facerec/tutorial/facerec_video_recognition.html .

It seems this would help me a lot , I tried to download the it compile . Now I am facing problem at the creating the data csv file , I have image at ~/facedata/1.jpg to 6.jpg .. and I tried to run the create_csv.py , but its not creating any csv file .. I am running this script under this folder (where my images are there) ~/facedata/python create_csv.py . Can some body help me to get the csv file for my six images I have at ~/facedata/

edit retag flag offensive close merge delete

Comments

hey either:

  • stick to the rules, the folder-structure should be:

    facedata/

    person1/
    
    
    .. images
    
    person2/ ..images
  • or just type that csv yourself: (path,semicolon,id,newline)

    /path/to/image;id

    /path/to/image;id

    /path/to/image;id

berak gravatar imageberak ( 2013-11-22 07:48:45 -0600 )edit

Hi, I have put the images in the below format for the file sample.csv

/home/Alog/opencv/facedata/img1/1.png;0 /home/Alog/opencv/facedata/img1/2.png;0 /home/Alog/opencv/facedata/img1/3.png;0 ... /home/Alog/opencv/facedata/img2/1.png;0 /home/Alog/opencv/facedata/img2/2.png;0 /home/Alog/opencv/facedata/img2/3.png;0

But I am getting the below error OpenCV Error: Unsupported format or combination of formats (In the Fisherfaces method all input samples (training images) must be of equal size! Expected 56511 pixels, but was 0 pixels.) in train, file /home/chethan/Research/opencv/opencv-2.4.7/modules/contrib/src/facerec.cpp, line 455

my All images or same size, I just captured the image (from my webcam) and cropped only the faces and saved ..

Pls help to fix this ..

Indra gravatar imageIndra ( 2013-11-22 12:26:45 -0600 )edit
1

hmm, error states, that one of your training images is invalid.

btw, it does not make much sense to train it with imgs from one person only (all your images have the same id)

berak gravatar imageberak ( 2013-11-22 12:49:46 -0600 )edit

Hi, I added the proper images by cropping to only faces and setting all images pixels to 874x1240 ..

like below /home/algos/search/data/00.png;11 /home/algos/search/data/01.png;22 /home/algos/search/data/02.png;33 /home/algos/search/data/03.png;44

I have added totally four different faces , but it always prints the prediction =11 for any person who appears infront of camera .. Can you pls help to find out what problem I am doing during image training ..?

Indra gravatar imageIndra ( 2013-11-23 10:34:00 -0600 )edit