jjil.algorithm
Class Gray8Statistics

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

public class Gray8Statistics
extends java.lang.Object

Gray8Statistics is used to measure the mean and variance of a gray image.

Author:
webb

Constructor Summary
Gray8Statistics()
          Creates a new instance of Gray8Statistics
 
Method Summary
 int getMean()
          Return computed mean, times 256.
 int getStdDev()
          Return standard deviation, times 256 using Newton's iteration.
 int getVariance()
          Return computed variance, times 256.
 void push(Image image)
          Estimate the mean and variance of an input gray image.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gray8Statistics

public Gray8Statistics()
Creates a new instance of Gray8Statistics

Method Detail

push

public void push(Image image)
          throws Error
Estimate the mean and variance of an input gray image.

Parameters:
image - the input image.
Throws:
Error - if the input image is not gray.

getMean

public int getMean()
Return computed mean, times 256.

Returns:
the mean value, times 256.

getStdDev

public int getStdDev()
              throws Error
Return standard deviation, times 256 using Newton's iteration.

Returns:
the standard deviation, times 256.
Throws:
Error - if the variance computed in push() is less than zero.

getVariance

public int getVariance()
Return computed variance, times 256.

Returns:
the computed variance value.