13 /*----------------------------------------------------------------------*\
15 \*---------------------------------------------------------------------*/
17 /*--------------------------------------*\
19 \*-------------------------------------*/
21 int tuto(string nameVideo
);
23 /*--------------------------------------*\
25 \*-------------------------------------*/
27 static int work(VideoCapture
* ptrVideoCapture
);
29 /*----------------------------------------------------------------------*\
31 \*---------------------------------------------------------------------*/
33 /*--------------------------------------*\
35 \*-------------------------------------*/
38 * http://docs.opencv.org/doc/tutorials/highgui/video-input-psnr-ssim/video-input-psnr-ssim.html
40 int tuto(string nameVideo
)
46 // VideoCapture cap(nameVideo);
63 catch (cv::Exception
& e
)
65 const char* err_msg
= e
.what();
67 cerr
<< "Tuto failed" << endl
;
68 cerr
<< err_msg
<< endl
;
75 /*--------------------------------------*\
77 \*-------------------------------------*/
79 int work(VideoCapture
* ptrVideoCapture
)
81 cout
<<"[Tuto] : work"<<endl
;
83 VideoCapture cap
= *ptrVideoCapture
;
85 double rate
= cap
.get(CV_CAP_PROP_FPS
);
86 int delay
= 1000/rate
;
88 namedWindow("edges", 1);
94 //cout << "[Tuto] cap >> frame : try" << endl; // debug
95 cap
>> frame
; // get a new frame from camera
105 // http://siggiorn.com/wp-content/uploads/libraries/opencv-java/docs/sj/opencv/Constants.ColorConversion.html
106 //int colorConversion=CV_BGR2GRAY; // ok
107 //int colorConversion=CV_BGR2RGBA ; // ko
108 int colorConversion
= CV_BGR2BGRA
; // ok
109 cvtColor(frame
, edges
, colorConversion
);
114 //GaussianBlur(edges, edges, Size(7, 7), 1.5, 1.5);
115 //Canny(edges, edges, 0, 30, 3);
118 imshow("edges", edges
);
120 if (waitKey(delay
) >= 0)
128 /*----------------------------------------------------------------------*\
130 \*---------------------------------------------------------------------*/