title: OpenCV not initializing USB camera
body: <p>I am trying to capture video from a USB camera using OpenCV.</p>
  
  <pre><code>#include &lt;highgui.h&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  using namespace cv;
  
  int main()
  {
      VideoCapture cap (-1);
      if (!cap.isOpened())
           cout &lt;&lt; "Cam initialize failed";
      else cout &lt;&lt; "Cam initialized";
  
      return 0;
  }
  </code></pre>
  
  <p>It is failing to initialize the camera. cap.isOpened() is returning zero.</p>
  
  <p>The same program, with same version of OpenCV and the same USB camera,  is correctly running in my friend's machine. I am running <a href="http://en.wikipedia.org/wiki/Fedora_%28operating_system%29" rel="nofollow">Fedora</a> 16. The camera is properly working in another application (for example, <a href="http://blekko.com/ws/?q=site%3Aen.wikipedia.org%20Cheese%20software" rel="nofollow">Cheese</a>).</p>
  
  <p>I did some searching in Google and Stack Overflow. But no useful help.
  Any idea?</p>