1 | initial version |
this should get you started:
#include "opencv2/opencv.hpp"
int main(int argc, char **argv)
{
Mat img;
VideoCapture cap(0); // 1st cam
while(cap.isOpenend())
{
cap >> img;
if ( !img.empty() )
{
// your processing code here
imshow("image", img);
}
char k = (char) waitKey(10); // sleep for 10 millis
if ( k == 27 ) break; // 'esc' pressed
}
return 0;
}