title: How do I capture images in OpenCV and saving in pgm format?
body: <p>I am brand new to programming in general, and am working on a project for which I need to capture images from my webcam (possibly using OpenCV), and save the images as pgm files. </p>
  
  <p>What's the simplest way to do this? Willow Garage provides this code for image capturing:</p>
  
  <p><a href="http://opencv.willowgarage.com/wiki/CameraCapture" rel="nofollow noreferrer">http://opencv.willowgarage.com/wiki/CameraCapture</a></p>
  
  <p>Using this code as a base, how might I modify it to:</p>
  
  <ol>
  <li>capture an image from the live cam every 2 seconds</li>
  <li>save the images to a folder in pgm format</li>
  </ol>
  
  <p>Thanks so much for any help you can provide!</p>