OpenCv not initializing usb camera
- by brainbarshan
I am trying to capture video from usb camera using OpenCv.
#include <highgui.h>
#include <iostream>
using namespace std;
using namespace cv ;
int main()
{
VideoCapture cap (-1);
if(!cap.isOpened())
cout << "Cam initialize failed" ;
else cout << "Cam initialized" ;
return 0;
}
It is failing to initialize the camera. cap.isOpened() is returning zero.
The same program, with same version of OpenCv and same usb camera, is correctly running in my friend's machine.
I am running fedora 16.
I did some searching in Google and Stack Overflow. But no useful help.
Any idea ?