at.ac.sbg.cosy.soccerbot.recognition
Class Region

java.lang.Object
  extended by at.ac.sbg.cosy.soccerbot.recognition.Region
All Implemented Interfaces:
IRegion, java.lang.Comparable

public class Region
extends java.lang.Object
implements IRegion

Region for Split and Merge Technique

Author:
Peter Wild

Constructor Summary
Region()
          Default Constructor
Region(int id, int hsv, int center_x, int center_y, int height, int width, int size, boolean clipped)
          Constructor
 
Method Summary
 int compareTo(java.lang.Object region)
          For sorting, compares by region size
 IRegion copy()
          Deep copy of region
 int getCenter_X()
          Returns the center x-coordinate (midpoint) of the recognized region (used for robot navigation)
 int getCenter_Y()
          Returns the center y-coordinate (midpoint) of the recognized region (used for robot navigation)
 boolean getClipped()
          Returns information whether region may be clipped (at boundary of image)
 int getHeight()
          Returns the maximum height of the region
 int getHSV()
          Returns hsv value in 32-bit hsv format (0xHHHHSSVV)
 int getId()
          Returns region id (may be used for retrieving additional region information)
 int getSize()
          Returns the numberf of pixels within the region
 int getWidth()
          Returns the maximum width of the region
 void setCenter_X(int center_x)
          sets the center x-coordinate (midpoint) of the recognized region (used for robot navigation)
 void setCenter_Y(int center_y)
          sets the center y-coordinate (midpoint) of the recognized region (used for robot navigation)
 void setClipped(boolean clipped)
          Sets clipping information (at boundary of image)
 void setHeight(int height)
          Sets the maximum height of the region
 void setHSV(int hsv)
          Sets the region hsv value
 void setId(int id)
          Sets the region id (may be used for retrieving additional region information)
 void setSize(int size)
          Sets the size (number of pixels) of the region
 void setWidth(int width)
          Sets the maximum width of the region
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Region

public Region()
Default Constructor


Region

public Region(int id,
              int hsv,
              int center_x,
              int center_y,
              int height,
              int width,
              int size,
              boolean clipped)
Constructor

Parameters:
id - number of the region
hsv - average color value in hsv
center_x - center x-coordinate
center_y - center y-coordinate
height - height of the region
width - width of the region
size - number of pixels within region
clipped - intersects with image boundary
Method Detail

getId

public int getId()
Description copied from interface: IRegion
Returns region id (may be used for retrieving additional region information)

Specified by:
getId in interface IRegion
Returns:
unique region id
See Also:
IRegion.getId()

getHSV

public int getHSV()
Description copied from interface: IRegion
Returns hsv value in 32-bit hsv format (0xHHHHSSVV)

Specified by:
getHSV in interface IRegion
Returns:
average hsv value encoded in 32-bit format (0xHHHHSSVV)
See Also:
IRegion.getHSV()

getCenter_X

public int getCenter_X()
Description copied from interface: IRegion
Returns the center x-coordinate (midpoint) of the recognized region (used for robot navigation)

Specified by:
getCenter_X in interface IRegion
Returns:
center of region
See Also:
IRegion.getCenter_X()

getCenter_Y

public int getCenter_Y()
Description copied from interface: IRegion
Returns the center y-coordinate (midpoint) of the recognized region (used for robot navigation)

Specified by:
getCenter_Y in interface IRegion
Returns:
center of region
See Also:
IRegion.getCenter_Y()

getHeight

public int getHeight()
Description copied from interface: IRegion
Returns the maximum height of the region

Specified by:
getHeight in interface IRegion
Returns:
height of region
See Also:
IRegion.getHeight()

getSize

public int getSize()
Description copied from interface: IRegion
Returns the numberf of pixels within the region

Specified by:
getSize in interface IRegion
Returns:
number of pixels
See Also:
IRegion.getSize()

getWidth

public int getWidth()
Description copied from interface: IRegion
Returns the maximum width of the region

Specified by:
getWidth in interface IRegion
Returns:
width of region
See Also:
IRegion.getWidth()

setHSV

public void setHSV(int hsv)
Description copied from interface: IRegion
Sets the region hsv value

Specified by:
setHSV in interface IRegion
Parameters:
hsv - average hsv value encoded in 32-bit format (0xHHHHSSVV)
See Also:
IRegion.setHSV(int)

setCenter_X

public void setCenter_X(int center_x)
Description copied from interface: IRegion
sets the center x-coordinate (midpoint) of the recognized region (used for robot navigation)

Specified by:
setCenter_X in interface IRegion
Parameters:
center_x - center of region
See Also:
IRegion.setCenter_X(int)

setCenter_Y

public void setCenter_Y(int center_y)
Description copied from interface: IRegion
sets the center y-coordinate (midpoint) of the recognized region (used for robot navigation)

Specified by:
setCenter_Y in interface IRegion
Parameters:
center_y - center of region
See Also:
IRegion.setCenter_Y(int)

setHeight

public void setHeight(int height)
Description copied from interface: IRegion
Sets the maximum height of the region

Specified by:
setHeight in interface IRegion
Parameters:
height - height of region
See Also:
IRegion.setHeight(int)

setSize

public void setSize(int size)
Description copied from interface: IRegion
Sets the size (number of pixels) of the region

Specified by:
setSize in interface IRegion
Parameters:
size - number of pixels
See Also:
IRegion.setSize(int)

setWidth

public void setWidth(int width)
Description copied from interface: IRegion
Sets the maximum width of the region

Specified by:
setWidth in interface IRegion
Parameters:
width - width of region
See Also:
IRegion.setWidth(int)

setId

public void setId(int id)
Description copied from interface: IRegion
Sets the region id (may be used for retrieving additional region information)

Specified by:
setId in interface IRegion
Parameters:
id - region identifier
See Also:
IRegion.setId(int)

getClipped

public boolean getClipped()
Description copied from interface: IRegion
Returns information whether region may be clipped (at boundary of image)

Specified by:
getClipped in interface IRegion
Returns:
whether region is clipped
See Also:
IRegion.getClipped()

setClipped

public void setClipped(boolean clipped)
Description copied from interface: IRegion
Sets clipping information (at boundary of image)

Specified by:
setClipped in interface IRegion
Parameters:
clipped - whether region is clipped
See Also:
IRegion.setClipped(boolean)

compareTo

public int compareTo(java.lang.Object region)
For sorting, compares by region size

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
region - region to be compared to
Returns:
compare value

copy

public IRegion copy()
Description copied from interface: IRegion
Deep copy of region

Specified by:
copy in interface IRegion
Returns:
deep copy
See Also:
IRegion.copy()