j2d.thresh
Class AdapThresh

java.lang.Object
  extended by j2d.thresh.AdapThresh
All Implemented Interfaces:
ImageProcessorInterface, java.io.Serializable

public class AdapThresh
extends java.lang.Object
implements ImageProcessorInterface

AdapThresh is an algorithm to apply adaptive thresholding to an image.

Author:
Timothy Sharman
See Also:
Serialized Form

Constructor Summary
AdapThresh()
           
 
Method Summary
 int getSize()
           
static void main(java.lang.String[] args)
           
 int[] mean_thresh(int[] src, int width, int height, int size, int con)
          Applies the adaptive thresholding operator to the specified image array using the mean function to find the threshold value
 int[] meanMaxMin_thresh(int[] src, int width, int height, int size, int con)
          Applies the adaptive thresholding operator to the specified image array using the mean of max & min function to find the threshold value
 int[] median_thresh(int[] src, int width, int height, int size, int con)
          Applies the adaptive thresholding operator to the specified image array using the median function to find the threshold value
 java.awt.Image process(java.awt.Image image)
          a basic garbage in, garbage out processor.
 void setSize(int size)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AdapThresh

public AdapThresh()
Method Detail

mean_thresh

public int[] mean_thresh(int[] src,
                         int width,
                         int height,
                         int size,
                         int con)
Applies the adaptive thresholding operator to the specified image array using the mean function to find the threshold value

Parameters:
src - pixel array representing image to be thresholded
width - width of the image in pixels
height - height of the image in pixels
size - the size of the neigbourhood used in finding the threshold
con - the constant value subtracted from the mean
Returns:
a thresholded pixel array of the input image array

median_thresh

public int[] median_thresh(int[] src,
                           int width,
                           int height,
                           int size,
                           int con)
Applies the adaptive thresholding operator to the specified image array using the median function to find the threshold value

Parameters:
src - pixel array representing image to be thresholded
width - width of the image in pixels
height - height of the image in pixels
size - the size of the neigbourhood used in finding the threshold
con - the constant value subtracted from the median
Returns:
a thresholded pixel array of the input image array

meanMaxMin_thresh

public int[] meanMaxMin_thresh(int[] src,
                               int width,
                               int height,
                               int size,
                               int con)
Applies the adaptive thresholding operator to the specified image array using the mean of max & min function to find the threshold value

Parameters:
src - pixel array representing image to be thresholded
width - width of the image in pixels
height - height of the image in pixels
size - the size of the neigbourhood used in finding the threshold
con - the constant value subtracted from the mean
Returns:
a thresholded pixel array of the input image array

main

public static void main(java.lang.String[] args)

process

public java.awt.Image process(java.awt.Image image)
Description copied from interface: ImageProcessorInterface
a basic garbage in, garbage out processor.

Specified by:
process in interface ImageProcessorInterface
Parameters:
image - input image
Returns:
output image

getSize

public int getSize()

setSize

public void setSize(int size)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object