title: Capturing from Macbook Pro iSight with Opencv
body: <p>I'm trying to capture frames from a Macbook Pro's iSight using OpenCV 2.4.6, and built using the Apple LLVM 4.2 compiler on Xcode.</p>
  
  <p>However, I don't receive any frames. Usually I set up a while loop to run until the frame is full, but the one below runs for ~30 seconds with no result. How can I debug this?</p>
  
  <pre><code>void testColourCapture() {
  
      cv::VideoCapture capture = cv::VideoCapture(0); //open default camera
      if(!capture.isOpened()) {
          fprintf( stderr, "ERROR: ColourInput capture is NULL \n" );
      }
      cv::Mat capFrame;
  
      int frameWaits = 0;
      while (capFrame.empty()) {
          capture.read(capFrame);
          //capture &gt;&gt; capFrame;
          cvWaitKey(30);
          frameWaits++;
          std::cout &lt;&lt; "capture &gt;&gt; capFrame " &lt;&lt; frameWaits &lt;&lt; "\n";
          if (frameWaits &gt; 1000) {
              break;
          }
      }
      imshow("capFrame", capFrame);
  
  }
  </code></pre>
  
  <p>I have ensured it is not multi-threaded. Also, capture.isOpened is always returning true.</p>
  
  <p>EDIT: It appears others have had this problem: <a href="https://stackoverflow.com/questions/19059459/opencv-wont-capture-from-macbook-pro-isight">OpenCV wont&#39; capture from MacBook Pro iSight</a></p>
  
  <p>EDIT: My procedure for installing opencv was: </p>
  
  <p>$ sudo port selfupdate</p>
  
  <p>$ sudo port install opencv</p>
  
  <p>Then, I dragged libopencv_core.dylib, libopencv_highgui.dylib, libopencv_imgproc.dylib and libopencv_video.dylib into the Frameworks folder of my Xcode project, from /opt/local/lib</p>