@@ -39,17 +39,19 @@ Mat Input::readWebcam() | |||
Mat image; | |||
if(!cap.isOpened()) { | |||
cout << "Fehler"; | |||
cout << "Video capture not opened" << std::endl; | |||
return Mat(); | |||
} | |||
cap.grab(); | |||
if(!cap.grab()) { | |||
cout << "Could not grab frame from camera" << std::endl; | |||
return Mat(); | |||
} | |||
cap.retrieve(image); | |||
return image; | |||
} | |||
void Input::freeWebcam() | |||
{ | |||
this->cap.release(); | |||
} | |||
} |