title: How to give Start, stop, capture and close buttons in Opencv Cam window in Python
body: <p>How to give start, stop, capture, and close buttons in video capture window to start, to stop, to take snapshot, to close the window?</p>
  
  <p>I am using the below code to to open camera for video streaming:</p>
  
  <pre><code>import cv2.cv as cv
      cv.NamedWindow("camera", 1)
      capture = cv.CaptureFromCAM(0)
      while True:
          img = cv.QueryFrame(capture)
          cv.ShowImage("camera", img)
          if cv.WaitKey(10) == 27:
              break
  </code></pre>