FindIt
Class ImageProcessor

java.lang.Object
  extended by FindIt.ImageProcessor

public class ImageProcessor
extends java.lang.Object


Field Summary
static float DIVISOR
           
static int EMPTY_REGION
           
static int MAXVALUE
           
static int MINVALUE
           
 
Constructor Summary
ImageProcessor()
           
 
Method Summary
 void colorSpliter(int[][] colorMap, java.lang.String colorCase)
          The colorSpliter function that uses the Blob colouring technique to find regions of similar colour in an image.
static int findLowestEquivalentRegion(java.util.Vector tree, int region)
          Given a region number, this method finds the lowest equivalent region number by recursively following the path of equivalent regions down the tree.
static void flatten(java.util.Vector tree)
           Flattens a region equivalence tree.
 java.awt.image.BufferedImage getLiveImage()
          Returns the live image from the video capture devive.
 java.awt.image.BufferedImage getProcessedImage()
          Returns the processed image.
 void ImageProcessor(java.awt.image.BufferedImage im)
          Creates a new Image Processor.
 void processImage()
          The processImage function who marks at each colors map the point that is inside the color's region, with 1 and after checks every color if have enough pointst to continue to the process and calls the colorSpliter(int[][], java.lang.String) for the rest calculations or if not to don't and to close the recording procedure for it if is on.
static void propogateLowestRegion(java.util.Vector tree, int start, int lowestEquivalentRegion)
          Given a region number, and it's lowest equivalent region, this method propogates the lowest equivalent region number down the path from the starting region number to the lowest equivalent region number.
static void startBlackSink()
          Starts the data sink for the Black color.
static void startBlueSink()
          Starts the data sink for the Blue color.
static void startBrownSink()
          Starts the data sink for the Brown color.
static void startCyanSink()
          Starts the data sink for the Cyan color.
static void startGraySink()
          Starts the data sink for the Gray color.
static void startGreenSink()
          Starts the data sink for the Green color.
static void startMagentaSink()
          Starts the data sink for the Magenta color.
static void startOrangeSink()
          Starts the data sink for the Orange color.
static void startPinkSink()
          Starts the data sink for the Pink color.
static void startRedSink()
          Starts the data sink for the Red color.
static void startWhiteSink()
          Starts the data sink for the White color.
static void startYellowSink()
          Starts the data sink for the Yellow color.
static void stopBlackSink()
          Stops the data sink for the Black color.
static void stopBlueSink()
          Stops the data sink for the Blue color.
static void stopBrownSink()
          Stops the data sink for the Brown color.
static void stopCyanSink()
          Stops the data sink for the Cyan color.
static void stopGraySink()
          Stops the data sink for the Gray color.
static void stopGreenSink()
          Stops the data sink for the Green color.
static void stopMagentaSink()
          Stops the data sink for the Magenta color.
static void stopOrangeSink()
          Stops the data sink for the Orange color.
static void stopPinkSink()
          Stops the data sink for the Pink color.
static void stopRedSink()
          Stops the data sink for the Red color.
static void stopWhiteSink()
          Stops the data sink for the White color.
static void stopYellowSink()
          Stops the data sink for the Yellow color.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_REGION

public static final int EMPTY_REGION
See Also:
Constant Field Values

DIVISOR

public static final float DIVISOR
See Also:
Constant Field Values

MAXVALUE

public static final int MAXVALUE
See Also:
Constant Field Values

MINVALUE

public static final int MINVALUE
See Also:
Constant Field Values
Constructor Detail

ImageProcessor

public ImageProcessor()
Method Detail

ImageProcessor

public void ImageProcessor(java.awt.image.BufferedImage im)
Creates a new Image Processor.

Parameters:
im - The BufferedImage who will be checked

getLiveImage

public java.awt.image.BufferedImage getLiveImage()
Returns the live image from the video capture devive.

Returns:
live image from the video capture devive.

getProcessedImage

public java.awt.image.BufferedImage getProcessedImage()
Returns the processed image.

Returns:
the processed image.

processImage

public void processImage()
The processImage function who marks at each colors map the point that is inside the color's region, with 1 and after checks every color if have enough pointst to continue to the process and calls the colorSpliter(int[][], java.lang.String) for the rest calculations or if not to don't and to close the recording procedure for it if is on.

See Also:
ImageProcessor, colorSpliter(int[][], java.lang.String)

colorSpliter

public void colorSpliter(int[][] colorMap,
                         java.lang.String colorCase)
The colorSpliter function that uses the Blob colouring technique to find regions of similar colour in an image. When the regions has been found, one by one, is sended at the Hull2 algorithm to calculate for each one his convex hull. If has been found that an object, with the specifed colour exists at the captured video then the recording for this colour starts or if has start before and now doesn't exist the reconding for this color stops.

Parameters:
colorMap -
colorCase -
See Also:
startRedSink(), stopRedSink(), startOrangeSink(), stopOrangeSink(), startBrownSink(), stopBrownSink(), startYellowSink(), stopYellowSink(), startGreenSink(), stopGreenSink(), startCyanSink(), stopCyanSink(), startBlueSink(), stopBlueSink(), startMagentaSink(), stopMagentaSink(), startPinkSink(), stopPinkSink(), startWhiteSink(), stopWhiteSink(), startBlackSink(), stopBlackSink(), startGraySink(), stopGraySink()

startRedSink

public static void startRedSink()
Starts the data sink for the Red color.


stopRedSink

public static void stopRedSink()
Stops the data sink for the Red color.


startOrangeSink

public static void startOrangeSink()
Starts the data sink for the Orange color.


stopOrangeSink

public static void stopOrangeSink()
Stops the data sink for the Orange color.


startBrownSink

public static void startBrownSink()
Starts the data sink for the Brown color.


stopBrownSink

public static void stopBrownSink()
Stops the data sink for the Brown color.


startYellowSink

public static void startYellowSink()
Starts the data sink for the Yellow color.


stopYellowSink

public static void stopYellowSink()
Stops the data sink for the Yellow color.


startGreenSink

public static void startGreenSink()
Starts the data sink for the Green color.


stopGreenSink

public static void stopGreenSink()
Stops the data sink for the Green color.


startCyanSink

public static void startCyanSink()
Starts the data sink for the Cyan color.


stopCyanSink

public static void stopCyanSink()
Stops the data sink for the Cyan color.


startBlueSink

public static void startBlueSink()
Starts the data sink for the Blue color.


stopBlueSink

public static void stopBlueSink()
Stops the data sink for the Blue color.


startMagentaSink

public static void startMagentaSink()
Starts the data sink for the Magenta color.


stopMagentaSink

public static void stopMagentaSink()
Stops the data sink for the Magenta color.


startPinkSink

public static void startPinkSink()
Starts the data sink for the Pink color.


stopPinkSink

public static void stopPinkSink()
Stops the data sink for the Pink color.


startWhiteSink

public static void startWhiteSink()
Starts the data sink for the White color.


stopWhiteSink

public static void stopWhiteSink()
Stops the data sink for the White color.


startBlackSink

public static void startBlackSink()
Starts the data sink for the Black color.


stopBlackSink

public static void stopBlackSink()
Stops the data sink for the Black color.


startGraySink

public static void startGraySink()
Starts the data sink for the Gray color.


stopGraySink

public static void stopGraySink()
Stops the data sink for the Gray color.


flatten

public static void flatten(java.util.Vector tree)

Flattens a region equivalence tree. Starting at the highest region, a call to findLowestEquivalentRegion() is made to find the lowest region number that it is equivalent to. This is then propogated down the path in the tree from the current region number to the lowest.

E.g. If 8 points to 6, which points to 4 points to 2, then starting at 8 its lowest equivalent region is 2. Propogating this down the path sets 6 to 2 and then 4 to 2.

Parameters:
tree -

findLowestEquivalentRegion

public static int findLowestEquivalentRegion(java.util.Vector tree,
                                             int region)
Given a region number, this method finds the lowest equivalent region number by recursively following the path of equivalent regions down the tree.

Parameters:
tree - equivalent region
region - the starting region.
Returns:
the lowest equivalent region.

propogateLowestRegion

public static void propogateLowestRegion(java.util.Vector tree,
                                         int start,
                                         int lowestEquivalentRegion)
Given a region number, and it's lowest equivalent region, this method propogates the lowest equivalent region number down the path from the starting region number to the lowest equivalent region number.

Parameters:
tree - equivalent region.
start - the starting region number.
lowestEquivalentRegion - the lowest equivalent region number.