Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

3. Image Sources > The Local Camera Revisited

The Local Camera Revisited

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


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint