samples: videocapture_camera use VideoCapture with 0 index
authorAlexander Alekhin <alexander.alekhin@intel.com>
Tue, 3 Jul 2018 12:44:53 +0000 (15:44 +0300)
committerAlexander Alekhin <alexander.alekhin@intel.com>
Tue, 3 Jul 2018 12:44:53 +0000 (15:44 +0300)
Not all backends support -1 index.

samples/cpp/videocapture_camera.cpp

index 4d5a341..ca39b20 100644 (file)
@@ -11,7 +11,7 @@ int main(int, char**)
 {
     Mat frame;
     cout << "Opening camera..." << endl;
-    VideoCapture capture(-1); // open the first available camera
+    VideoCapture capture(0); // open the first camera
     if (!capture.isOpened())
     {
         cerr << "ERROR: Can't initialize camera capture" << endl;