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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
double camera_contraste;
double camera_luminence;
double camera_saturation;
double camera_teinte;
double camera_gain;
CvCapture* g_capture = NULL;
IplImage* frame;
CvVideoWriter *VideoWrite;
IplImage* frameplayer;
double image_recording_size;
const char video_file_recorded[24]={"Rec.avi"};
int fps_video_rate=25;
int InitVideo()
{
g_capture= cvCreateCameraCapture(0); //selection manuelle // 0 toutescvCaptureFromCAM(0);
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=cvGetCaptureProperty( g_capture, CV_CAP_PROP_CONTRAST);
camera_luminence=cvGetCaptureProperty( g_capture, CV_CAP_PROP_BRIGHTNESS);
camera_saturation=cvGetCaptureProperty( g_capture, CV_CAP_PROP_SATURATION);
camera_teinte=cvGetCaptureProperty( g_capture, CV_CAP_PROP_HUE);
camera_gain=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);
sprintf(string_Last_Order,">>Camera Opened Cvsize:%d %d FPS: %d",cx_size,cy_size,fps_video_rate);
video_size_x=video_image.Width();
video_size_y=video_image.Height();
camera_is_on=1;
return(0);
} |
Partager