jAER project on SourceForge

net.sf.jaer.event
Class MotionOrientationEvent

java.lang.Object
  extended by net.sf.jaer.event.BasicEvent
      extended by net.sf.jaer.event.TypedEvent
          extended by net.sf.jaer.event.PolarityEvent
              extended by net.sf.jaer.event.OrientationEvent
                  extended by net.sf.jaer.event.MotionOrientationEvent
All Implemented Interfaces:
EventInterface<BasicEvent>

public class MotionOrientationEvent
extends OrientationEvent

Represents an event with direction of motion and delay

Author:
tobi

Nested Class Summary
static class MotionOrientationEvent.Dir
          represents a direction.
 
Nested classes/interfaces inherited from class net.sf.jaer.event.OrientationEvent
OrientationEvent.UnitVector
 
Nested classes/interfaces inherited from class net.sf.jaer.event.PolarityEvent
PolarityEvent.Polarity
 
Field Summary
 short delay
          the 'delay' value of this cell, an analog (but quantized) quantity that signals the time delay assoicated with this event.
 MotionOrientationEvent.Dir dir
          unit vector of direction of motion
 byte direction
          the direciton of motion, a quantized value indexing into Dir
 byte distance
          the distance associated with this motion event.
 float speed
          speed in pixels per second
static MotionOrientationEvent.Dir[] unitDirs
          An array of 8 nearest-neighbor unitDirs going CCW from down (south) direction.
 java.awt.geom.Point2D.Float velocity
          stores computed velocity (DirectionSelectiveFilter computes it).
 
Fields inherited from class net.sf.jaer.event.OrientationEvent
hasOrientation, orientation, unitVectors
 
Fields inherited from class net.sf.jaer.event.PolarityEvent
polarity
 
Fields inherited from class net.sf.jaer.event.TypedEvent
type
 
Fields inherited from class net.sf.jaer.event.BasicEvent
timestamp, x, y
 
Constructor Summary
MotionOrientationEvent()
          Creates a new instance of MotionOrientationEvent
 
Method Summary
static java.awt.geom.Point2D.Float computeMotionVector(MotionOrientationEvent e)
           
static float computeSpeedPPS(MotionOrientationEvent e)
           
 void copyFrom(BasicEvent src)
          copies fields from source event src to this event
 int getNumCellTypes()
          Returns the number of types this type of event has, e.g.
 int getType()
          Orientation type output takes values 0-3; 0 is a horizontal edge (0 deg), 1 is an edge tilted up and to right (rotated CCW 45 deg), 2 is a vertical edge (rotated 90 deg), 3 is tilted up and to left (rotated 135 deg from horizontal edge).
 java.lang.String toString()
           
 
Methods inherited from class net.sf.jaer.event.BasicEvent
getTimestamp, getX, getY, setTimestamp, setX, setY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

direction

public byte direction
the direciton of motion, a quantized value indexing into Dir


dir

public MotionOrientationEvent.Dir dir
unit vector of direction of motion


delay

public short delay
the 'delay' value of this cell, an analog (but quantized) quantity that signals the time delay assoicated with this event. Smaller time delays signal larger speed


distance

public byte distance
the distance associated with this motion event. This is the distance in pixels to the prior event that signaled this direction


speed

public float speed
speed in pixels per second


velocity

public java.awt.geom.Point2D.Float velocity
stores computed velocity (DirectionSelectiveFilter computes it). This vector points in the direction of motion and has units of pixels per second (PPS).


unitDirs

public static final MotionOrientationEvent.Dir[] unitDirs
An array of 8 nearest-neighbor unitDirs going CCW from down (south) direction.

these unitDirs are indexed by inputType, then by (inputType+4)%8 (opposite direction) when input type is orientation, then input type 0 is 0 deg horiz edge, so first index could be to down, second to up so list should start with down IMPORTANT, this order *depends* on DirectionSelectiveFilter order of orientations

Constructor Detail

MotionOrientationEvent

public MotionOrientationEvent()
Creates a new instance of MotionOrientationEvent

Method Detail

getType

public int getType()
Description copied from class: OrientationEvent
Orientation type output takes values 0-3; 0 is a horizontal edge (0 deg), 1 is an edge tilted up and to right (rotated CCW 45 deg), 2 is a vertical edge (rotated 90 deg), 3 is tilted up and to left (rotated 135 deg from horizontal edge).

Specified by:
getType in interface EventInterface<BasicEvent>
Overrides:
getType in class OrientationEvent
Returns:
the type
See Also:
OrientationEvent.hasOrientation

toString

public java.lang.String toString()
Overrides:
toString in class OrientationEvent

getNumCellTypes

public int getNumCellTypes()
Description copied from interface: EventInterface
Returns the number of types this type of event has, e.g. 2 for a PolarityEvent or 4 for an OrientationEvent

Specified by:
getNumCellTypes in interface EventInterface<BasicEvent>
Overrides:
getNumCellTypes in class OrientationEvent
Returns:
number of types

copyFrom

public void copyFrom(BasicEvent src)
copies fields from source event src to this event

Specified by:
copyFrom in interface EventInterface<BasicEvent>
Overrides:
copyFrom in class OrientationEvent
Parameters:
src - the event to copy from

computeSpeedPPS

public static float computeSpeedPPS(MotionOrientationEvent e)

computeMotionVector

public static java.awt.geom.Point2D.Float computeMotionVector(MotionOrientationEvent e)
Returns:
the newly-computed motion vector that uses the distance of the event and the delay. The speed is the distance divided by the delay and is in pixels per second.

jAER project on SourceForge