mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Added camera open check
This commit is contained in:
@@ -171,6 +171,11 @@ int main(int argc, char** argv) {
|
||||
else
|
||||
cap.open(0);
|
||||
|
||||
if (!cap.isOpened()) {
|
||||
cerr << "Error: Video could not be opened." << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
namedWindow("Input", WINDOW_AUTOSIZE);
|
||||
namedWindow("Output", WINDOW_AUTOSIZE);
|
||||
moveWindow("Output", 200, 0);
|
||||
|
||||
Reference in New Issue
Block a user