Class ContrastStretch

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

public class ContrastStretch
extends java.lang.Thread

Contrast Stretch stretches the contrast range of an image

Author:
Tim Sharman
See Also:
code.iface.contrast

Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ContrastStretch()
           
 
Method Summary
 int[] cutoff_stretch(int[] src, int width, int height, float cutoff, int uplim, int lolim)
          Creates an image array for an image which has been contrast stretched In this case it is done using the cutoff method
 int[] normal_stretch(int[] src, int width, int height, int uplim, int lolim)
          Creates an image array for an image which has been contrast stretched
 int[] percentile_stretch(int[] src, int width, int height, float high, float low, int uplim, int lolim)
          Creates an image array for an image which has been contrast stretched In this case it is done using the percentile method
 
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

ContrastStretch

public ContrastStretch()
Method Detail

normal_stretch

public int[] normal_stretch(int[] src,
                            int width,
                            int height,
                            int uplim,
                            int lolim)
Creates an image array for an image which has been contrast stretched
Parameters:
src - Image array to be stretched
width - the width of the image
height - the height of the image
uplim - The upper limit for the values to be stretched between
lolim - The lower limit for the values to be stretched between
Returns:
An image array representing the stretched image

cutoff_stretch

public int[] cutoff_stretch(int[] src,
                            int width,
                            int height,
                            float cutoff,
                            int uplim,
                            int lolim)
Creates an image array for an image which has been contrast stretched In this case it is done using the cutoff method
Parameters:
src - Image array to be stretched
width - The width of the image
height - The height of the image
cutoff - The scale value used in cutting off low values
uplim - The upper limit for the values to be stretched between
lolim - The lower limit for the values to be stretched between
Returns:
An image array representing the stretched image

percentile_stretch

public int[] percentile_stretch(int[] src,
                                int width,
                                int height,
                                float high,
                                float low,
                                int uplim,
                                int lolim)
Creates an image array for an image which has been contrast stretched In this case it is done using the percentile method
Parameters:
src - Image array to be stretched
width - The width of the image
height - The height of the image
high - The upper percentage value for the histogram cutoff
low - The lower percentage value for the histogram cutoff
uplim - The upper limit for the values to be stretched between
lolim - The lower limit for the values to be stretched between
Returns:
An image array representing the stretched image