1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
int InitVideo()
{
g_capture= cvCreateCameraCapture(0); //selection manuelle // 0 toutescvCaptureFromCAM(0);
fps_video_rate=cvGetCaptureProperty( g_capture, CV_CAP_PROP_FPS) ;
frame=cvQueryFrame(g_capture);
CvSize image_recording_size=cvSize(
(int)cvGetCaptureProperty( g_capture, CV_CAP_PROP_FRAME_WIDTH ),(int)cvGetCaptureProperty( g_capture, CV_CAP_PROP_FRAME_HEIGHT)
) ;
camera_contraste=(int)cvGetCaptureProperty( g_capture, CV_CAP_PROP_CONTRAST);
camera_luminence=(int)cvGetCaptureProperty( g_capture, CV_CAP_PROP_BRIGHTNESS);
camera_saturation=(int)cvGetCaptureProperty( g_capture, CV_CAP_PROP_SATURATION);
camera_teinte=(int)cvGetCaptureProperty( g_capture, CV_CAP_PROP_HUE);
camera_gain=(int)cvGetCaptureProperty( g_capture, CV_CAP_PROP_GAIN);
int cx_size=(int)cvGetCaptureProperty( g_capture, CV_CAP_PROP_FRAME_WIDTH );
int cy_size=(int)cvGetCaptureProperty( g_capture, CV_CAP_PROP_FRAME_HEIGHT);
frame = cvCreateImage(cvSize(cx_size,cy_size), IPL_DEPTH_8U ,3);// 8 bits 3 couches color
VideoWrite= cvCreateVideoWriter( video_file_recorded,CV_FOURCC('X','V','I','D'), fps_video_rate, image_recording_size);
video_size_x=video_image.Width();
video_size_y=video_image.Height();
camera_is_on=1;
sprintf(string_Last_Order,">>Camera %d x %d FPS: %d ",cx_size,cy_size,fps_video_rate) ;
return(0);
} |
Partager