Ask Your Question

Revision history [back]

How to detect and capture an image automatically when person is in front of the camera

I am learning about face recognition.I do this using open cv, c++ language,visual studio 2015. I want to do when a person come in front of the camera,it capture the face automatically and save in database.how I done it. How it done. Please help me.

this is the code that I use to open the camera

#include <opencv2 opencv.hpp="">

include <opencv2 imgcodecs.hpp="">

include "opencv2/objdetect.hpp"

include "opencv2/highgui.hpp"

include "opencv2/imgproc.hpp"

include <stdio.h>

using namespace std; using namespace cv;

int main(int, char**) { Mat img;

VideoCapture cam(0);

namedWindow("camera");

while (1) {
    cam >> img;
    imshow("camera", img);

    if (waitKey(1) == 27)
    {
        break;
    }

}

cam.release();
return 0;

}

How to detect and capture an image automatically when person is in front of the camera

I am learning about face recognition.I do this using open cv, opencv, c++ language,visual studio 2015. I want to do when a person come in front of the camera,it capture the face automatically and save in database.how I done it. How it done. Please help me.

this is the code that I use to open the camera

#include <opencv2 opencv.hpp="">

include <opencv2 imgcodecs.hpp="">

include "opencv2/objdetect.hpp"

include "opencv2/highgui.hpp"

include "opencv2/imgproc.hpp"

include <stdio.h>

#include <opencv2/opencv.hpp>
#include <opencv2/imgcodecs.hpp>
#include "opencv2/objdetect.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <stdio.h>
using namespace std;
using namespace cv;

cv; int main(int, char**) { Mat img;

img;

    VideoCapture cam(0);

 namedWindow("camera");

 while (1) {
     cam >> img;
     imshow("camera", img);

     if (waitKey(1) == 27)
     {
         break;
     }

 }

 cam.release();
 return 0;
}

}