7 CvCapture *c = cvCaptureFromCAM(
cams.size());
11 if (
cams.size()==0)
return 0;
14 cout <<
"model.buildCached() failed.\n";
17 for (
int i=1; i<
cams.size(); ++i) {
19 cams[i]->detector.load(
"model.bmp.classifier");
27 for (vector<Cam *>::iterator it=
cams.begin(); it!=
cams.end(); ++it)
29 cvGrabFrame((*it)->cam);
35 for (vector<Cam *>::iterator it=
cams.begin(); it!=
cams.end(); ++it)
40 if (
cam) cvReleaseCapture(&
cam);
44 cvSetCaptureProperty(
cam, CV_CAP_PROP_FPS, 15);
45 cvSetCaptureProperty(
cam, CV_CAP_PROP_FRAME_WIDTH, 1024);
46 cvSetCaptureProperty(
cam, CV_CAP_PROP_FRAME_HEIGHT, 768);
53 double fps = cvGetCaptureProperty(
cam, CV_CAP_PROP_FPS);
54 cout <<
"Camera " <<
width <<
"x" <<
height <<
" at "
55 << fps <<
" fps, " << f->nChannels <<
" channels.\n";
59 if (gray && gray != frame) cvReleaseImage(&gray);
60 if (cam) cvReleaseCapture(&cam);
68 if (f == 0)
return false;
69 if (frame == 0) frame = cvCloneImage(f);
70 else cvCopy(f, frame);
73 if (frame->nChannels >1) {
75 gray = cvCreateImage( cvGetSize(frame), IPL_DEPTH_8U, 1 );
76 cvCvtColor(frame, gray, CV_RGB2GRAY);
82 if (detector.detect(gray)) {
83 if (lc) lc->averageImage(frame, detector.H);
91 static std::vector<CamCalibration::s_struct_points> pts;
110 static std::vector<CamCalibration::s_struct_points> pts;