|
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.pawtracker.PawTracker
public class PawTracker
Tracks Rat's Paw (too fill)
A single cluster tracks each object but the cluster simultaneously maintains several hypotheses about the size of the object. A cluster is moved by the presently-dominant hypothesis. The present hypothesis is highlighted in annotation. The dominant hypothesis for object size is the one that has most support per pixel. A small object with large hypothesis has low average support but a large object with small hypotesis will have more support from the large hypothesis (usually).
Nested Class Summary | |
---|---|
class |
PawTracker.Cluster
Represents a single tracked object |
class |
PawTracker.EntryZone
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
|
protected float |
mixingFactor
|
protected boolean |
pawIsDetected
|
protected java.util.LinkedList<PawTracker.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 | |
---|---|
PawTracker(AEChip chip)
Creates a new instance of PawTracker |
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 |
getChange_ratio()
|
float |
getClassifierThreshold()
|
int |
getClusterLifetimeWithoutSupportUs()
lifetime of cluster in ms without support |
java.util.List<PawTracker.Cluster> |
getClusters()
|
float |
getClusterSize()
max distance from cluster to event as fraction of size of array |
boolean |
getDynamicSizeEnabled()
|
int |
getEntry_xa()
|
int |
getEntry_xb()
|
int |
getEntry_ya()
|
int |
getEntry_yb()
|
int |
getEntryZone_pixel_threshold()
|
int |
getEntryZone_threshold()
|
java.lang.Object |
getFilterState()
should return the filter state in some useful form |
int |
getMax_fingers()
|
int |
getMaxNumClusters()
max number of clusters |
int |
getMin_events_per_cluster()
|
float |
getMixingFactor()
|
int |
getNumClusters()
|
int |
getPaw_tip_size()
|
int |
getPellet_size()
|
int |
getPredictiveVelocityFactor()
|
float |
getSurround()
|
int |
getThresholdEventsForVisibleCluster()
number of events to make a potential cluster visible |
float |
getThresholdISIForVisibleCluster()
number of events to make a potential cluster visible |
float |
getVelocityMixingFactor()
|
int |
getWrist_xa()
|
int |
getWrist_xb()
|
int |
getWrist_ya()
|
int |
getWrist_yb()
|
void |
initFilter()
this should allocate and initialize memory: it may be called when the chip e.g. |
boolean |
isClassifierEnabled()
|
boolean |
isColorClustersDifferentlyEnabled()
|
boolean |
isDynamicAspectRatioEnabled()
|
boolean |
isGrowMergedSizeEnabled()
|
boolean |
isHighwayPerspectiveEnabled()
|
boolean |
isLogDataEnabled()
|
boolean |
isPathsEnabled()
|
boolean |
isResetPawTracking()
|
boolean |
isShowAllClusters()
|
boolean |
isShowClusters()
|
boolean |
isShowFingers()
|
boolean |
isShowVelocity()
|
boolean |
isUseOffPolarityOnlyEnabled()
|
boolean |
isUseOnePolarityOnlyEnabled()
|
void |
resetFilter()
should reset the filter to initial state |
void |
setAspectRatio(float aspectRatio)
|
void |
setChange_ratio(float change_ratio)
|
void |
setClassifierEnabled(boolean classifierEnabled)
Sets whether classifier is enabled. |
void |
setClassifierThreshold(float classifierThreshold)
|
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 |
setEntry_xa(int entry_xa)
|
void |
setEntry_xb(int entry_xb)
|
void |
setEntry_ya(int entry_ya)
|
void |
setEntry_yb(int entry_yb)
|
void |
setEntryZone_pixel_threshold(int entryZone_pixel_threshold)
|
void |
setEntryZone_threshold(int entryZone_threshold)
|
void |
setGrowMergedSizeEnabled(boolean growMergedSizeEnabled)
|
void |
setHighwayPerspectiveEnabled(boolean highwayPerspectiveEnabled)
|
void |
setLogDataEnabled(boolean logDataEnabled)
|
void |
setMax_fingers(int max_fingers)
|
void |
setMaxNumClusters(int maxNumClusters)
max number of clusters |
void |
setMin_events_per_cluster(int min_events_per_cluster)
|
void |
setMixingFactor(float mixingFactor)
|
void |
setPathsEnabled(boolean pathsEnabled)
|
void |
setPaw_tip_size(int paw_tip_size)
|
void |
setPellet_size(int pellet_size)
|
void |
setPredictiveVelocityFactor(int predictiveVelocityFactor)
|
void |
setResetPawTracking(boolean resetPawTracking)
|
void |
setShowAllClusters(boolean showAllClusters)
Sets annotation visibility of clusters that are not "visible" |
void |
setShowClusters(boolean showClusters)
|
void |
setShowFingers(boolean showFingers)
|
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 |
setThresholdISIForVisibleCluster(float thresholdISIForVisibleCluster)
number of events to make a potential cluster visible |
void |
setUseOffPolarityOnlyEnabled(boolean useOffPolarityOnlyEnabled)
|
void |
setUseOnePolarityOnlyEnabled(boolean useOnePolarityOnlyEnabled)
|
void |
setVelocityMixingFactor(float velocityMixingFactor)
|
void |
setWrist_xa(int wrist_xa)
|
void |
setWrist_xb(int wrist_xb)
|
void |
setWrist_ya(int wrist_ya)
|
void |
setWrist_yb(int wrist_yb)
|
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
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 boolean pawIsDetected
protected java.util.LinkedList<PawTracker.Cluster> pruneList
protected int clusterCounter
protected static final float fullbrightnessLifetime
protected java.util.Random random
Constructor Detail |
---|
public PawTracker(AEChip chip)
Method Detail |
---|
public void initFilter()
EventFilter
initFilter
in class EventFilter
public int getNumClusters()
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.List<PawTracker.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 final float getThresholdISIForVisibleCluster()
public void setThresholdISIForVisibleCluster(float thresholdISIForVisibleCluster)
public java.lang.Object getFilterState()
EventFilter
getFilterState
in class EventFilter
public void resetFilter()
EventFilter
resetFilter
in class EventFilter
public EventPacket filterPacket(EventPacket in)
EventFilter2D
filterPacket
in class EventFilter2D
in
- 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 agepublic void update(java.util.Observable o, java.lang.Object arg)
update
in interface java.util.Observer
public 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 FrameAnnotater
g
- the Graphics2D contextprotected 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 FrameAnnotater
drawable
- the OpenGL drawable components, e.g., GLCanvaspublic void annotate(float[][][] frame)
annotate
in interface FrameAnnotater
frame
- 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 int getPredictiveVelocityFactor()
public void setPredictiveVelocityFactor(int predictiveVelocityFactor)
public void setEntry_xa(int entry_xa)
public int getEntry_xa()
public void setEntry_xb(int entry_xb)
public int getEntry_xb()
public void setEntry_ya(int entry_ya)
public int getEntry_ya()
public void setEntry_yb(int entry_yb)
public int getEntry_yb()
public void setWrist_xa(int wrist_xa)
public int getWrist_xa()
public void setWrist_xb(int wrist_xb)
public int getWrist_xb()
public void setWrist_ya(int wrist_ya)
public int getWrist_ya()
public void setWrist_yb(int wrist_yb)
public int getWrist_yb()
public void setPaw_tip_size(int paw_tip_size)
public int getPaw_tip_size()
public void setPellet_size(int pellet_size)
public int getPellet_size()
public void setEntryZone_threshold(int entryZone_threshold)
public int getEntryZone_threshold()
public void setEntryZone_pixel_threshold(int entryZone_pixel_threshold)
public int getEntryZone_pixel_threshold()
public int getMax_fingers()
public void setMax_fingers(int max_fingers)
public boolean isResetPawTracking()
public void setResetPawTracking(boolean resetPawTracking)
public float getChange_ratio()
public void setChange_ratio(float change_ratio)
public int getMin_events_per_cluster()
public void setMin_events_per_cluster(int min_events_per_cluster)
public void setShowClusters(boolean showClusters)
public boolean isShowClusters()
public void setShowFingers(boolean showFingers)
public boolean isShowFingers()
|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |