|
jAER project on SourceForge | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jaer.eventprocessing.EventFilter
net.sf.jaer.eventprocessing.EventFilter2D
ch.unizh.ini.jaer.projects.gesture.GestureTracker
public class GestureTracker
Tracks clusters of events for and recognizes sequences of quadrants of locations of clusters.
| Nested Class Summary | |
|---|---|
class |
GestureTracker.Cluster
Represents a single tracked object |
| Field Summary | |
|---|---|
static float |
ASPECT_RATIO_MAX
maximum and minimum allowed dynamic aspect ratio |
static float |
ASPECT_RATIO_MIN
maximum and minimum allowed dynamic aspect ratio |
protected AEChip |
chip
|
protected int |
clusterCounter
|
protected float |
defaultClusterRadius
|
protected static float |
fullbrightnessLifetime
|
protected boolean |
growMergedSizeEnabled
|
static float |
MAX_SCALE_RATIO
scaling can't make cluster bigger or smaller than this ratio to default cluster size |
protected float |
mixingFactor
|
protected java.util.LinkedList<GestureTracker.Cluster> |
pruneList
|
protected java.util.Random |
random
|
protected float |
velocityMixingFactor
|
| 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 | |
|---|---|
GestureTracker(AEChip chip)
Creates a new instance of GestureTracker |
|
| Method Summary | |
|---|---|
void |
annotate(float[][][] frame)
annotate the rendered retina frame to show locations of clusters |
void |
annotate(javax.media.opengl.GLAutoDrawable drawable)
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)
each annotator is called by the relevant class (e.g. |
protected void |
drawBox(javax.media.opengl.GL gl,
int x,
int y,
int sx,
int sy)
|
EventPacket |
filterPacket(EventPacket in)
Subclasses implement this method to define custom processing. |
float |
getAspectRatio()
|
float |
getClassifierThreshold()
|
int |
getClusterLifetimeWithoutSupportUs()
lifetime of cluster in ms without support |
java.util.List<GestureTracker.Cluster> |
getClusters()
|
float |
getClusterSize()
max distance from cluster to event as fraction of size of array |
boolean |
getDynamicSizeEnabled()
|
java.lang.Object |
getFilterState()
should return the filter state in some useful form |
int |
getMaxNumClusters()
max number of clusters |
float |
getMixingFactor()
|
int |
getNumClusters()
|
int |
getPredictiveVelocityFactor()
|
float |
getSurround()
|
int |
getThresholdEventsForVisibleCluster()
number of events to make a potential cluster visible |
float |
getVelocityMixingFactor()
|
void |
initFilter()
this should allocate and initialize memory: it may be called when the chip e.g. |
boolean |
isClassifierEnabled()
|
boolean |
isClusterLifetimeIncreasesWithAge()
|
boolean |
isColorClustersDifferentlyEnabled()
|
boolean |
isDynamicAspectRatioEnabled()
|
boolean |
isGrowMergedSizeEnabled()
|
boolean |
isHighwayPerspectiveEnabled()
|
boolean |
isLogDataEnabled()
|
boolean |
isPathsEnabled()
|
boolean |
isShowAllClusters()
|
boolean |
isShowVelocity()
|
boolean |
isUseNearestCluster()
|
boolean |
isUseOffPolarityOnlyEnabled()
|
boolean |
isUseOnePolarityOnlyEnabled()
|
void |
resetFilter()
should reset the filter to initial state |
void |
setAspectRatio(float aspectRatio)
|
void |
setClassifierEnabled(boolean classifierEnabled)
Sets whether classifier is enabled. |
void |
setClassifierThreshold(float classifierThreshold)
|
void |
setClusterLifetimeIncreasesWithAge(boolean clusterLifetimeIncreasesWithAge)
If true, cluster lifetime withtout support increases proportional to the age of the cluster relative to the clusterLifetimeWithoutSupportUs time |
void |
setClusterLifetimeWithoutSupportUs(int clusterLifetimeWithoutSupport)
lifetime of cluster in ms without support |
void |
setClusterSize(float clusterSize)
sets max distance from cluster center to event as fraction of maximum size of chip pixel array. |
void |
setColorClustersDifferentlyEnabled(boolean colorClustersDifferentlyEnabled)
|
void |
setDynamicAspectRatioEnabled(boolean dynamicAspectRatioEnabled)
|
void |
setDynamicSizeEnabled(boolean dynamicSizeEnabled)
Enables cluster size scaling. |
void |
setGrowMergedSizeEnabled(boolean growMergedSizeEnabled)
|
void |
setHighwayPerspectiveEnabled(boolean highwayPerspectiveEnabled)
|
void |
setLogDataEnabled(boolean logDataEnabled)
|
void |
setMaxNumClusters(int maxNumClusters)
max number of clusters |
void |
setMixingFactor(float mixingFactor)
|
void |
setPathsEnabled(boolean pathsEnabled)
|
void |
setPredictiveVelocityFactor(int predictiveVelocityFactor)
|
void |
setShowAllClusters(boolean showAllClusters)
Sets annotation visibility of clusters that are not "visible" |
void |
setShowVelocity(boolean showVelocity)
|
void |
setSurround(float surround)
sets scale factor of radius that events outside the cluster size can affect the size of the cluster if scaling is enabled. |
void |
setThresholdEventsForVisibleCluster(int thresholdEventsForVisibleCluster)
number of events to make a potential cluster visible |
void |
setUseNearestCluster(boolean useNearestCluster)
|
void |
setUseOffPolarityOnlyEnabled(boolean useOffPolarityOnlyEnabled)
|
void |
setUseOnePolarityOnlyEnabled(boolean useOnePolarityOnlyEnabled)
|
void |
setVelocityMixingFactor(float velocityMixingFactor)
|
java.lang.String |
toString()
|
void |
update(java.util.Observable o,
java.lang.Object arg)
|
| 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, wait, wait, wait |
| Methods inherited from interface net.sf.jaer.graphics.FrameAnnotater |
|---|
isAnnotationEnabled, setAnnotationEnabled |
| Field Detail |
|---|
protected AEChip chip
public static final float MAX_SCALE_RATIO
protected float defaultClusterRadius
protected float mixingFactor
protected float velocityMixingFactor
protected boolean growMergedSizeEnabled
public static final float ASPECT_RATIO_MAX
public static final float ASPECT_RATIO_MIN
protected java.util.LinkedList<GestureTracker.Cluster> pruneList
protected int clusterCounter
protected static final float fullbrightnessLifetime
protected java.util.Random random
| Constructor Detail |
|---|
public GestureTracker(AEChip chip)
| Method Detail |
|---|
public void initFilter()
EventFilter
initFilter in class EventFilterpublic int getNumClusters()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.List<GestureTracker.Cluster> getClusters()
public final int getClusterLifetimeWithoutSupportUs()
public void setClusterLifetimeWithoutSupportUs(int clusterLifetimeWithoutSupport)
public final float getClusterSize()
public void setClusterSize(float clusterSize)
clusterSize - public final int getMaxNumClusters()
public void setMaxNumClusters(int maxNumClusters)
public final int getThresholdEventsForVisibleCluster()
public void setThresholdEventsForVisibleCluster(int thresholdEventsForVisibleCluster)
public java.lang.Object getFilterState()
EventFilter
getFilterState in class EventFilterpublic void resetFilter()
EventFilter
resetFilter in class EventFilterpublic EventPacket filterPacket(EventPacket in)
EventFilter2D
filterPacket in class EventFilter2Din - the input packet
public boolean isHighwayPerspectiveEnabled()
public void setHighwayPerspectiveEnabled(boolean highwayPerspectiveEnabled)
public float getMixingFactor()
public void setMixingFactor(float mixingFactor)
public float getSurround()
setSurround(float)public void setSurround(float surround)
scaling is enabled.
surround - the scale factor, constrained >1 by setter. radius is multiplied by this to determine if event is within surround.public boolean isPathsEnabled()
setPathsEnabled(boolean)public void setPathsEnabled(boolean pathsEnabled)
pathsEnabled - true to show the history of the cluster locations on each packetpublic boolean getDynamicSizeEnabled()
setDynamicSizeEnabled(boolean)public void setDynamicSizeEnabled(boolean dynamicSizeEnabled)
dynamicSizeEnabled - true to enable scaling of cluster sizepublic boolean isColorClustersDifferentlyEnabled()
setColorClustersDifferentlyEnabled(boolean)public void setColorClustersDifferentlyEnabled(boolean colorClustersDifferentlyEnabled)
colorClustersDifferentlyEnabled - true to color each cluster a different color. false to color each cluster
by its age
public void update(java.util.Observable o,
java.lang.Object arg)
update in interface java.util.Observerpublic boolean isUseOnePolarityOnlyEnabled()
public void setUseOnePolarityOnlyEnabled(boolean useOnePolarityOnlyEnabled)
public boolean isUseOffPolarityOnlyEnabled()
public void setUseOffPolarityOnlyEnabled(boolean useOffPolarityOnlyEnabled)
public void annotate(java.awt.Graphics2D g)
FrameAnnotater
annotate in interface FrameAnnotaterg - the Graphics2D context
protected void drawBox(javax.media.opengl.GL gl,
int x,
int y,
int sx,
int sy)
public void annotate(javax.media.opengl.GLAutoDrawable drawable)
FrameAnnotater
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();
annotate in interface FrameAnnotaterdrawable - the OpenGL drawable components, e.g., GLCanvaspublic void annotate(float[][][] frame)
annotate in interface FrameAnnotaterframe - the RGB pixel information. First dimension is Y, second is X, third is RGBpublic boolean isGrowMergedSizeEnabled()
public void setGrowMergedSizeEnabled(boolean growMergedSizeEnabled)
public float getVelocityMixingFactor()
public void setVelocityMixingFactor(float velocityMixingFactor)
public void setShowVelocity(boolean showVelocity)
public boolean isShowVelocity()
public boolean isLogDataEnabled()
public void setLogDataEnabled(boolean logDataEnabled)
public float getAspectRatio()
public void setAspectRatio(float aspectRatio)
public boolean isClassifierEnabled()
public void setClassifierEnabled(boolean classifierEnabled)
classifierEnabled - true to enable classifierpublic float getClassifierThreshold()
public void setClassifierThreshold(float classifierThreshold)
public boolean isShowAllClusters()
public void setShowAllClusters(boolean showAllClusters)
showAllClusters - true to show all clusters even if there are not "visible"public boolean isDynamicAspectRatioEnabled()
public void setDynamicAspectRatioEnabled(boolean dynamicAspectRatioEnabled)
public boolean isUseNearestCluster()
public void setUseNearestCluster(boolean useNearestCluster)
public int getPredictiveVelocityFactor()
public void setPredictiveVelocityFactor(int predictiveVelocityFactor)
public boolean isClusterLifetimeIncreasesWithAge()
public void setClusterLifetimeIncreasesWithAge(boolean clusterLifetimeIncreasesWithAge)
|
jAER project on SourceForge | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||