Now let's see how to use the webcam
1) Connect your webcam to the computer through the USB, or use the intergrated laptop camera.
2) Open Preview window to view video in realtime
1. Capturing an image
To capture an image from the video, define the object vid as described before and use getdata to capture a frame from the video.
2. Storing the image
You can store the captured image as a .jpg or .gif file using imwrite function.
This image will be stored in current work directory folder.