mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
samples: videocapture_camera use VideoCapture with 0 index
Not all backends support -1 index.
This commit is contained in:
parent
117e97adac
commit
203f95d3be
@ -11,7 +11,7 @@ int main(int, char**)
|
|||||||
{
|
{
|
||||||
Mat frame;
|
Mat frame;
|
||||||
cout << "Opening camera..." << endl;
|
cout << "Opening camera..." << endl;
|
||||||
VideoCapture capture(-1); // open the first available camera
|
VideoCapture capture(0); // open the first camera
|
||||||
if (!capture.isOpened())
|
if (!capture.isOpened())
|
||||||
{
|
{
|
||||||
cerr << "ERROR: Can't initialize camera capture" << endl;
|
cerr << "ERROR: Can't initialize camera capture" << endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user