Class Unsharp

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--MeanSmooth
              |
              +--Unsharp

public class Unsharp
extends MeanSmooth

The unsharp operator code.

Author:
Simon Horne.

Field Summary
static int[] kernel
          The all 1s kernel.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Unsharp()
           
 
Method Summary
static int[] pixelAddition(int[] pixels1, int[] pixels2)
          Adds each pixel in pixels2 to the corresponding pixel in pixels1.
static int[] pixelMultiplication(int[] pixels, double k)
          Multiplies each pixel in pixels with the constant.
static int[] pixelSubtraction(int[] pixels1, int[] pixels2)
          Subtracts each pixel in pixels2 from the corresponding pixel in pixels1.
static int[] unsharp_image(int[] input, int width, int height, double k)
          Takes an image and applies the unsharp filter to it.
 
Methods inherited from class MeanSmooth
generateInputArrays, generateOutputArray, meanNeighbour, smooth_image, smooth, smoothImage
 
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
 

Field Detail

kernel

public static int[] kernel
The all 1s kernel.
Constructor Detail

Unsharp

public Unsharp()
Method Detail

pixelSubtraction

public static int[] pixelSubtraction(int[] pixels1,
                                     int[] pixels2)
Subtracts each pixel in pixels2 from the corresponding pixel in pixels1.
Parameters:
pixels1 - the first array of pixels
pixels2 - the array to subtract from the first
Returns:
the resulting array of pixels

pixelAddition

public static int[] pixelAddition(int[] pixels1,
                                  int[] pixels2)
Adds each pixel in pixels2 to the corresponding pixel in pixels1.
Parameters:
pixels1 - the first array of pixels
pixels2 - the pixels to add to pixels1
Returns:
the resulting array of pixel values

pixelMultiplication

public static int[] pixelMultiplication(int[] pixels,
                                        double k)
Multiplies each pixel in pixels with the constant.
Parameters:
pixels - the array of pixels
k - the multiplication constant
Returns:
the new array

unsharp_image

public static int[] unsharp_image(int[] input,
                                  int width,
                                  int height,
                                  double k)
Takes an image and applies the unsharp filter to it.
Parameters:
input - the input image array
width - of the image
height - of the image
k - the unsharp constant
Returns:
the new image array