jAER project on SourceForge

ch.unizh.ini.jaer.projects.pawtracker
Class PawTrackerStereoBoard

java.lang.Object
  extended by net.sf.jaer.eventprocessing.EventFilter
      extended by net.sf.jaer.eventprocessing.EventFilter2D
          extended by ch.unizh.ini.jaer.projects.pawtracker.PawTrackerStereoBoard
All Implemented Interfaces:
java.util.Observer, FrameAnnotater

public class PawTrackerStereoBoard
extends EventFilter2D
implements FrameAnnotater, java.util.Observer

Tracks Rat's Paw

Author:
rogister

Nested Class Summary
 class PawTrackerStereoBoard.EventPoint
          EventPoint : all data about a point in retina space
 
Field Summary
protected  AEChip chip
           
protected  int colorScale
           
protected  int[][] correctionMatrix
           
protected  int DELETE_LINK
           
protected  java.util.Vector<ch.unizh.ini.jaer.projects.pawtracker.PawTrackerStereoBoard.FingerCluster> fingers
           
protected  float grayValue
           
protected  int labelNumber
           
protected  int LEFT
           
protected  int LEFT_MOST_METHOD
           
protected  PawTrackerStereoBoard.EventPoint[][] leftPoints
           
protected  int NO_LINK
           
protected  int RIGHT
           
protected  int RIGHT_MOST_METHOD
           
protected  PawTrackerStereoBoard.EventPoint[][] rightPoints
           
 
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
PawTrackerStereoBoard(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)
          // drawing on player window
 float computeRangeTotal(int radius)
           
protected  float decayedValue(float value, int time)
           
protected  float direction(float x0, float y0, float x1, float y1)
           
protected  float distanceBetween(int x1, int y1, int x2, int y2)
           
protected  float distanceBetween(int x1, int y1, int z1, int x2, int y2, int z2)
           
protected  void drawBox(javax.media.opengl.GL gl, int x, int x2, int y, int y2)
           
protected  void drawBoxCentered(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 getAlpha()
           
 float getBrightness()
           
 int getCage_depth()
           
 float getColorizeFactor()
           
 int getColorizePeriod()
           
 float getCorrectLeftAngle()
           
 float getCorrectRightAngle()
           
 int getCube_size()
           
 int getDecayTimeLimit()
           
 int getDisparity_range()
           
 int getDispAvgRange()
           
 int getDoor_xa()
           
 int getDoor_xb()
           
 int getDoor_ya()
           
 int getDoor_yb()
           
 int getDoor_yc()
           
 int getDoor_z()
           
 float getEvent_strength()
           
 java.lang.Object getFilterState()
          should return the filter state in some useful form
 float getFinger_mix()
           
 int getFinger_surround()
           
 float getIntensity()
           
 int getIntensityZoom()
           
 int getLowFilter_density()
           
 int getLowFilter_density2()
           
 int getLowFilter_radius()
           
 int getLowFilter_radius2()
           
 float getLowFilter_threshold()
           
 int getMax_finger_clusters()
           
 float getPlaneAngle()
           
 float getPlatformAngle()
           
 float getShadowFactor()
           
 boolean getshowCorrectionGradient()
           
 boolean getShowCorrectionMatrix()
           
 int getTracker_timeLife()
           
 float getValueMargin()
           
 float getValueThreshold()
           
 float getViewAngle()
           
 float getYCurveFactor()
           
 int getYLeftCorrection()
           
 int getYRightCorrection()
           
 int getZFactor()
           
 void initFilter()
          this should allocate and initialize memory: it may be called when the chip e.g.
 boolean isCorrectY()
           
 boolean isDecayOn()
           
 boolean isGoThroughMode()
           
 boolean isHighlightDecay()
           
 boolean isLogDataEnabled()
           
 boolean isNotCrossing()
           
 boolean isResetPawTracking()
           
 boolean isRestart()
           
 boolean isScaleAcc()
           
 boolean isShow2DWindow()
           
 boolean isShow3DWindow()
           
 boolean isShowAcc()
           
 boolean isShowAll()
           
 boolean isShowAxes()
           
 boolean isShowCage()
           
 boolean isShowDecay()
           
 boolean isShowFingers()
           
 boolean isShowFingerTips()
           
 boolean isShowFrame()
           
 boolean isShowOnlyAcc()
           
 boolean isShowRight()
           
 boolean isShowRLColors()
           
 boolean isShowScore()
           
 boolean isShowSecondFilter()
           
 boolean isShowXColor()
           
 boolean isShowYColor()
           
 boolean isShowZColor()
           
 boolean isShowZones()
           
 boolean isUseCorrections()
           
 boolean isUseFastMatching()
           
 boolean isUseFilter()
           
 boolean isUseGroups()
           
protected  float orientation(int x0, int y0, int x1, int y1)
           
protected  void processEvent(BinocularEvent e)
           
 void resetFilter()
          should reset the filter to initial state
protected  int rotateXonY(int x, int z, int xRotationCenter, int zRotationCenter, float angle)
           
protected  int rotateYonX(int y, int z, int yRotationCenter, int zRotationCenter, float angle)
           
protected  int rotateZonX(int y, int z, int yRotationCenter, int zRotationCenter, float angle)
           
protected  int rotateZonY(int x, int z, int xRotationCenter, int zRotationCenter, float angle)
           
 void setAlpha(float alpha)
           
 void setBrightness(float brightness)
           
 void setCage_depth(int cage_depth)
           
 void setColorizeFactor(float colorizeFactor)
           
 void setColorizePeriod(int colorizePeriod)
           
 void setCorrectLeftAngle(float correctLeftAngle)
           
 void setCorrectRightAngle(float correctRightAngle)
           
 void setCorrectY(boolean correctY)
           
 void setCube_size(int cube_size)
           
 void setDecayOn(boolean decayOn)
           
 void setDecayTimeLimit(int decayTimeLimit)
           
 void setDisparity_range(int disparity_range)
           
 void setDispAvgRange(int dispAvgRange)
           
 void setDoor_xa(int door_xa)
           
 void setDoor_xb(int door_xb)
           
 void setDoor_ya(int door_ya)
           
 void setDoor_yb(int door_yb)
           
 void setDoor_yc(int door_yc)
           
 void setDoor_z(int door_z)
           
 void setEvent_strength(float event_strength)
           
 void setFinger_mix(float finger_mix)
           
 void setFinger_surround(int finger_surround)
           
 void setGoThroughMode(boolean goThroughMode)
           
 void setHighlightDecay(boolean highlightDecay)
           
 void setIntensity(float intensity)
           
 void setIntensityZoom(int intensityZoom)
           
 void setLogDataEnabled(boolean logDataEnabled)
           
 void setLowFilter_density(int lowFilter_density)
           
 void setLowFilter_density2(int lowFilter_density2)
           
 void setLowFilter_radius(int lowFilter_radius)
           
 void setLowFilter_radius2(int lowFilter_radius2)
           
 void setLowFilter_threshold(float lowFilter_threshold)
           
 void setMax_finger_clusters(int max_finger_clusters)
           
 void setNotCrossing(boolean notCrossing)
           
 void setPlaneAngle(float planeAngle)
           
 void setPlatformAngle(float platformAngle)
           
 void setResetPawTracking(boolean resetPawTracking)
           
 void setRestart(boolean restart)
           
 void setScaleAcc(boolean scaleAcc)
           
 void setShadowFactor(float shadowFactor)
           
 void setShow2DWindow(boolean show2DWindow)
           
 void setShow3DWindow(boolean show3DWindow)
           
 void setShowAcc(boolean showAcc)
           
 void setShowAll(boolean showAll)
           
 void setShowAxes(boolean showAxes)
           
 void setShowCage(boolean showCage)
           
 void setShowCorrectionGradient(boolean showCorrectionGradient)
           
 void setShowCorrectionMatrix(boolean showCorrectionMatrix)
           
 void setShowDecay(boolean showDecay)
           
 void setShowFingers(boolean showFingers)
           
 void setShowFingerTips(boolean showFingerTips)
           
 void setShowFrame(boolean showFrame)
           
 void setShowOnlyAcc(boolean showOnlyAcc)
           
 void setShowRight(boolean showRight)
           
 void setShowRLColors(boolean showRLColors)
           
 void setShowScore(boolean showScore)
           
 void setShowSecondFilter(boolean showSecondFilter)
           
 void setShowXColor(boolean showXColor)
           
 void setShowYColor(boolean showYColor)
           
 void setShowZColor(boolean showZColor)
           
 void setShowZones(boolean showZones)
           
 void setTracker_timeLife(int tracker_timeLife)
           
 void setUseCorrections(boolean useCorrections)
           
 void setUseFastMatching(boolean useFastMatching)
           
 void setUseFilter(boolean useFilter)
           
 void setUseGroups(boolean useGroups)
           
 void setValueMargin(float valueMargin)
           
 void setValueThreshold(float valueThreshold)
           
 void setViewAngle(float viewAngle)
           
 void setYCurveFactor(float yCurveFactor)
           
 void setYLeftCorrection(int yLeftCorrection)
           
 void setYRightCorrection(int yRightCorrection)
           
 void setZFactor(int zFactor)
           
 java.lang.String toString()
           
 void update(java.util.Observable o, java.lang.Object arg)
           
 void validateParameterChanges()
           
 
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

RIGHT

protected final int RIGHT
See Also:
Constant Field Values

LEFT

protected final int LEFT
See Also:
Constant Field Values

RIGHT_MOST_METHOD

protected final int RIGHT_MOST_METHOD
See Also:
Constant Field Values

LEFT_MOST_METHOD

protected final int LEFT_MOST_METHOD
See Also:
Constant Field Values

NO_LINK

protected final int NO_LINK
See Also:
Constant Field Values

DELETE_LINK

protected final int DELETE_LINK
See Also:
Constant Field Values

labelNumber

protected int labelNumber

chip

protected AEChip chip

leftPoints

protected PawTrackerStereoBoard.EventPoint[][] leftPoints

rightPoints

protected PawTrackerStereoBoard.EventPoint[][] rightPoints

correctionMatrix

protected int[][] correctionMatrix

grayValue

protected float grayValue

colorScale

protected int colorScale

fingers

protected java.util.Vector<ch.unizh.ini.jaer.projects.pawtracker.PawTrackerStereoBoard.FingerCluster> fingers
Constructor Detail

PawTrackerStereoBoard

public PawTrackerStereoBoard(AEChip chip)
Creates a new instance of PawTracker

Method Detail

initFilter

public void initFilter()
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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getFilterState

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

Specified by:
getFilterState in class EventFilter

resetFilter

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

Specified by:
resetFilter in class EventFilter

filterPacket

public EventPacket filterPacket(EventPacket in)
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

update

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

validateParameterChanges

public void validateParameterChanges()

computeRangeTotal

public float computeRangeTotal(int radius)

processEvent

protected void processEvent(BinocularEvent e)

rotateYonX

protected int rotateYonX(int y,
                         int z,
                         int yRotationCenter,
                         int zRotationCenter,
                         float angle)

rotateZonX

protected int rotateZonX(int y,
                         int z,
                         int yRotationCenter,
                         int zRotationCenter,
                         float angle)

rotateXonY

protected int rotateXonY(int x,
                         int z,
                         int xRotationCenter,
                         int zRotationCenter,
                         float angle)

rotateZonY

protected int rotateZonY(int x,
                         int z,
                         int xRotationCenter,
                         int zRotationCenter,
                         float angle)

distanceBetween

protected float distanceBetween(int x1,
                                int y1,
                                int x2,
                                int y2)

distanceBetween

protected float distanceBetween(int x1,
                                int y1,
                                int z1,
                                int x2,
                                int y2,
                                int z2)

direction

protected float direction(float x0,
                          float y0,
                          float x1,
                          float y1)

orientation

protected float orientation(int x0,
                            int y0,
                            int x1,
                            int y1)

decayedValue

protected float decayedValue(float value,
                             int time)

annotate

public void annotate(java.awt.Graphics2D g)
// drawing on player window

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

drawBoxCentered

protected void drawBoxCentered(javax.media.opengl.GL gl,
                               int x,
                               int y,
                               int sx,
                               int sy)

drawBox

protected void drawBox(javax.media.opengl.GL gl,
                       int x,
                       int x2,
                       int y,
                       int y2)

annotate

public void annotate(javax.media.opengl.GLAutoDrawable drawable)
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)
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

isLogDataEnabled

public boolean isLogDataEnabled()

setLogDataEnabled

public void setLogDataEnabled(boolean logDataEnabled)

setDecayTimeLimit

public void setDecayTimeLimit(int decayTimeLimit)

getDecayTimeLimit

public int getDecayTimeLimit()

setIntensityZoom

public void setIntensityZoom(int intensityZoom)

getIntensityZoom

public int getIntensityZoom()

setDoor_z

public void setDoor_z(int door_z)

getDoor_z

public int getDoor_z()

setDoor_xa

public void setDoor_xa(int door_xa)

getDoor_xa

public int getDoor_xa()

setDoor_xb

public void setDoor_xb(int door_xb)

getDoor_xb

public int getDoor_xb()

setDoor_ya

public void setDoor_ya(int door_ya)

getDoor_ya

public int getDoor_ya()

setDoor_yb

public void setDoor_yb(int door_yb)

getDoor_yb

public int getDoor_yb()

setDoor_yc

public void setDoor_yc(int door_yc)

getDoor_yc

public int getDoor_yc()

setEvent_strength

public void setEvent_strength(float event_strength)

getEvent_strength

public float getEvent_strength()

isResetPawTracking

public boolean isResetPawTracking()

setResetPawTracking

public void setResetPawTracking(boolean resetPawTracking)

isRestart

public boolean isRestart()

setRestart

public void setRestart(boolean restart)

setShowCorrectionGradient

public void setShowCorrectionGradient(boolean showCorrectionGradient)

getshowCorrectionGradient

public boolean getshowCorrectionGradient()

setShowCorrectionMatrix

public void setShowCorrectionMatrix(boolean showCorrectionMatrix)

getShowCorrectionMatrix

public boolean getShowCorrectionMatrix()

setShowSecondFilter

public void setShowSecondFilter(boolean showSecondFilter)

isShowSecondFilter

public boolean isShowSecondFilter()

setScaleAcc

public void setScaleAcc(boolean scaleAcc)

isScaleAcc

public boolean isScaleAcc()

setShowAcc

public void setShowAcc(boolean showAcc)

isShowAcc

public boolean isShowAcc()

setShowOnlyAcc

public void setShowOnlyAcc(boolean showOnlyAcc)

isShowOnlyAcc

public boolean isShowOnlyAcc()

setShowDecay

public void setShowDecay(boolean showDecay)

isShowDecay

public boolean isShowDecay()

setUseFilter

public void setUseFilter(boolean useFilter)

isUseFilter

public boolean isUseFilter()

setDecayOn

public void setDecayOn(boolean decayOn)

isDecayOn

public boolean isDecayOn()

setShowFrame

public void setShowFrame(boolean showFrame)

isShowFrame

public boolean isShowFrame()

setShowCage

public void setShowCage(boolean showCage)

isShowCage

public boolean isShowCage()

setShow2DWindow

public void setShow2DWindow(boolean show2DWindow)

isShow2DWindow

public boolean isShow2DWindow()

setShow3DWindow

public void setShow3DWindow(boolean show3DWindow)

isShow3DWindow

public boolean isShow3DWindow()

setShowScore

public void setShowScore(boolean showScore)

isShowScore

public boolean isShowScore()

setShowRight

public void setShowRight(boolean showRight)

isShowRight

public boolean isShowRight()

setShowFingers

public void setShowFingers(boolean showFingers)

isShowFingers

public boolean isShowFingers()

setShowFingerTips

public void setShowFingerTips(boolean showFingerTips)

isShowFingerTips

public boolean isShowFingerTips()

setShowZones

public void setShowZones(boolean showZones)

isShowZones

public boolean isShowZones()

setShowAll

public void setShowAll(boolean showAll)

isShowAll

public boolean isShowAll()

setUseFastMatching

public void setUseFastMatching(boolean useFastMatching)

isUseFastMatching

public boolean isUseFastMatching()

setShowRLColors

public void setShowRLColors(boolean showRLColors)

isShowRLColors

public boolean isShowRLColors()

setShowAxes

public void setShowAxes(boolean showAxes)

isShowAxes

public boolean isShowAxes()

getLowFilter_radius

public int getLowFilter_radius()

setLowFilter_radius

public void setLowFilter_radius(int lowFilter_radius)

getLowFilter_density

public int getLowFilter_density()

setLowFilter_density

public void setLowFilter_density(int lowFilter_density)

getLowFilter_threshold

public float getLowFilter_threshold()

setLowFilter_threshold

public void setLowFilter_threshold(float lowFilter_threshold)

getLowFilter_radius2

public int getLowFilter_radius2()

setLowFilter_radius2

public void setLowFilter_radius2(int lowFilter_radius2)

getLowFilter_density2

public int getLowFilter_density2()

setLowFilter_density2

public void setLowFilter_density2(int lowFilter_density2)

getBrightness

public float getBrightness()

setBrightness

public void setBrightness(float brightness)

getPlaneAngle

public float getPlaneAngle()

setPlaneAngle

public void setPlaneAngle(float planeAngle)

getViewAngle

public float getViewAngle()

setViewAngle

public void setViewAngle(float viewAngle)

getPlatformAngle

public float getPlatformAngle()

setPlatformAngle

public void setPlatformAngle(float platformAngle)

setAlpha

public void setAlpha(float alpha)

getAlpha

public float getAlpha()

setIntensity

public void setIntensity(float intensity)

getIntensity

public float getIntensity()

setDispAvgRange

public void setDispAvgRange(int dispAvgRange)

getDispAvgRange

public int getDispAvgRange()

setValueThreshold

public void setValueThreshold(float valueThreshold)

getValueThreshold

public float getValueThreshold()

setMax_finger_clusters

public void setMax_finger_clusters(int max_finger_clusters)

getMax_finger_clusters

public int getMax_finger_clusters()

setCage_depth

public void setCage_depth(int cage_depth)

getCage_depth

public int getCage_depth()

setYLeftCorrection

public void setYLeftCorrection(int yLeftCorrection)

getYLeftCorrection

public int getYLeftCorrection()

setYRightCorrection

public void setYRightCorrection(int yRightCorrection)

getYRightCorrection

public int getYRightCorrection()

setYCurveFactor

public void setYCurveFactor(float yCurveFactor)

getYCurveFactor

public float getYCurveFactor()

setColorizeFactor

public void setColorizeFactor(float colorizeFactor)

getColorizeFactor

public float getColorizeFactor()

setShadowFactor

public void setShadowFactor(float shadowFactor)

getShadowFactor

public float getShadowFactor()

setZFactor

public void setZFactor(int zFactor)

getZFactor

public int getZFactor()

setValueMargin

public void setValueMargin(float valueMargin)

getValueMargin

public float getValueMargin()

setCorrectLeftAngle

public void setCorrectLeftAngle(float correctLeftAngle)

getCorrectLeftAngle

public float getCorrectLeftAngle()

setCorrectRightAngle

public void setCorrectRightAngle(float correctRightAngle)

getCorrectRightAngle

public float getCorrectRightAngle()

setColorizePeriod

public void setColorizePeriod(int colorizePeriod)

getColorizePeriod

public int getColorizePeriod()

setHighlightDecay

public void setHighlightDecay(boolean highlightDecay)

isHighlightDecay

public boolean isHighlightDecay()

setShowZColor

public void setShowZColor(boolean showZColor)

isShowZColor

public boolean isShowZColor()

setShowYColor

public void setShowYColor(boolean showYColor)

isShowYColor

public boolean isShowYColor()

setShowXColor

public void setShowXColor(boolean showXColor)

isShowXColor

public boolean isShowXColor()

setCorrectY

public void setCorrectY(boolean correctY)

isCorrectY

public boolean isCorrectY()

setCube_size

public void setCube_size(int cube_size)

getCube_size

public int getCube_size()

setDisparity_range

public void setDisparity_range(int disparity_range)

getDisparity_range

public int getDisparity_range()

setNotCrossing

public void setNotCrossing(boolean notCrossing)

isNotCrossing

public boolean isNotCrossing()

getFinger_mix

public float getFinger_mix()

setFinger_mix

public void setFinger_mix(float finger_mix)

getFinger_surround

public int getFinger_surround()

setFinger_surround

public void setFinger_surround(int finger_surround)

getTracker_timeLife

public int getTracker_timeLife()

setTracker_timeLife

public void setTracker_timeLife(int tracker_timeLife)

setUseGroups

public void setUseGroups(boolean useGroups)

isUseGroups

public boolean isUseGroups()

setGoThroughMode

public void setGoThroughMode(boolean goThroughMode)

isGoThroughMode

public boolean isGoThroughMode()

setUseCorrections

public void setUseCorrections(boolean useCorrections)

isUseCorrections

public boolean isUseCorrections()

jAER project on SourceForge