Package pyrobot :: Package camera :: Package v4l :: Class V4LCamera
[frames | no frames]

Class V4LCamera

      Device --+    
               |    
PyrobotImage --+    
               |    
          Camera --+
                   |
                  V4LCamera


A Wrapper class for the C fuctions that capture data from the Camera.
It uses the Video4linux API, and the image is kept in memory through
an mmap.

Method Summary
  __init__(self, width, height, depth, device, channel, title, visionSystem, visible)
Device should be the name of the capture device in the /dev directory.
  update(self)
Since data is mmaped to the capture card, all we have to do is call refresh.
    Inherited from Camera
  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)
  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, device='/dev/video0', channel=1, title=None, visionSystem=None, visible=1)
(Constructor)

Device should be the name of the capture device in the /dev directory.
This is highly machine- and configuration-dependent, so make sure you
know what works on your system
Channel -  0: television; 1: composite; 2: S-Video
Overrides:
pyrobot.camera.Camera.__init__

update(self)

Since data is mmaped to the capture card, all we have to do is call
refresh.
Overrides:
pyrobot.camera.Camera.update

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