title: how to correctly use webcam in opencv using python wrappers?
body: <p>Currently, I have this working example:</p>
  
  <pre><code>import cv
  
  capture = cv.CaptureFromCAM(0)
  
  cv.NamedWindow('image')
  
  while True:
  
      frame = cv.QueryFrame(capture)
      cv.ShowImage('image', frame)
  
      k = cv.WaitKey(10)
  
      if k % 256 == 27:
          break
  
  cv.DestroyWindow('image');
  </code></pre>
  
  <p>But, the resource is not properly release. This <a href="https://stackoverflow.com/a/6974470/1094999">post</a> suggests using <code>del(capture)</code> but, in <a href="https://stackoverflow.com/a/9770328/1094999">this</a> other recommends using <code>cvReleaseCapute</code> (but I can't find that function ).</p>
  
  <p>Which is the correct way to release the capture?</p>
  
  <p>This is my opencv version:</p>
  
  <pre><code>In [4]: from cv2 import __version__
  In [5]: __version__
  Out[5]: '$Rev: 4557 $'
  </code></pre>