jAER project on SourceForge

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

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.PawTrackerStereoBoard2
All Implemented Interfaces:
java.util.Observer, FrameAnnotater

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

Tracks Rat's Paw

Author:
rogister

Nested Class Summary
 class PawTrackerStereoBoard2.Cage
          additional classes
 class PawTrackerStereoBoard2.EventPoint
          EventPoint : all data about a point in retina space
 class PawTrackerStereoBoard2.Point
          Point : all data about a point in 3D space
 
Field Summary
protected  AEChip chip
           
protected  int colorScale
           
protected  int[][] correctionMatrix
           
protected  int DELETE_LINK
           
protected  double EPS
           
protected  java.util.Vector<ch.unizh.ini.jaer.projects.pawtracker.PawTrackerStereoBoard2.FingerCluster> fingers
           
protected  float grayValue
           
protected  int labelNumber
           
protected  int LEFT
           
protected  int LEFT_MOST_METHOD
           
protected  PawTrackerStereoBoard2.EventPoint[][] leftPoints
           
protected  int NO_LINK
           
protected  int RIGHT
           
protected  int RIGHT_MOST_METHOD
           
protected  PawTrackerStereoBoard2.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
PawTrackerStereoBoard2(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()
           
 float getCage_distance()
           
 float getCage_door_height()
           
 float getCage_door_width()
           
 float getCage_height()
           
 float getCage_platform_length()
           
 float getCage_width()
           
 float getColorizeFactor()
           
 int getColorizePeriod()
           
 float getCorrectLeftAngle()
           
 float getCorrectRightAngle()
           
 int getCube_size()
           
 int getDecayTimeLimit()
           
 float getEvent_strength()
           
 java.lang.Object getFilterState()
          should return the filter state in some useful form
 float getFinger_mix()
           
 int getFinger_surround()
           
 float getFocal_length()
           
 float getIntensity()
           
 int getIntensityZoom()
           
 int getLowFilter_density()
           
 int getLowFilter_radius()
           
 float getLowFilter_threshold()
           
 int getMax_finger_clusters()
           
 float getPixel_size()
           
 float getRetina_angle()
           
 float getRetina_height()
           
 float getRetina_tilt_angle()
           
 float getRetinae_distance()
           
 float getShadowFactor()
           
 boolean getshowCorrectionGradient()
           
 boolean getShowCorrectionMatrix()
           
 int getTracker_timeLife()
           
 float getValueMargin()
           
 float getValueThreshold()
           
 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 isShowOnlyAcc()
           
 boolean isShowRetina()
           
 boolean isShowRight()
           
 boolean isShowRLColors()
           
 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_distance(float cage_distance)
           
 void setCage_door_height(float cage_door_height)
           
 void setCage_door_width(float cage_door_width)
           
 void setCage_height(float cage_height)
           
 void setCage_platform_length(float cage_platform_length)
           
 void setCage_width(float cage_width)
           
 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 setEvent_strength(float event_strength)
           
 void setFinger_mix(float finger_mix)
           
 void setFinger_surround(int finger_surround)
           
 void setFocal_length(float focal_length)
           
 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_radius(int lowFilter_radius)
           
 void setLowFilter_threshold(float lowFilter_threshold)
           
 void setMax_finger_clusters(int max_finger_clusters)
           
 void setNotCrossing(boolean notCrossing)
           
 void setPixel_size(float pixel_size)
           
 void setResetPawTracking(boolean resetPawTracking)
           
 void setRestart(boolean restart)
           
 void setRetina_angle(float retina_angle)
           
 void setRetina_height(float retina_height)
           
 void setRetina_tilt_angle(float retina_tilt_angle)
           
 void setRetinae_distance(float retinae_distance)
           
 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 setShowOnlyAcc(boolean showOnlyAcc)
           
 void setShowRetina(boolean showRetina)
           
 void setShowRight(boolean showRight)
           
 void setShowRLColors(boolean showRLColors)
           
 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 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

EPS

protected double EPS

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 PawTrackerStereoBoard2.EventPoint[][] leftPoints

rightPoints

protected PawTrackerStereoBoard2.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.PawTrackerStereoBoard2.FingerCluster> fingers
Constructor Detail

PawTrackerStereoBoard2

public PawTrackerStereoBoard2(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()

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()

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()

setShowCage

public void setShowCage(boolean showCage)

isShowCage

public boolean isShowCage()

setShowRetina

public void setShowRetina(boolean showRetina)

isShowRetina

public boolean isShowRetina()

setShow2DWindow

public void setShow2DWindow(boolean show2DWindow)

isShow2DWindow

public boolean isShow2DWindow()

setShow3DWindow

public void setShow3DWindow(boolean show3DWindow)

isShow3DWindow

public boolean isShow3DWindow()

setShowRight

public void setShowRight(boolean showRight)

isShowRight

public boolean isShowRight()

setShowFingers

public void setShowFingers(boolean showFingers)

isShowFingers

public boolean isShowFingers()

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)

getBrightness

public float getBrightness()

setBrightness

public void setBrightness(float brightness)

setAlpha

public void setAlpha(float alpha)

getAlpha

public float getAlpha()

setIntensity

public void setIntensity(float intensity)

getIntensity

public float getIntensity()

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_distance

public void setCage_distance(float cage_distance)

getCage_distance

public float getCage_distance()

getRetina_tilt_angle

public float getRetina_tilt_angle()

setRetina_tilt_angle

public void setRetina_tilt_angle(float retina_tilt_angle)

setRetina_height

public void setRetina_height(float retina_height)

getRetina_height

public float getRetina_height()

setCage_door_height

public void setCage_door_height(float cage_door_height)

getCage_door_height

public float getCage_door_height()

setCage_height

public void setCage_height(float cage_height)

getCage_height

public float getCage_height()

setCage_width

public void setCage_width(float cage_width)

getCage_width

public float getCage_width()

setCage_platform_length

public void setCage_platform_length(float cage_platform_length)

getCage_platform_length

public float getCage_platform_length()

setCage_door_width

public void setCage_door_width(float cage_door_width)

getCage_door_width

public float getCage_door_width()

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()

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()

getFocal_length

public float getFocal_length()

setFocal_length

public void setFocal_length(float focal_length)

setRetinae_distance

public void setRetinae_distance(float retinae_distance)

getRetinae_distance

public float getRetinae_distance()

setPixel_size

public void setPixel_size(float pixel_size)

getPixel_size

public float getPixel_size()

setRetina_angle

public void setRetina_angle(float retina_angle)

getRetina_angle

public float getRetina_angle()

jAER project on SourceForge