net.sf.jaer.util
Class VectorHistogram
java.lang.Object
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
VectorHistogram
public VectorHistogram(int numTypes)
- Parameters:
numTypes
- the number of histogram bins, i.e., the number of directions
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()