roomba.roombanetwork.services.image
Class Track

java.lang.Object
  extended by roomba.roombanetwork.services.image.Track

public class Track
extends java.lang.Object

Contains the necessary information about a color finder track such that it can find the track within an image (if it exists)

Author:
Drew Housten

Field Summary
static int overlayColorIndex
           
static java.awt.Color[] overlayColors
           
static int TOLERANCE
           
static int VIEWING_WINDOW
           
 
Constructor Summary
Track(java.awt.image.BufferedImage imageClip, java.lang.String trackName, ImagePanel imagePanel)
          Constructor - the image clip is centered on the object to track
 
Method Summary
 java.lang.String getTrackName()
          Gets the track name
 int getX()
          Gets the x position of the track in the last processed image.
 int getY()
          Gets the y position of the track in the last processed image.
 void processImage(java.awt.image.BufferedImage image)
          Processes an image and finds the x and y position of the track in the image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIEWING_WINDOW

public static final int VIEWING_WINDOW
See Also:
Constant Field Values

TOLERANCE

public static final int TOLERANCE
See Also:
Constant Field Values

overlayColorIndex

public static int overlayColorIndex

overlayColors

public static java.awt.Color[] overlayColors
Constructor Detail

Track

public Track(java.awt.image.BufferedImage imageClip,
             java.lang.String trackName,
             ImagePanel imagePanel)
Constructor - the image clip is centered on the object to track

Parameters:
imageClip - The Image clip containing the object to track
trackName - The name to identify the track by
Method Detail

processImage

public void processImage(java.awt.image.BufferedImage image)
Processes an image and finds the x and y position of the track in the image. The x and y can then be accessed via the getX and getY accessor methods.

Parameters:
image - The image to process

getX

public int getX()
Gets the x position of the track in the last processed image. If the track was not found, returns -1.

Returns:
The x pixel of the track in the last processed image

getY

public int getY()
Gets the y position of the track in the last processed image. If the track was not found, returns -1.

Returns:
The y pixel of the track in the last processed image

getTrackName

public java.lang.String getTrackName()
Gets the track name

Returns:
name of the track