6 /*-------------------------------------------------------------------
9 -I/usr/include/opencv -I/usr/include/opencv2/highgui -L/usr/lib -lopencv_highgui -lopencv_core -lopencv_ml -lopencv_imgproc
11 --------------------------------------------------------------------*/
13 int storeFrame( CvCapture* capture)
18 p[0] = CV_IMWRITE_JPEG_QUALITY;
19 p[1] = 10; //quality value. 0-100
22 frame = cvQueryFrame(capture);
25 cvSaveImage("../web/images/test.JPG",frame,p);
29 int main (int argc, char** argv)
33 //Get capture structure for camera, -1 refers to any camera device.
34 //If multiple cameras used, need to use specific camera ID
35 capture = cvCreateCameraCapture(-1);
36 //If cvCreateCameraCapture returns NULL there is an error with the camera
42 if( !storeFrame( capture))
44 //sleep(1); //for now just to make the camera take 1 shot a second, as that's all my camera seems to be able to take/save (camera or function causing this? is 1 second per frame enough?)
47 //Need to determine how the function is called in respect to system. just leave it running with a while loop? will something turn it on and off? will the function be called once from elsewhere?
49 cvReleaseCapture( &capture);