jAER project on SourceForge

net.sf.jaer.eventprocessing.tracking
Class ClusterTracker

java.lang.Object
  extended by net.sf.jaer.eventprocessing.EventFilter
      extended by net.sf.jaer.eventprocessing.EventFilter2D
          extended by net.sf.jaer.eventprocessing.tracking.ClusterTracker
All Implemented Interfaces:
java.util.EventListener, java.util.Observer, java.util.prefs.PreferenceChangeListener, FrameAnnotater

Deprecated. This class is no longer maintained. Use RectanglularClusterTracker instead.

public class ClusterTracker
extends EventFilter2D
implements FrameAnnotater, java.util.Observer, java.util.prefs.PreferenceChangeListener

Tracks blobs of events. Based (probably very loosely) on conversation with Martin Litzenberger.

The ClusterTracker starts with no clusters. When called with AEPacket2D of events, assigns the first cluster to the median event location, based on MedianTracker notion of median event location, iff the location std dev is not too large. Then every subsequent event that is processed is either assigned to an existing cluster (if the event location is close enough to the cluster center) or a new cluster is generated. A cluster remains until its support fades away, meaning that it lacks support compared with other clusters. Initially, there will be just random clusters corresponding to noise events, but these will quickly be pruned away because they will lack support compared with real clusters, which will have continued support.

Clusters also have persistence: if a cluster has sustained support, then it keeps itself alive according to this support. The implicit (past) support is a quantity that is charged up by support and fades away over time without support. Thus a cluster can survive even when it gets no support for a time. This mechanism keeps clusters from objects that move and then momentarily stop.

Author:
tobi

Nested Class Summary
 class ClusterTracker.ClosestCluster
          Deprecated. Represents a cluster and a distance (the distance of an event to the cluster)
 class ClusterTracker.Cluster
          Deprecated. Represents a single tracked object
 
Field Summary
protected  float aspectRatio
          Deprecated.  
protected  AEChip chip
          Deprecated.  
protected  int clusterCounter
          Deprecated.  
protected  java.util.ArrayList<ClusterTracker.Cluster> clusters
          Deprecated.  
protected  float clusterSize
          Deprecated.  
protected  boolean colorClustersDifferentlyEnabled
          Deprecated.  
protected  float defaultClusterRadius
          Deprecated.  
protected static float fullbrightnessLifetime
          Deprecated.  
protected  boolean growMergedSizeEnabled
          Deprecated.  
protected  float mixingFactor
          Deprecated.  
protected  boolean pathsEnabled
          Deprecated.  
protected  java.util.LinkedList<ClusterTracker.Cluster> pruneList
          Deprecated.  
protected  java.util.Random random
          Deprecated.  
protected  boolean scaleEnabled
          Deprecated.  
protected  float surround
          Deprecated.  
protected  boolean useOffPolarityOnlyEnabled
          Deprecated.  
protected  boolean useOnePolarityOnlyEnabled
          Deprecated.  
protected  float velocityMixingFactor
          Deprecated.  
 
Fields inherited from class net.sf.jaer.eventprocessing.EventFilter2D
enclosedFilter, out
 
Fields inherited from class net.sf.jaer.eventprocessing.EventFilter
annotationEnabled, enclosedFilterChain, filterEnabled, log, perf, propertyTooltipMap, support
 
Constructor Summary
ClusterTracker(AEChip chip)
          Deprecated. Creates a new instance of ClusterTracker
 
Method Summary
 void annotate(float[][][] frame)
          Deprecated. annotate the rendered retina frame to show locations of clusters
 void annotate(javax.media.opengl.GLAutoDrawable drawable)
          Deprecated. Each annotator enters annotate with graphics context current, in coordinates with pixel 0,0 in LL corner (note opposite from Java2D) and pixel spacing 1 unit after the scaling transform (which is already active).
 void annotate(java.awt.Graphics2D g)
          Deprecated. each annotator is called by the relevant class (e.g.
 ClusterTracker.ClosestCluster closestCluster(BasicEvent event)
          Deprecated. method that given AE, returns closest cluster and distance to it.
 EventPacket filterPacket(EventPacket in)
          Deprecated. Subclasses implement this method to define custom processing.
 int getClusterLifetimeWithoutSupport()
          Deprecated. lifetime of cluster in ms without support
 java.util.ArrayList<ClusterTracker.Cluster> getClusters()
          Deprecated.  
 float getClusterSize()
          Deprecated. max distance from cluster to event as fraction of size of array
 java.lang.Object getFilterState()
          Deprecated. should return the filter state in some useful form
 ClusterTracker.ClosestCluster getFirstContainingCluster(BasicEvent event)
          Deprecated. Given AE, returns first cluster that event is within
 int getMaxNumClusters()
          Deprecated. max number of clusters
 float getMixingFactor()
          Deprecated.  
 int getNumClusters()
          Deprecated.  
 java.util.LinkedList<ClusterTracker.Cluster> getPruneList()
          Deprecated.  
 boolean getScaleEnabled()
          Deprecated.  
 float getSurround()
          Deprecated.  
 int getThresholdEventsForVisibleCluster()
          Deprecated. number of events to make a potential cluster visible
 float getVelocityMixingFactor()
          Deprecated.  
 void initFilter()
          Deprecated. this should allocate and initialize memory: it may be called when the chip e.g.
 boolean isColorClustersDifferentlyEnabled()
          Deprecated.  
 boolean isGeneratingFilter()
          Deprecated.  
 boolean isGrowMergedSizeEnabled()
          Deprecated.  
 boolean isHighwayPerspectiveEnabled()
          Deprecated.  
 boolean isLogDataEnabled()
          Deprecated.  
 boolean isPathsEnabled()
          Deprecated.  
 boolean isShowVelocity()
          Deprecated.  
 boolean isUseOffPolarityOnlyEnabled()
          Deprecated.  
 boolean isUseOnePolarityOnlyEnabled()
          Deprecated.  
 void preferenceChange(java.util.prefs.PreferenceChangeEvent evt)
          Deprecated.  
 void resetFilter()
          Deprecated. should reset the filter to initial state
 void setClusterLifetimeWithoutSupport(int clusterLifetimeWithoutSupport)
          Deprecated. lifetime of cluster in ms without support
 void setClusterSize(float clusterSize)
          Deprecated. sets max distance from cluster to event as fraction of size of array
 void setColorClustersDifferentlyEnabled(boolean colorClustersDifferentlyEnabled)
          Deprecated.  
 void setGrowMergedSizeEnabled(boolean growMergedSizeEnabled)
          Deprecated.  
 void setHighwayPerspectiveEnabled(boolean highwayPerspectiveEnabled)
          Deprecated.  
 void setLogDataEnabled(boolean logDataEnabled)
          Deprecated.  
 void setMaxNumClusters(int maxNumClusters)
          Deprecated. max number of clusters
 void setMixingFactor(float mixingFactor)
          Deprecated.  
 void setPathsEnabled(boolean pathsEnabled)
          Deprecated.  
 void setScaleEnabled(boolean scaleEnabled)
          Deprecated.  
 void setShowVelocity(boolean showVelocity)
          Deprecated.  
 void setSurround(float surround)
          Deprecated.  
 void setThresholdEventsForVisibleCluster(int thresholdEventsForVisibleCluster)
          Deprecated. number of events to make a potential cluster visible
 void setUseOffPolarityOnlyEnabled(boolean useOffPolarityOnlyEnabled)
          Deprecated.  
 void setUseOnePolarityOnlyEnabled(boolean useOnePolarityOnlyEnabled)
          Deprecated.  
 void setVelocityMixingFactor(float velocityMixingFactor)
          Deprecated.  
 void update(java.util.Observable o, java.lang.Object arg)
          Deprecated.  
 
Methods inherited from class net.sf.jaer.eventprocessing.EventFilter2D
checkOutputPacketEventType, checkOutputPacketEventType, getEnclosedFilter, resetOut, setEnclosedFilter, setFilterEnabled
 
Methods inherited from class net.sf.jaer.eventprocessing.EventFilter
getChip, getDescription, getEnclosedFilterChain, getEnclosingFilter, getPrefs, getPropertyChangeSupport, getPropertyTooltip, isAnnotationEnabled, isEnclosed, isFilterEnabled, prefsEnabledKey, setAnnotationEnabled, setChip, setEnclosed, setEnclosedFilter, setEnclosedFilterChain, setEnclosingFilter, setPreferredEnabledState, setPrefs, setPropertyTooltip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.jaer.graphics.FrameAnnotater
isAnnotationEnabled, setAnnotationEnabled
 

Field Detail

clusters

protected java.util.ArrayList<ClusterTracker.Cluster> clusters
Deprecated. 

chip

protected AEChip chip
Deprecated. 

defaultClusterRadius

protected float defaultClusterRadius
Deprecated. 

mixingFactor

protected float mixingFactor
Deprecated. 

velocityMixingFactor

protected float velocityMixingFactor
Deprecated. 

surround

protected float surround
Deprecated. 

scaleEnabled

protected boolean scaleEnabled
Deprecated. 

pathsEnabled

protected boolean pathsEnabled
Deprecated. 

colorClustersDifferentlyEnabled

protected boolean colorClustersDifferentlyEnabled
Deprecated. 

useOnePolarityOnlyEnabled

protected boolean useOnePolarityOnlyEnabled
Deprecated. 

useOffPolarityOnlyEnabled

protected boolean useOffPolarityOnlyEnabled
Deprecated. 

aspectRatio

protected float aspectRatio
Deprecated. 

clusterSize

protected float clusterSize
Deprecated. 

growMergedSizeEnabled

protected boolean growMergedSizeEnabled
Deprecated. 

pruneList

protected java.util.LinkedList<ClusterTracker.Cluster> pruneList
Deprecated. 

clusterCounter

protected int clusterCounter
Deprecated. 

fullbrightnessLifetime

protected static final float fullbrightnessLifetime
Deprecated. 
See Also:
Constant Field Values

random

protected java.util.Random random
Deprecated. 
Constructor Detail

ClusterTracker

public ClusterTracker(AEChip chip)
Deprecated. 
Creates a new instance of ClusterTracker

Method Detail

initFilter

public void initFilter()
Deprecated. 
Description copied from class: EventFilter
this should allocate and initialize memory: it may be called when the chip e.g. size parameters are changed after creation of the filter

Specified by:
initFilter in class EventFilter

getNumClusters

public int getNumClusters()
Deprecated. 

closestCluster

public ClusterTracker.ClosestCluster closestCluster(BasicEvent event)
Deprecated. 
method that given AE, returns closest cluster and distance to it. The actual computation returns the first cluster that is within the minDistance of the event, which reduces the computation at the cost of reduced precision.

Parameters:
event - the event
Returns:
closest cluster

getFirstContainingCluster

public ClusterTracker.ClosestCluster getFirstContainingCluster(BasicEvent event)
Deprecated. 
Given AE, returns first cluster that event is within

Parameters:
event - the event
Returns:
cluster that contains event within the cluster's radius

getClusters

public java.util.ArrayList<ClusterTracker.Cluster> getClusters()
Deprecated. 

getPruneList

public java.util.LinkedList<ClusterTracker.Cluster> getPruneList()
Deprecated. 

getClusterLifetimeWithoutSupport

public final int getClusterLifetimeWithoutSupport()
Deprecated. 
lifetime of cluster in ms without support


setClusterLifetimeWithoutSupport

public void setClusterLifetimeWithoutSupport(int clusterLifetimeWithoutSupport)
Deprecated. 
lifetime of cluster in ms without support


getClusterSize

public final float getClusterSize()
Deprecated. 
max distance from cluster to event as fraction of size of array


setClusterSize

public void setClusterSize(float clusterSize)
Deprecated. 
sets max distance from cluster to event as fraction of size of array


getMaxNumClusters

public final int getMaxNumClusters()
Deprecated. 
max number of clusters


setMaxNumClusters

public void setMaxNumClusters(int maxNumClusters)
Deprecated. 
max number of clusters


getThresholdEventsForVisibleCluster

public final int getThresholdEventsForVisibleCluster()
Deprecated. 
number of events to make a potential cluster visible


setThresholdEventsForVisibleCluster

public void setThresholdEventsForVisibleCluster(int thresholdEventsForVisibleCluster)
Deprecated. 
number of events to make a potential cluster visible


getFilterState

public java.lang.Object getFilterState()
Deprecated. 
Description copied from class: EventFilter
should return the filter state in some useful form

Specified by:
getFilterState in class EventFilter

isGeneratingFilter

public boolean isGeneratingFilter()
Deprecated. 

resetFilter

public void resetFilter()
Deprecated. 
Description copied from class: EventFilter
should reset the filter to initial state

Specified by:
resetFilter in class EventFilter

filterPacket

public EventPacket filterPacket(EventPacket in)
Deprecated. 
Description copied from class: EventFilter2D
Subclasses implement this method to define custom processing.

Specified by:
filterPacket in class EventFilter2D
Parameters:
in - the input packet
Returns:
the output packet

isHighwayPerspectiveEnabled

public boolean isHighwayPerspectiveEnabled()
Deprecated. 

setHighwayPerspectiveEnabled

public void setHighwayPerspectiveEnabled(boolean highwayPerspectiveEnabled)
Deprecated. 

getMixingFactor

public float getMixingFactor()
Deprecated. 

setMixingFactor

public void setMixingFactor(float mixingFactor)
Deprecated. 

getSurround

public float getSurround()
Deprecated. 

setSurround

public void setSurround(float surround)
Deprecated. 

isPathsEnabled

public boolean isPathsEnabled()
Deprecated. 

setPathsEnabled

public void setPathsEnabled(boolean pathsEnabled)
Deprecated. 

getScaleEnabled

public boolean getScaleEnabled()
Deprecated. 

setScaleEnabled

public void setScaleEnabled(boolean scaleEnabled)
Deprecated. 

isColorClustersDifferentlyEnabled

public boolean isColorClustersDifferentlyEnabled()
Deprecated. 

setColorClustersDifferentlyEnabled

public void setColorClustersDifferentlyEnabled(boolean colorClustersDifferentlyEnabled)
Deprecated. 

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
Deprecated. 
Specified by:
update in interface java.util.Observer

isUseOnePolarityOnlyEnabled

public boolean isUseOnePolarityOnlyEnabled()
Deprecated. 

setUseOnePolarityOnlyEnabled

public void setUseOnePolarityOnlyEnabled(boolean useOnePolarityOnlyEnabled)
Deprecated. 

isUseOffPolarityOnlyEnabled

public boolean isUseOffPolarityOnlyEnabled()
Deprecated. 

setUseOffPolarityOnlyEnabled

public void setUseOffPolarityOnlyEnabled(boolean useOffPolarityOnlyEnabled)
Deprecated. 

annotate

public void annotate(java.awt.Graphics2D g)
Deprecated. 
Description copied from interface: FrameAnnotater
each annotator is called by the relevant class (e.g. EyeTracker) and enters annotate with graphics context current, in coordinates with pixel 0,0 in UL corner and pixel spacing 1 unit before scaling transform (which is already active).

Specified by:
annotate in interface FrameAnnotater
Parameters:
g - the Graphics2D context

annotate

public void annotate(javax.media.opengl.GLAutoDrawable drawable)
Deprecated. 
Description copied from interface: FrameAnnotater
Each annotator enters annotate with graphics context current, in coordinates with pixel 0,0 in LL corner (note opposite from Java2D) and pixel spacing 1 unit after the scaling transform (which is already active). The FrameAnnotater then can use JOGL calls to render to the screen by getting the GL context, e.g. the following code, used in the context of an AEChip object, draws a golden lines from LL to UR of the pixel array.
        GL gl = drawable.getGL();
        gl.glBegin(GL.GL_LINES);
        gl.glColor3f(.5f, .5f, 0);
        gl.glVertex2f(0, 0);
        gl.glVertex2f(getSizeX() - 1, getSizeY() - 1);
        gl.glEnd();
 

Specified by:
annotate in interface FrameAnnotater
Parameters:
drawable - the OpenGL drawable components, e.g., GLCanvas

annotate

public void annotate(float[][][] frame)
Deprecated. 
annotate the rendered retina frame to show locations of clusters

Specified by:
annotate in interface FrameAnnotater
Parameters:
frame - the RGB pixel information. First dimension is Y, second is X, third is RGB

preferenceChange

public void preferenceChange(java.util.prefs.PreferenceChangeEvent evt)
Deprecated. 
Specified by:
preferenceChange in interface java.util.prefs.PreferenceChangeListener

isGrowMergedSizeEnabled

public boolean isGrowMergedSizeEnabled()
Deprecated. 

setGrowMergedSizeEnabled

public void setGrowMergedSizeEnabled(boolean growMergedSizeEnabled)
Deprecated. 

getVelocityMixingFactor

public float getVelocityMixingFactor()
Deprecated. 

setVelocityMixingFactor

public void setVelocityMixingFactor(float velocityMixingFactor)
Deprecated. 

setShowVelocity

public void setShowVelocity(boolean showVelocity)
Deprecated. 

isShowVelocity

public boolean isShowVelocity()
Deprecated. 

isLogDataEnabled

public boolean isLogDataEnabled()
Deprecated. 

setLogDataEnabled

public void setLogDataEnabled(boolean logDataEnabled)
Deprecated. 

jAER project on SourceForge