Ask Your Question
0

face recognition and face detection using Eigenface

asked 2013-04-15 08:08:38 -0600

Adrianos01 gravatar image

updated 2013-04-15 10:04:58 -0600

Hello all there,

I want to start write a program with OpenCV with face recognation and face detection.

I have asked at the weekend this question on this forum and became a answer:

http://answers.opencv.org/question/11552/how-to-start-to-program-face-recognition/

My answer is now:

I have a OpenCV code that started my Webcam. Also can I use(insert) the same to my Webcam start code the function recognition, detection, train and to convert the grayscale the following code?

> #include "highgui\highgui.hpp"
> #include "imgproc\imgproc.hpp"  
> #include < iostream >   
using namespace std;

>using namespace cv;   
>int main()
> {

>     int c;

>     CvCapture *camera;

>     Mat cameraFrame;
>  
>     camera = cvCaptureFromCAM(0); // select 1st camera
>     if(camera == NULL)
>     {
>         cout << "[ERROR] No camera found!" << endl;
>         return -1;
>     }
>  
>     // output window
>     cvNamedWindow("Camera Output", 0);
>  
>     // loop forever till ESC
>     for(;;)
>     {
>         // capture a frame from the camera
>         cameraFrame = cvQueryFrame(camera);
>  
>         // display it
>         if(!cameraFrame.empty())
>             imshow( "Camera Output", cameraFrame );
>         else
>             cout << "[WARN] No frame captured in this loop!" << endl;
>  
>  
>         // test for ESC
>         c = cvWaitKey(10);
>         if(c == 27 /* ESC */)
>             break;
>     }
>  
>     cvReleaseCapture(&camera);
>     cvDestroyWindow("Camera Output");
>  
>     return 0; }

Thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-04-15 10:03:54 -0600

First of all, please use the C++ functionality if you want to combine it with the C++ class FaceRecognizer as suggested in the other topic. It will make life much easier for you.

To answer your question, you should seperate training and recognition. The webcam part can be integrated with the recognition part, training should be done beforehand given training data.

edit flag offensive delete link more

Comments

But i couldn't use the following link because i have a ATI-Based System.: https://github.com/Itseez/opencv/blob/master/samples/cpp/facerec_demo.cpp

I have a #include <cuda_runtime.h> compile error. I downloaded the cuda_5.0.35_linux_32_ubuntu10.04-1.run and want to run this but i became other errors.

Adrianos01 gravatar imageAdrianos01 ( 2013-04-16 05:56:26 -0600 )edit

This error comes from utility.hpp Because i have no such file in the folder "opencv2/core/utility.hpp

Adrianos01 gravatar imageAdrianos01 ( 2013-04-16 06:24:26 -0600 )edit

Then you will have to use the standard CPU approach, which works perfectly, also on your ATI card. Or look at the OpenGL classes and see if that works out.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-16 06:38:08 -0600 )edit
1

Also, start with using prebuilt binaries, before going to building it yourself :) It will make your life a lot easier.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-16 06:51:17 -0600 )edit

Question Tools

Stats

Asked: 2013-04-15 08:08:38 -0600

Seen: 1,353 times

Last updated: Apr 15 '13