|
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
net.sf.jaer.eventprocessing.tracking.RectangularClusterTracker
public class RectangularClusterTracker
Tracks blobs of events using a rectangular hypothesis about the object shape. Many parameters constrain the hypothesese in various ways, including perspective projection, fixed aspect ratio, variable size and aspect ratio, "mixing factor" that determines how much each event moves a cluster, etc.
Nested Class Summary | |
---|---|
class |
RectangularClusterTracker.Cluster
|
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<RectangularClusterTracker.Cluster> |
pruneList
|
protected java.util.Random |
random
|
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 | |
---|---|
RectangularClusterTracker(AEChip chip)
Creates a new instance of RectangularClusterTracker |
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,
float angle)
|
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<RectangularClusterTracker.Cluster> |
getClusters()
|
float |
getClusterSize()
max distance from cluster to event as fraction of size of array |
static java.lang.String |
getDescription()
|
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()
|
float |
getOpticalGyroTauLowpassMs()
|
int |
getPathLength()
|
int |
getPredictiveVelocityFactor()
|
float |
getSurround()
|
int |
getThresholdEventsForVisibleCluster()
number of events to make a potential cluster visible |
float |
getThresholdVelocityForVisibleCluster()
|
int |
getVelocityPoints()
|
void |
initFilter()
this should allocate and initialize memory: it may be called when the chip e.g. |
boolean |
isClassifierEnabled()
|
boolean |
isClusterLifetimeIncreasesWithAge()
|
boolean |
isColorClustersDifferentlyEnabled()
|
boolean |
isDynamicAngleEnabled()
|
boolean |
isDynamicAspectRatioEnabled()
|
boolean |
isGrowMergedSizeEnabled()
|
boolean |
isHighwayPerspectiveEnabled()
|
boolean |
isLogDataEnabled()
|
boolean |
isOpticalGyroEnabled()
Get the value of opticalGyroEnabled |
boolean |
isPathsEnabled()
|
boolean |
isShowAllClusters()
|
boolean |
isUseNearestCluster()
|
boolean |
isUseOffPolarityOnlyEnabled()
|
boolean |
isUseOnePolarityOnlyEnabled()
|
boolean |
isUseVelocity()
|
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 |
setDynamicAngleEnabled(boolean dynamicAngleEnabled)
Setting dynamicAngleEnabled true enables variable-angle clusters. |
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 |
setOpticalGyroEnabled(boolean opticalGyroEnabled)
Set the value of opticalGyroEnabled |
void |
setOpticalGyroTauLowpassMs(float opticalGyroTauLowpassMs)
|
void |
setPathLength(int pathLength)
|
void |
setPathsEnabled(boolean pathsEnabled)
|
void |
setPredictiveVelocityFactor(int predictiveVelocityFactor)
|
void |
setShowAllClusters(boolean showAllClusters)
Sets annotation visibility of clusters that are not "visible" |
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 |
setThresholdVelocityForVisibleCluster(float thresholdVelocityForVisibleCluster)
A cluster must have at least this velocity magnitude to become visible |
void |
setUseNearestCluster(boolean useNearestCluster)
|
void |
setUseOffPolarityOnlyEnabled(boolean useOffPolarityOnlyEnabled)
|
void |
setUseOnePolarityOnlyEnabled(boolean useOnePolarityOnlyEnabled)
|
void |
setUseVelocity(boolean useVelocity)
|
void |
setVelocityPoints(int velocityPoints)
|
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, 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
public static final float ASPECT_RATIO_MAX
public static final float ASPECT_RATIO_MIN
protected float defaultClusterRadius
protected float mixingFactor
protected boolean growMergedSizeEnabled
protected java.util.LinkedList<RectangularClusterTracker.Cluster> pruneList
protected int clusterCounter
protected static final float fullbrightnessLifetime
protected java.util.Random random
Constructor Detail |
---|
public RectangularClusterTracker(AEChip chip)
Method Detail |
---|
public static java.lang.String getDescription()
public void initFilter()
EventFilter
initFilter
in class EventFilter
public int getNumClusters()
public java.lang.String toString()
toString
in class java.lang.Object
public float getOpticalGyroTauLowpassMs()
public void setOpticalGyroTauLowpassMs(float opticalGyroTauLowpassMs)
opticalGyroTauLowpassMs
- the opticalGyroTauLowpassMs to setpublic java.util.List<RectangularClusterTracker.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 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, float angle)
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 void setUseVelocity(boolean useVelocity)
public boolean isUseVelocity()
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)
public float getThresholdVelocityForVisibleCluster()
public void setThresholdVelocityForVisibleCluster(float thresholdVelocityForVisibleCluster)
thresholdVelocityForVisibleCluster
- speed in pixels/secondpublic boolean isOpticalGyroEnabled()
public void setOpticalGyroEnabled(boolean opticalGyroEnabled)
opticalGyroEnabled
- new value of opticalGyroEnabledpublic int getPathLength()
public void setPathLength(int pathLength)
public boolean isDynamicAngleEnabled()
public void setDynamicAngleEnabled(boolean dynamicAngleEnabled)
public int getVelocityPoints()
public void setVelocityPoints(int velocityPoints)
|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |