Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
We first looked at working with a locally connected camera in the “Hello World” program in Chapter 2. For reference, here is that program again:
from SimpleCV import Camera, Display, Image # Initialize the camera cam = Camera() # Initialize the display display = Display() # Snap a picture using the camera img = cam.getImage() # Show the picture on the screen img.save(display)
The salient points to remember here are:
To work with a locally connected camera, first import the Camera class
Then use the Camera() constructor to initialize a
camera object