net.sf.jaer.eventprocessing.tracking
Class ClusterTracker.Cluster
java.lang.Object
net.sf.jaer.eventprocessing.tracking.ClusterTracker.Cluster
- Enclosing class:
- ClusterTracker
public class ClusterTracker.Cluster
- extends java.lang.Object
Represents a single tracked object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
location
public java.awt.geom.Point2D.Float location
velocity
public java.awt.geom.Point2D.Float velocity
tauMsVelocity
public float tauMsVelocity
MAX_PATH_LENGTH
protected final int MAX_PATH_LENGTH
- See Also:
- Constant Field Values
path
protected java.util.ArrayList<java.awt.geom.Point2D.Float> path
color
protected java.awt.Color color
numEvents
protected int numEvents
lastTimestamp
protected int lastTimestamp
firstTimestamp
protected int firstTimestamp
eventRate
protected float eventRate
ClusterTracker.Cluster
public ClusterTracker.Cluster()
ClusterTracker.Cluster
public ClusterTracker.Cluster(BasicEvent ev)
ClusterTracker.Cluster
public ClusterTracker.Cluster(ClusterTracker.Cluster one,
ClusterTracker.Cluster two)
- Constructs a cluster by merging two clusters
getLastEventTimestamp
public int getLastEventTimestamp()
addEvent
public void addEvent(BasicEvent event)
scale
public final void scale(BasicEvent event)
- sets the cluster radius according to distance of event from cluster center
- Parameters:
event
- the event to scale with
distanceTo
public float distanceTo(BasicEvent event)
- Returns:
- distance of this cluster to the event in manhatten (cheap) metric (sum of abs values of x and y distance
distanceMetric
public float distanceMetric(float dx,
float dy)
distanceTo
protected final float distanceTo(ClusterTracker.Cluster c)
- Returns:
- distance of this cluster to the other cluster
getRadius
public final float getRadius()
setRadius
public void setRadius(float r)
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
getPath
public java.util.ArrayList<java.awt.geom.Point2D.Float> getPath()
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.
getClusterNumber
public int getClusterNumber()
setClusterNumber
public void setClusterNumber(int clusterNumber)