title: imshow window freeze in opencv
body: <p>I'm doing opencv with leap motion. when I try to create a window with black screen but the window freezes and not respond. anyone have this problem? this is my code.</p>
  
  <pre><code>Mat PaintShow( 480,640,CV_8UC3);
  int main(int argc, char* argv[])
  {
  
      rectangle( PaintShow,Point( 0, 0),Point( 2000, 2000),Scalar( 0, 0, 0 ),-1,8 );
  
      // Create a sample listener and controller
      SampleListener listener;
      Leap::Controller controller;
          .
          .
          .
  }
  </code></pre>
  
  <p>the following is the leap motion method which update every few ms. so I put imshow here</p>
  
  <pre><code>void SampleListener::onFrame(const Leap::Controller&amp; controller) 
  {
      const Leap::Frame frame = controller.frame();      
      imshow("PaintShow",PaintShow);
      .
      .
      .
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/TCzDj.png" alt="enter image description here"></p>