Class ImageProcessing

java.lang.Object
  extended by ImageProcessing

public class ImageProcessing
extends java.lang.Object

A collection of image processing utilities


Constructor Summary
ImageProcessing()
           
 
Method Summary
static int[][] flipX(int[][] imageData)
          Flip the image relative to the X axis
static int[][] flipY(int[][] imageData)
          Flip the image relative to the Y axis
static int[] histogram(int[][] imageData)
          Returns a histogram of the given gray-scaled image.
static int[][] invert(int[][] imageData)
          Inverts the gray levels of the image. 0 will turn to 255, 1 to 254 and so on...
static void main(java.lang.String[] args)
           
static int[][] rotate90CCW(int[][] imageData)
          Rotate the image 90 degrees counter clockwise
static int[][] rotate90CW(int[][] imageData)
          Rotate the image 90 degrees clockwise
static int[][] toBW(int[][] imageData, int threshold)
          Transforms the image into a black and white one
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageProcessing

public ImageProcessing()
Method Detail

flipX

public static int[][] flipX(int[][] imageData)
Flip the image relative to the X axis

Parameters:
imageData - - 2-dimensional array holding the image data
Returns:
a 2-dimensional array holding the image after the flip

flipY

public static int[][] flipY(int[][] imageData)
Flip the image relative to the Y axis

Parameters:
imageData - - 2-dimensional array holding the image data
Returns:
a 2-dimensional array holding the image after the flip

histogram

public static int[] histogram(int[][] imageData)
Returns a histogram of the given gray-scaled image.

Parameters:
imageData - - 2-dimensional array holding the image data
Returns:
an array of length 256 holding the image histogram

invert

public static int[][] invert(int[][] imageData)
Inverts the gray levels of the image. 0 will turn to 255, 1 to 254 and so on...

Parameters:
imageData - - 2-dimensional array holding the image data
Returns:
An inverted version of the image

rotate90CCW

public static int[][] rotate90CCW(int[][] imageData)
Rotate the image 90 degrees counter clockwise

Parameters:
imageData - - 2-dimensional array holding the image data
Returns:
the image rotated 90 degrees counter clockwise

rotate90CW

public static int[][] rotate90CW(int[][] imageData)
Rotate the image 90 degrees clockwise

Parameters:
imageData - - 2-dimensional array holding the image data
Returns:
the image rotated 90 degrees clockwise

toBW

public static int[][] toBW(int[][] imageData,
                           int threshold)
Transforms the image into a black and white one

Parameters:
imageData - - 2-dimensional array holding the image data
threshold - - a cutoff value underneath a pixel's becomes black (0), otherwise that pixel becomes white (255)
Returns:
A black and white version of the image

main

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