Reputation: 1613
I'm trying to open my usb camera on my Raspberry Pi using the following code:
VideoCapture capture;
capture.open(0);
The code can work perfectly one time but after running it again later I get:
HIGHGUI ERROR: V4L: index 0 is not correct!
without touching the camera or the code! Sometimes changing to capture.open(1);
solves it but sometimes not. I read somewhere you can use (-1)
and it will use the first camera it finds but that didn't work either.
Upvotes: 0
Views: 996