jAER project on SourceForge

net.sf.jaer.eventprocessing.tracking
Class MultiLineClusterTracker.LineCluster

java.lang.Object
  extended by net.sf.jaer.eventprocessing.tracking.MultiLineClusterTracker.LineCluster
Enclosing class:
MultiLineClusterTracker

public class MultiLineClusterTracker.LineCluster
extends java.lang.Object

Represents a single tracked line. It is characterized mainly by the normal to it from the chip image LL corner. rhoPixels is the length of the normal in pixels and thetaRad is the angle of the normal in radians CCW from x-axis.


Field Summary
protected  java.awt.Color color
           
protected  int firstTimestamp
           
protected  float instantaneousEventRate
           
protected  float instantaneousISI
           
protected  int lastTimestamp
           
 double length
           
 java.awt.geom.Point2D.Float location
          center or average line location of cluster in pixels
protected  int MAX_PATH_LENGTH
           
protected  int numEvents
           
 java.awt.geom.Point2D.Float velocity
          velocity of cluster in pixels/tick, where tick is timestamp tick (usually microseconds)
 
Constructor Summary
MultiLineClusterTracker.LineCluster()
           
MultiLineClusterTracker.LineCluster(MultiLineClusterTracker.LineCluster one, MultiLineClusterTracker.LineCluster two)
          Constructs a cluster by merging two clusters.
MultiLineClusterTracker.LineCluster(net.sf.jaer.eventprocessing.tracking.MultiLineClusterTracker.LineSegment s)
           
 
Method Summary
 void addSegment(net.sf.jaer.eventprocessing.tracking.MultiLineClusterTracker.LineSegment seg)
          Adds the segment to this LineCluster
 double distanceAbsTo(MultiLineClusterTracker.LineCluster c)
           
 double distanceAbsTo(net.sf.jaer.eventprocessing.tracking.MultiLineClusterTracker.LineSegment c)
           
 double distanceMetric(double dRhoPixels, double dThetaRad)
          computes metric of distance in rho/theta space, normalizing each by appropriate size: rho by chip.getMaxSize() and theta by Math.PI.
 float getAvgEventRate()
           
 float getAvgISI()
           
 int getClusterNumber()
           
 java.awt.Color getColor()
           
 int getLastEventTimestamp()
           
 int getLifetime()
           
 java.awt.geom.Point2D.Float getLocation()
           
 double getRhoPixels()
          length of normal to line in pixels from chip LL corner
 double getThetaDeg()
          Angle of normal to line CCW from x axis with 0 and 180 being horizontal and 90 being vertical.
 double getThetaRad()
          Angle of normal to line CCW from x axis with 0 and PI being horizontal and PI/2 being vertical.
 java.awt.geom.Point2D.Float getVelocity()
           
 boolean isOverlapping(MultiLineClusterTracker.LineCluster c)
          Returns true if cluster overlapped another cluster
 boolean isVisible()
           
 void setAvgEventRate(float avgEventRate)
           
 void setAvgISI(float avgISI)
           
 void setClusterNumber(int clusterNumber)
           
 void setColor(java.awt.Color color)
           
 void setColorAccordingToAge()
          Sets color according to age of cluster
 void setLocation(java.awt.geom.Point2D.Float l)
           
 void setRhoPixels(double rhoPixels)
           
 void setThetaRad(double thetaRad)
           
 java.lang.String toString()
           
 void updatePath()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

location

public java.awt.geom.Point2D.Float location
center or average line location of cluster in pixels


velocity

public java.awt.geom.Point2D.Float velocity
velocity of cluster in pixels/tick, where tick is timestamp tick (usually microseconds)


MAX_PATH_LENGTH

protected final int MAX_PATH_LENGTH
See Also:
Constant Field Values

color

protected java.awt.Color color

numEvents

protected int numEvents

lastTimestamp

protected int lastTimestamp

firstTimestamp

protected int firstTimestamp

instantaneousEventRate

protected float instantaneousEventRate

instantaneousISI

protected float instantaneousISI

length

public double length
Constructor Detail

MultiLineClusterTracker.LineCluster

public MultiLineClusterTracker.LineCluster()

MultiLineClusterTracker.LineCluster

public MultiLineClusterTracker.LineCluster(net.sf.jaer.eventprocessing.tracking.MultiLineClusterTracker.LineSegment s)

MultiLineClusterTracker.LineCluster

public MultiLineClusterTracker.LineCluster(MultiLineClusterTracker.LineCluster one,
                                           MultiLineClusterTracker.LineCluster two)
Constructs a cluster by merging two clusters. All parameters of the resulting cluster should be reasonable combinations of the source cluster parameters. For example, the merged location values are weighted by the number of events that have supported each source cluster, so that older clusters weigh more heavily in the resulting cluster location. Subtle bugs or poor performance can result from not properly handling the merging of parameters.

Parameters:
one - the first cluster
two - the second cluster
Method Detail

getLastEventTimestamp

public int getLastEventTimestamp()

addSegment

public void addSegment(net.sf.jaer.eventprocessing.tracking.MultiLineClusterTracker.LineSegment seg)
Adds the segment to this LineCluster

Parameters:
seg - the line segment

distanceMetric

public double distanceMetric(double dRhoPixels,
                             double dThetaRad)
computes metric of distance in rho/theta space, normalizing each by appropriate size: rho by chip.getMaxSize() and theta by Math.PI. Returns normalized distance metric which can be used for searching for closest LineCluster to a LineSegment

Parameters:
dRhoPixels - distance in pixels, assumed non negative
dThetaRad - distance in radians, assumed non negative

distanceAbsTo

public double distanceAbsTo(MultiLineClusterTracker.LineCluster c)
Returns:
distance of this cluster to the other cluster, abs value in normalized units combining rho and theta

distanceAbsTo

public double distanceAbsTo(net.sf.jaer.eventprocessing.tracking.MultiLineClusterTracker.LineSegment c)
Returns:
distance of this cluster to the other cluster, abs value in normalized units combining rho and theta

isOverlapping

public boolean isOverlapping(MultiLineClusterTracker.LineCluster c)
Returns true if cluster overlapped another cluster

Parameters:
c - the other cluster

getLocation

public final java.awt.geom.Point2D.Float getLocation()

setLocation

public void setLocation(java.awt.geom.Point2D.Float l)

isVisible

public final boolean isVisible()
Returns:
true if cluster has enough support

getLifetime

public final int getLifetime()
Returns:
lifetime of cluster in timestamp ticks

updatePath

public final void updatePath()

toString

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

getColor

public java.awt.Color getColor()

setColor

public void setColor(java.awt.Color color)

getVelocity

public java.awt.geom.Point2D.Float getVelocity()
Returns:
averaged velocity of cluster in pixels per second. The velocity is instantaneously computed from the movement of the cluster caused by the last event, then this velocity is mixed with the the old velocity by the mixing factor. Thus the mixing factor is appplied twice: once for moving the cluster and again for changing the velocity.

setColorAccordingToAge

public void setColorAccordingToAge()
Sets color according to age of cluster


getClusterNumber

public int getClusterNumber()

setClusterNumber

public void setClusterNumber(int clusterNumber)

getAvgISI

public float getAvgISI()
Returns:
average ISI for this cluster in timestamp ticks. Average is computed using cluster location mising factor.

setAvgISI

public void setAvgISI(float avgISI)

getAvgEventRate

public float getAvgEventRate()
Returns:
average event rate in spikes per timestamp tick. Average is computed using location mixing factor. Note that this measure emphasizes the high spike rates because a few events in rapid succession can rapidly push up the average rate.

setAvgEventRate

public void setAvgEventRate(float avgEventRate)

getThetaRad

public double getThetaRad()
Angle of normal to line CCW from x axis with 0 and PI being horizontal and PI/2 being vertical. thetaRad spans -PI to PI.


setThetaRad

public void setThetaRad(double thetaRad)

getThetaDeg

public double getThetaDeg()
Angle of normal to line CCW from x axis with 0 and 180 being horizontal and 90 being vertical. thetaDeg spans -180 to 180.


getRhoPixels

public double getRhoPixels()
length of normal to line in pixels from chip LL corner


setRhoPixels

public void setRhoPixels(double rhoPixels)

jAER project on SourceForge