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

Class Camera

source code

Class that represents the Raspberry Pi camera.

Instance Methods [hide private]
 
__init__(self)
Creates an instance of a camera.
source code
 
_setup(self, robot) source code
 
captureAndSave(self, width, height, filename)
Takes a camera picture with given picture size and stores is in JPEG format on the remote device.
source code
str
captureAndTransfer(self, width, height)
Performs a camera capture with given resolution width x height in pixels.
source code
 
saveData(self, data, filename)
Writes the given string data into a binary file.
source code
 
_checkRobot(self) source code
Method Details [hide private]

captureAndSave(self, width, height, filename)

source code 

Takes a camera picture with given picture size and stores is in JPEG format on the remote device. 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 remote file space, e.g. /home/pi/shot1.jpg

captureAndTransfer(self, width, height)

source code 

Performs a camera capture with given resolution width x height in pixels. The camera picture is hold in memory on the remote device and transferred in JPEG format to the local device.

Returns: str
Binary data holding the jpeg formated image (as string).

saveData(self, data, filename)

source code 

Writes the given string data into a binary file.

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