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:
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", frame ); 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