jAER project on SourceForge

net.sf.jaer.util
Class VectorHistogram

java.lang.Object
  extended by net.sf.jaer.util.VectorHistogram

public class VectorHistogram
extends java.lang.Object

used for histogramming results of a vector computation like orientation or direction selectivity. Computes various useful derivatives.


Constructor Summary
VectorHistogram(int numTypes)
           
 
Method Summary
 void add(int val)
          add a new value to histogram
 java.awt.geom.Point2D.Float getAverageDir()
           
 int[] getCounts()
           
 float[] getNormalized()
           
 float[] getNormalizedByFactor(float factor)
           
 int getTotalCounts()
           
 void reset()
          resets all counts to zero
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VectorHistogram

public VectorHistogram(int numTypes)
Parameters:
numTypes - the number of histogram bins, i.e., the number of directions
Method Detail

getCounts

public int[] getCounts()

reset

public void reset()
resets all counts to zero


add

public void add(int val)
add a new value to histogram

Parameters:
val - the count value, must be in ranage 0 to numTypes-1

getNormalized

public float[] getNormalized()
Returns:
histogram values normalized to 1 for max value, or 0 if there are no counts

getNormalizedByFactor

public float[] getNormalizedByFactor(float factor)
Parameters:
factor - the multiplier
Returns:
histogram values normalized by multiplying each element by a factor

getAverageDir

public java.awt.geom.Point2D.Float getAverageDir()
Returns:
the average direction vector based on counts. theta increases CCW and starts up y axis

toString

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

getTotalCounts

public int getTotalCounts()

jAER project on SourceForge