Module Camera :: Class Camera
[hide private]
[frames] | no frames]

Class Camera

source code

Class that represents a camera attached to servo motor platform. Horizontal servo at servo port 1 (S13 header) Vertical servo at servo port 2 (S14 header)

Instance Methods [hide private]
 
__init__(self)
Creates a camera instance.
source code
 
captureJPEG(self, width, height)
Takes a camera picture with given picture size and returns the image in JPEG format.
source code
 
saveData(self, data, filename)
Writes the given string data into a binary file.
source code
 
captureAndSave(self, width, height, filename)
Takes a camera picture with given picture size and stores is in JPEG format.
source code
 
_checkRobot(self) source code
Method Details [hide private]

captureJPEG(self, width, height)

source code 

Takes a camera picture with given picture size and returns the image in JPEG format. The picture resolution is width x height (max: 5 MPix)

Parameters:
  • width - the width of the picture in pixels (max: 2592)
  • height - the height of the picture in pixels (max: 1944) return: the image in JPEG format (as string); None, if the capture fails

saveData(self, data, filename)

source code 

Writes the given string data into a binary file.

Parameters:
  • data - the data to store (as string type)
  • filename - a valid filename in the local file space

captureAndSave(self, width, height, filename)

source code 

Takes a camera picture with given picture size and stores is in JPEG format. The picture resolution is width x height (max: 5 MPix)

Parameters:
  • width - the width of the picture in pixels (max: 2592)
  • height - the height of the picture in pixels (max: 1944)
  • filename - a valid filename in the local file space, e.g. /home/pi/shot1.jpg