Class Threshold

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--Threshold

public class Threshold
extends java.lang.Thread

Threshold is an algorithm to apply thresholding to an image.

Author:
Judy Robertson SELLIC OnLine
See Also:
code.iface.threshold

Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Threshold()
          Constructs a new Threshold
 
Method Summary
 int[] flip_the_pixels(int[] src, int w, int h)
          Turns all the black pixels in the specified image array to white and vice versa
 int[] threshold(int[] src, int width, int height, int value)
          Applies the thresholding operator with the specified threshold value to the specified image array
 int[] twothreshold(int[] src, int width, int height, int low, int high)
          Applies the thresholding operator between the specified threshold values to the specified image array
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Threshold

public Threshold()
Constructs a new Threshold
Method Detail

threshold

public int[] threshold(int[] src,
                       int width,
                       int height,
                       int value)
Applies the thresholding operator with the specified threshold value to the specified image array
Parameters:
src - pixel array representing image to be thresholded
width - width of the image in pixels
height - height of the image in pixels
value - threshold value
Returns:
a thresholded pixel array of the input image array

twothreshold

public int[] twothreshold(int[] src,
                          int width,
                          int height,
                          int low,
                          int high)
Applies the thresholding operator between the specified threshold values to the specified image array
Parameters:
src - pixel array representing image to be thresholded
width - width of the image in pixels
height - height of the image in pixels
low - lower threshold value
high - higher threshold value
Returns:
a thresholded pixel array of the input image array

flip_the_pixels

public int[] flip_the_pixels(int[] src,
                             int w,
                             int h)
Turns all the black pixels in the specified image array to white and vice versa
Parameters:
src - The black and white pixel array whose values are to be inverted
Returns:
A pixel array which is the negative of the input image