jjil.algorithm
Class CannyHoriz

java.lang.Object
  extended by jjil.core.PipelineStage
      extended by jjil.algorithm.CannyHoriz

public class CannyHoriz
extends PipelineStage

Computes the horizontal Canny operator for an input gray image. The sigma value for the operator is set in the constructor or setSigma. All calculations are done in integer (per CLDC 1.0) and the sigma value is specified as multiplied by 10.0. The minimum value for the unmultiplied sigma is 0.1; the maximum value is about 10.0. Larger sigma values give an operator which is less sensitive to high frequencies and more sensitive to low frequencies.

Author:
webb

Constructor Summary
CannyHoriz(int cSigma)
          Creates a new instance of CannyHoriz
 
Method Summary
 int getSigma()
          Returns the current value of sigma.
 void push(Image image)
          Apply the Canny operator horizontally to the input input image.
 void setSigma(int cSigma)
          sets a new value for sigma.
 java.lang.String toString()
          returns a string describing this Canny operator.
 
Methods inherited from class jjil.core.PipelineStage
getFront, isEmpty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CannyHoriz

public CannyHoriz(int cSigma)
           throws Error
Creates a new instance of CannyHoriz

Parameters:
cSigma - the sigma value for the operator, which is the sigma in the Gaussian distribution multipied by 10.0 and converted to integer.
Throws:
Error - if cSigma is out of range.
Method Detail

push

public void push(Image image)
          throws Error
Apply the Canny operator horizontally to the input input image. The sigma value for the operator is set in the class constructor. We handle the borders of the image a little carefully to avoid creating spurious edges at them. The image value at the border is reflected so that image(0,-1), for example, is made equal to image(0,1).

Specified by:
push in class PipelineStage
Parameters:
image - the input Gray8Image
Throws:
Error - if the input is not a Gray8Image.

getSigma

public int getSigma()
Returns the current value of sigma.

Returns:
the sigma value

setSigma

public void setSigma(int cSigma)
              throws Error
sets a new value for sigma. Sigma controls the frequency of edges that the operator responds to. A small sigma value gives higher frequency edges, while a larger sigma gives lower frequency edges.

Parameters:
cSigma - the new sigma value
Throws:
Error - if cSigma is out of range.

toString

public java.lang.String toString()
returns a string describing this Canny operator.

Overrides:
toString in class java.lang.Object
Returns:
a string describing the Canny operator.