Skip to content

Instantly share code, notes, and snippets.

@hkhojasteh
Created January 30, 2019 05:23
Show Gist options
  • Save hkhojasteh/e1f7ed72a62a5b91876bbfb33c2d31f5 to your computer and use it in GitHub Desktop.
Save hkhojasteh/e1f7ed72a62a5b91876bbfb33c2d31f5 to your computer and use it in GitHub Desktop.
VideoCapture cap(0); //open the camera
if(!cap.isOpened())
return -1; //check if we successfully connected to camera
for(;;){
Mat frame;
cap >> frame; //get a new frame from camera and start processing
//Our codes ...
if(waitKey(30) >= 0) break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment