title: OpenCV - is the .clone() function needed to double buffer a video source?
body: <p>I'm trying to double buffer my VideoCapture output in my OpenCV program (to reduce flicker).  Here's the concept so far:</p>
  
  <pre><code>    Mat frameA, frameB;  //alternating between these two for storage
      VideoCapture cap(0); // open the default camera
      for(;;)
      {
          cap &gt;&gt; frameB; 
          waitKey(30);
          cap &gt;&gt; frameA;
          waitKey(30);
  
  
          putText(frameA,SSTR("A"),Point(frameA.cols/2,frameA.rows/2),3,5,CV_RGB(250,200,200));
          putText(frameB,SSTR("B"),Point(frameA.cols/2,frameB.rows/2),3,5,CV_RGB(250,200,200));
  
  
          imshow("A",frameA);
          imshow("B",frameB);
  
          waitKey(30);
  
      }
  </code></pre>
  
  <p>as a simple test I write the text A or B in the center of the frame.  But the output has A and B overlapping - as if there were not two separate frames.  What am I doing wrong?<br>
  I have made a solution by using the .clone() operator, but I understand that that sort of thing is horribly expensive in terms of CPU (?) and so would like to avoid it.  Hopefully we've got some C++ double buffering experts here.</p>