8 Capturing and viewing images
During this lab, keep in mind that you can always reset the pan-tilt platform to the default position by typing:
initPanTilt
into the Command Window.
8.1 Viewing the video feed from the camera
You can see the video that the camera is capturing by typing the following into the Command Window:
preview(CAM)
8.2 Capturing an image
In your kit, there should be a piece of white paper with a black stripe on it. Try not to fold or mark the paper during the lab. Capture an image of the piece of paper so that the camera sees only the paper and the black stripe crosses the horizontal midline of the image. To capture an image, type the following into the Command Window (make sure to include the semi-colon):
img = snapshot(CAM);
You will use the captured image to help test the functions that you will write during the lab.
8.3 Viewing the captured image
You can view your captured image by typing the following in the Command Window:
imshow(img)
Your captured image should look similar to the following:
Now capture a second image of something with colour:
colimg = snapshot(CAM);
You will use the captured image to help test the functions that you will write during the lab.
You can view your captured image by typing the following in the Command Window:
imshow(colimg)
My captured image looks like the following: