jjil.algorithm
Class ZeroCrossingHoriz

java.lang.Object
  extended by jjil.algorithm.ZeroCrossingHoriz

public class ZeroCrossingHoriz
extends java.lang.Object

Computes an array of zero crossing positions in the input gray image. Not a pipeline stage. The output is an array of arrays of exact positions of zero crossings, one array per row of the input image. A threshold parameter lets you set the zero crossing strength. The zero crossings are returned as an array of arrays of ints, one array per row, each integer referring to the position of a zero crossing in the row, multiplied by 256 so fractional positions can be represented.

Author:
webb

Constructor Summary
ZeroCrossingHoriz(int wThreshold)
          Creates a new instance of ZeroCrossingHoriz.
 
Method Summary
 int getThreshold()
          Returns the current threshold.
 int[][] push(Gray8Image image)
          Computes the zero crossings of an input gray image that are greater than a threshold.
 void setThreshold(int wThreshold)
          Changes the zero crossing threshold.
 java.lang.String toString()
          Returns a string describing this instance of ZeroCrossingHoriz, including the minimum strength parameter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ZeroCrossingHoriz

public ZeroCrossingHoriz(int wThreshold)
                  throws Error
Creates a new instance of ZeroCrossingHoriz. ZeroCrossingHoriz computes the horizontal zero crossings of a signed byte image.

Parameters:
wThreshold - -- the minimum strength for a zero crossing to be considered significant.
Throws:
Error - if the threshold is less than 0. Use 0 if you want all zero crossings.
Method Detail

getThreshold

public int getThreshold()
Returns the current threshold.

Returns:
the current threshold.

push

public int[][] push(Gray8Image image)
Computes the zero crossings of an input gray image that are greater than a threshold.

Parameters:
image - the input image.
Returns:
an array of arrays of zero crossings. There is one array for each row in the input. The array elements are the zero crossing positions within the rows, multiplied by 256 so fractional values can be represented. A value of null means there were no zero crossings in the row.

toString

public java.lang.String toString()
Returns a string describing this instance of ZeroCrossingHoriz, including the minimum strength parameter.

Overrides:
toString in class java.lang.Object
Returns:
the string -- looks like "jjil.algorithm.ZeroCrossingHoriz@xxx (number)"

setThreshold

public void setThreshold(int wThreshold)
                  throws Error
Changes the zero crossing threshold.

Parameters:
wThreshold - the new threshold.
Throws:
Error - if wThreshold is less than 0. Use 0 if you want all zero crossings.