blobs
Class Blob

java.lang.Object
  extended byblobs.Blob
All Implemented Interfaces:
java.lang.Cloneable, Growable
Direct Known Subclasses:
BlobInPixelSource

public abstract class Blob
extends java.lang.Object
implements Growable, java.lang.Cloneable


Field Summary
static int debugLevel
           
 
Method Summary
 void debugAll()
          You can get all the debug info drawn by this command.
 void debugPixel(int _x, int _y)
           
 void finishedSeed()
          Key function called by the search routines when you finished looking at a given seed location
 int getArea()
           
 long getBirthDate()
           
static int getDebugLevel()
           
 java.lang.String getDebugString()
           
 int getLastX()
           
 int getLastY()
           
 java.awt.Point getMidPoint()
           
 java.awt.Point getNextExpectedPostion()
           
static java.awt.Polygon getOutsidePolygon(java.awt.Polygon _wholePoly, java.awt.Point _center)
           
 java.awt.Polygon getPolygon()
           
 java.awt.Rectangle getRect()
           
 java.awt.Rectangle getSearchField()
           
 java.awt.Point getSmoothedPostion()
          This looks at the last few readings and take the median.
 long getTimeStamp()
           
static int getTotalDebugLevels()
           
 java.lang.String getType()
           
 int getValidsInARow()
           
 boolean newBorderPoint(int _col, int _row)
          Key function call by the search routines.
 void newFrame()
          One of the key function calls by the search routines, this is called the very at the beginning of the frame.
 boolean newPoint(int column, int row)
          Key function called by the search routine.
 void newSeed(int _column, int _row)
          Key function called by the search routines.
 void setBirthDate(long age)
           
 void setDebugColor(java.awt.Color debugColor)
           
static void setDebugLevel(int _debugLevel)
           
 void setDebugString(java.lang.String s)
           
 void setLastValidTime(long lastValid)
           
 void setSearchField(java.awt.Rectangle _r)
           
 void setType(java.lang.String _type)
           
 void validate()
          This give you a chance to decide if this is a valid growth according to your criter, eg is it big enough
 void validate(Blob _g)
          This give you a chance to decide if this is a valid growth according to your criter, eg is it big enough
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugLevel

public static int debugLevel
Method Detail

newFrame

public void newFrame()
Description copied from interface: Growable
One of the key function calls by the search routines, this is called the very at the beginning of the frame.

Specified by:
newFrame in interface Growable

newSeed

public void newSeed(int _column,
                    int _row)
Description copied from interface: Growable
Key function called by the search routines. Called when you first plant a seed to see if this growth will grow.

Specified by:
newSeed in interface Growable
Parameters:
_column -
_row -

newPoint

public boolean newPoint(int column,
                        int row)
Description copied from interface: Growable
Key function called by the search routine. Called everytime it reaches a new pixel. You would probably want to override this one and put code in is testing if a pixel qualifies in your growth.

Specified by:
newPoint in interface Growable
Parameters:
column -
row -
Returns:
weather or not the pixel is good by your standards, ie is a certain color or brightness

newBorderPoint

public boolean newBorderPoint(int _col,
                              int _row)
Description copied from interface: Growable
Key function call by the search routines. Called when the search reaches the end of a road, whether that be from radial scanning or horizontal scanning. This is useful for forming the points of a polygon

Specified by:
newBorderPoint in interface Growable
Parameters:
_col -
_row -
Returns:

getLastX

public int getLastX()

getLastY

public int getLastY()

finishedSeed

public void finishedSeed()
Description copied from interface: Growable
Key function called by the search routines when you finished looking at a given seed location

Specified by:
finishedSeed in interface Growable

validate

public void validate(Blob _g)
This give you a chance to decide if this is a valid growth according to your criter, eg is it big enough


validate

public void validate()
This give you a chance to decide if this is a valid growth according to your criter, eg is it big enough


getNextExpectedPostion

public java.awt.Point getNextExpectedPostion()

debugAll

public void debugAll()
You can get all the debug info drawn by this command. Alternatively you may want to use the debuglevel to have just one type of debug information at a time displayed.


getSmoothedPostion

public java.awt.Point getSmoothedPostion()
This looks at the last few readings and take the median. This should smooth out your x y coordinates

Returns:
the median mid point of the last couple of samples

getPolygon

public java.awt.Polygon getPolygon()

getRect

public java.awt.Rectangle getRect()

getBirthDate

public long getBirthDate()

setBirthDate

public void setBirthDate(long age)

getDebugString

public java.lang.String getDebugString()

setDebugString

public void setDebugString(java.lang.String s)

getArea

public int getArea()

getMidPoint

public java.awt.Point getMidPoint()

getValidsInARow

public int getValidsInARow()

setLastValidTime

public void setLastValidTime(long lastValid)

setDebugColor

public void setDebugColor(java.awt.Color debugColor)

debugPixel

public void debugPixel(int _x,
                       int _y)

getDebugLevel

public static int getDebugLevel()

setDebugLevel

public static void setDebugLevel(int _debugLevel)

getTotalDebugLevels

public static int getTotalDebugLevels()

getType

public java.lang.String getType()

setType

public void setType(java.lang.String _type)

getSearchField

public java.awt.Rectangle getSearchField()
Specified by:
getSearchField in interface Growable

setSearchField

public void setSearchField(java.awt.Rectangle _r)

getTimeStamp

public long getTimeStamp()

getOutsidePolygon

public static java.awt.Polygon getOutsidePolygon(java.awt.Polygon _wholePoly,
                                                 java.awt.Point _center)