jjil.algorithm
Class GrayHistMatch

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

public class GrayHistMatch
extends PipelineStage

Pipeline stage modifies a gray image's pixel values to make its histogram match a target histogram (to the extent this is possible while uniquely mapping each input grayvalue). This PipelineStage modifies its input.

Author:
webb

Constructor Summary
GrayHistMatch(int[] histTarget)
          Creates a new instance of GrayHistMatch
 
Method Summary
 int[] getHistogram()
          getHistogram returns the target histogram that has been previously set.
 void push(Image image)
          push transforms an input gray image to have the target histogram, as near as possible while assigning each input grayvalue a unique output grayvalue.
 void setHistogram(int[] histTarget)
          setHistogram sets a new target histogram.
 
Methods inherited from class jjil.core.PipelineStage
getFront, isEmpty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrayHistMatch

public GrayHistMatch(int[] histTarget)
              throws Error
Creates a new instance of GrayHistMatch

Parameters:
histTarget - the input histogram.
Throws:
Error - if the input histogram does not have 256 elements.
Method Detail

getHistogram

public int[] getHistogram()
getHistogram returns the target histogram that has been previously set.

Returns:
the target histogram

push

public void push(Image image)
          throws Error
push transforms an input gray image to have the target histogram, as near as possible while assigning each input grayvalue a unique output grayvalue.

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

setHistogram

public void setHistogram(int[] histTarget)
                  throws Error
setHistogram sets a new target histogram.

Parameters:
histTarget - the new target histogram
Throws:
Error - if histTarget does not have 256 elements.