title: I can't capture frames from camera in OpenCV
body: <p>I am trying to detect eyes but I have another problem. I cannot display the camera frame. The problem can be obvious but I am newbie. A part of my code below:</p>
  
  <p>Here is my EyeDetection.h</p>
  
  <pre><code>#include &lt;opencv2/imgproc/imgproc.hpp&gt;
  #include &lt;opencv2/highgui/highgui.hpp&gt;
  #include &lt;opencv2/objdetect/objdetect.hpp&gt;
  
  using namespace cv;
  
  class EyeDetection {
  private:
      CascadeClassifier eye_cascade, eyepair_cascade;
  public:
      EyeDetection();
      void detect();
  }; 
  </code></pre>
  
  <p>Here is my EyeDetection.cpp</p>
  
  <pre><code>#include "EyeDetection.h"
  
  EyeDetection::EyeDetection() {
      eye_cascade.load("haarcascade_eye.xml");
      eyepair_cascade.load("haarcascade_mcs_eyepair_big.xml");
  }
  
  void EyeDetection::detect()
  {
      VideoCapture webcam(1); //Webcam number is 1
      if (eyepair_cascade.empty() || eye_cascade.empty() || !(webcam).isOpened())
          return;
  
      webcam.set(CV_CAP_PROP_FRAME_WIDTH, 800);
      webcam.set(CV_CAP_PROP_FRAME_HEIGHT, 600);
  
      Mat frame;
      while (1) {
          webcam &gt;&gt; frame;
          if (frame.empty()) continue;
          imshow("asad", frame);
      }
  }
  </code></pre>
  
  <p>And here is my Source.cpp(main):</p>
  
  <pre><code>#include "EyeDetection.h"
  
  using namespace cv;
  
  int main(int argc, char** argv)
  {
      EyeDetection e = EyeDetection();
      e.detect();
      return 0;
  }
  </code></pre>
  
  <p>It does not show the camera frame, it shows just a blank gray window. 
  What is the problem?</p>