Package pyrobot :: Package camera :: Class Camera
[frames | no frames]

Class Camera

      Device --+
               |
PyrobotImage --+
               |
              Camera

Known Subclasses:
AiboCamera, BlobCamera, BT848Camera, FakeCamera, ManualFakeCamera, PlayerCamera, RobocupCamera, V4LCamera

A base class for Camera

Method Summary
  __init__(self, width, height, depth, title, parent, visible)
To specify the resolution of a particular camera, overload this...
  addFilter(self, func, *args)
Add a filter to the filter list.
  apply(self, command, *args)
  clearCallbackList(self)
  clearFilters(self)
  delFilter(self, pos)
  getCanvasHeight(self)
  getCanvasWidth(self)
  getData(self)
  getDeviceData(self)
Returns the device data, whatever it might be.
  getDeviceState(self)
Returns the .state.
  getFilterList(self)
  getImage(self)
  hideWindow(self)
  listCallbackList(self)
  loadFilters(self)
  makeFilterMenu(self, data)
  makeMenu(self, bar, name, commands)
Assumes self.menuButtons exists...
  makeWindow(self)
Method to make and show the device window.
  pauseButton(self)
  playButton(self)
  popCallbackList(self)
  popFilterList(self)
  printit(self, event)
  processAll(self)
  processLeftClickDown(self, event)
  processLeftClickUp(self, event)
  processMiddleClick(self, event)
  processRightClick(self, event)
  saveAsTGA(self, path)
Save a copy of the image to disk, in TGA format (Gimp and display can read it).
  saveFilters(self)
  saveImage(self)
  setFilterList(self, filterList)
Filters take the form: ("name", (args))...
  setTitle(self, title)
Sets the title of the device.
  setUpdateInterval(self, val)
  startDevice(self)
Starts the device (sets the .state).
  stopDevice(self)
Stops the device (sets the .state).
  toggleFilterMode(self)
  togglePlay(self, event)
  update(self)
Update method for getting next sequence from a video camera.
  updateButton(self)
  updateDevice(self)
Method called to update the device properties.
  updateOnce(self)
  updateWindow(self)
Method to update the device window.
    Inherited from PyrobotImage
  convolve(self, convmask, bit, threshold)
  cropPixels(self, l, t, r, b)
cropPixels() ------------ crops pixels in the amount specified from left, top, right, and bottom if unspecified, right is assumed to be the same as left and bottom the same as top.
  display(self)
Display PyrobotImage in ASCII Art.
  get(self, x, y, offset)
Get a pixel value.
  getBitmap(self, cutoff, cutoff2, mode)
getBitmap()...
  getCol(self, x)
Get the entire col, in tuples...
  getColorFilter(self, r, g, b)
returns a filtered image r,g,b values indicate percentage of each color to keep eg.
  getDim(self)
  getGrayScale(self)
Method to convert depth 3 color into depth 1 grayscale...
  getPlane(self, colorPlane)
  getRow(self, y)
Get the entire row, in tuples...
  getScaledImage(self, xscale, yscale, mode)
return a scaled version of the current image...
  getVal(self, x, y)
Get the entire color value of the pixel in quetion, returned as a tuple.
  histogram(self, cols, rows, initvals)
Creates a histogram.
  incr(self, x, y, offset)
Method to increment a pixel value.
  loadFromFile(self, filename)
Method to load image from file.
  reset(self, vector)
Reset an image to a vector.
  resetToColor(self, r, g, b)
reset the image to a specified color...
  saveToFile(self, filename)
Method to save image to a file.
  setVal(self, x, y, val)
Method to set the entire RGB value of a pixel.
  swapPlanes(self, plane1, plane2)
    Inherited from Device
  __getitem__(self, item)
Get a SensorValue, a range, or a set.
  __iter__(self)
Used to iterate through SensorValues of device.
  addWidgets(self, window)
Method to addWidgets to the device window.
  angle(self, *args, **kwargs)
Device-level method to get all of the angles.
  destroy(self)
Hides the window.
  distance(self, *args, **kwargs)
Device-level method to get all of the distances.
  getActive(self)
Returns the value of .active.
  getGroupNames(self, pos)
Return all of the groups a pos is in.
  getMaxvalue(self)
Get the maxvalue of the sensor.
  getSensorValue(self, pos)
Returns a specific SensorValue from the range device.
  getVisible(self)
Returns the .visible of the sensor.
  rawToUnits(self, raw, noise, units)
Convert the sensor units into default units.
  setActive(self, value)
Sets the .active property.
  setMaxvalue(self, value)
Set the maxvalue of the sensor.
  setup(self)
Use this to put setup code in (instead of in __init__).
  setVisible(self, value)
Sets the .visible attribute, and hides/shows window.

Property Summary
    Inherited from Device
  geometry
  noise
  pos
  rawValue
  value

Method Details

__init__(self, width, height, depth=3, title='Camera View', parent=None, visible=1)
(Constructor)

To specify the resolution of a particular camera, overload this
constructor with one that initalizes the dimensions itself
Overrides:
pyrobot.vision.PyrobotImage.__init__

addFilter(self, func, *args)

Add a filter to the filter list.
Example: self.robot.camera[0].addFilter( "superColor", 3)

getDeviceData(self)

Returns the device data, whatever it might be.
Overrides:
pyrobot.robot.device.Device.getDeviceData (inherited documentation)

getDeviceState(self)

Returns the .state.
Overrides:
pyrobot.robot.device.Device.getDeviceState (inherited documentation)

makeMenu(self, bar, name, commands)

Assumes self.menuButtons exists

makeWindow(self)

Method to make and show the device window.
Overrides:
pyrobot.robot.device.Device.makeWindow (inherited documentation)

saveAsTGA(self, path='~/V4LGrab.tga')

Save a copy of the image to disk, in TGA format (Gimp and display
can read it).

path is the name of the save file, and defaults to '~/V4LGrab.tga'

setFilterList(self, filterList)

Filters take the form: ("name", (args))
Example: cam.setFilterList([("superColor",1,-1,-1,0),("meanBlur",3)])

setTitle(self, title)

Sets the title of the device.
Overrides:
pyrobot.robot.device.Device.setTitle (inherited documentation)

startDevice(self)

Starts the device (sets the .state).
Overrides:
pyrobot.robot.device.Device.startDevice (inherited documentation)

stopDevice(self)

Stops the device (sets the .state).
Overrides:
pyrobot.robot.device.Device.stopDevice (inherited documentation)

update(self)

Update method for getting next sequence from a video camera.

updateDevice(self)

Method called to update the device properties.
Overrides:
pyrobot.robot.device.Device.updateDevice (inherited documentation)

updateWindow(self)

Method to update the device window.
Overrides:
pyrobot.robot.device.Device.updateWindow (inherited documentation)

Generated by Epydoc 2.1 on Mon Jul 25 01:39:28 2005 http://epydoc.sf.net