Homepage Demos Overview Downloads Tutorials Reference
Credits

Region Class Reference

#include <Region.h>

Inheritance diagram for Region:

Inheritance graph
[legend]
List of all members.

Detailed Description

Definition at line 18 of file Region.h.

Public Member Functions

 Region (const SketchSpace &_space)
 initializes all properties to be NOTCOMPUTED
 ~Region ()
bool operator< (const Region &other) const
void recomputeProperties ()
int findTopBound ()
int findBotBound ()
int findLeftBound ()
int findRightBound ()
Point findTopBoundPoint ()
Point findBotBoundPoint ()
Point findLeftBoundPoint ()
Point findRightBoundPoint ()
bool isContained (const Point &, const int max_dist=0)
Point mostDistantPtFrom (const LineData &)
float findMoment (size_t p, size_t q)
 Calculates the two-dimensional Cartesian moment Mpq.
float findCentralMoment (size_t p, size_t q)
float findNormCentralMoment (size_t p, size_t q)
 Finds the area-normalized central moment.
int findArea ()
Point findCentroid ()
 returns coords of center of mass
AngPi findPrincipalAxisOrientation ()
 Returns the angle of the orientation of the principal axis in radians.
float findSemiMajorAxisLength ()
 Returns the length of the semi-major (x) axis of the image ellipse.
float findSemiMinorAxisLength ()
 Returns the length of the semi-minor (y) axis of the image ellipse.
float findRadius ()
const SketchSpacegetSpace () const

Static Public Member Functions

static std::list< RegionextractRegions (const Sketch< usint > &labels, int area_thresh=10)
 Returns a list of the different Regions in labels, sorted by area.
static Region extractRegion (const Sketch< bool > &sketch)
 Return a single region from a sketch<bool>.

Private Member Functions

int findXcoordFor (const coordinate_t y_coord)
int findYcoordFor (const coordinate_t x_coord)

Private Attributes

const SketchSpacespace
int topBound
int botBound
int leftBound
int rightBound
float moments [MAX_MOMENT+1][MAX_MOMENT+1]
float cmoments [MAX_MOMENT+1][MAX_MOMENT+1]
int area


Constructor & Destructor Documentation

Region ( const SketchSpace _space  ) 

initializes all properties to be NOTCOMPUTED

Definition at line 18 of file Region.cc.

~Region (  )  [inline]

Definition at line 21 of file Region.h.


Member Function Documentation

Region extractRegion ( const Sketch< bool > &  sketch  )  [static]

Return a single region from a sketch<bool>.

Definition at line 67 of file Region.cc.

Referenced by BrickData::extractBrick(), PyramidData::findBoundingTriangle(), and BlobData::findCornersDiagonal().

std::list< Region > extractRegions ( const Sketch< usint > &  labels,
int  area_thresh = 10 
) [static]

Returns a list of the different Regions in labels, sorted by area.

Definition at line 38 of file Region.cc.

Referenced by EllipseData::extractEllipses(), LineData::extractLine(), and SphereData::extractSpheres().

int findBotBound (  ) 

Point findBotBoundPoint (  ) 

Definition at line 183 of file Region.cc.

Referenced by LineData::splitLine().

float findCentralMoment ( size_t  p,
size_t  q 
)

Point findCentroid (  ) 

returns coords of center of mass

Definition at line 319 of file Region.cc.

Referenced by LineData::extractLine(), and Region::findCentralMoment().

int findLeftBound (  ) 

Point findLeftBoundPoint (  ) 

Definition at line 187 of file Region.cc.

Referenced by LineData::splitLine().

float findMoment ( size_t  p,
size_t  q 
)

Calculates the two-dimensional Cartesian moment Mpq.

Definition at line 228 of file Region.cc.

Referenced by Region::findCentroid().

float findNormCentralMoment ( size_t  p,
size_t  q 
)

Finds the area-normalized central moment.

Definition at line 303 of file Region.cc.

AngPi findPrincipalAxisOrientation (  ) 

Returns the angle of the orientation of the principal axis in radians.

Definition at line 341 of file Region.cc.

Referenced by LineData::extractLine(), and Shape< EllipseData >::Shape().

float findRadius (  )  [inline]

Definition at line 73 of file Region.h.

Referenced by Shape< SphereData >::Shape().

int findRightBound (  ) 

Point findRightBoundPoint (  ) 

Definition at line 191 of file Region.cc.

Referenced by LineData::splitLine().

float findSemiMajorAxisLength (  ) 

Returns the length of the semi-major (x) axis of the image ellipse.

Definition at line 346 of file Region.cc.

Referenced by Region::findRadius(), and Shape< EllipseData >::Shape().

float findSemiMinorAxisLength (  ) 

Returns the length of the semi-minor (y) axis of the image ellipse.

Definition at line 355 of file Region.cc.

Referenced by Shape< EllipseData >::Shape().

int findTopBound (  ) 

Point findTopBoundPoint (  ) 

Definition at line 179 of file Region.cc.

Referenced by LineData::splitLine().

int findXcoordFor ( const coordinate_t  y_coord  )  [private]

Definition at line 158 of file Region.cc.

Referenced by Region::findBotBoundPoint(), and Region::findTopBoundPoint().

int findYcoordFor ( const coordinate_t  x_coord  )  [private]

Definition at line 170 of file Region.cc.

Referenced by Region::findLeftBoundPoint(), and Region::findRightBoundPoint().

const SketchSpace& getSpace (  )  const [inline]

Definition at line 92 of file Region.h.

bool isContained ( const Point ,
const int  max_dist = 0 
)

Definition at line 196 of file Region.cc.

Referenced by LineData::extractLine(), and LineData::splitLine().

Point mostDistantPtFrom ( const LineData  ) 

Definition at line 209 of file Region.cc.

Referenced by LineData::splitLine().

bool operator< ( const Region other  )  const

Compares areas of two Regions; really only used to sort Regions assumes area already calculated Notes that it actually returns greater-than instead of less-than, so that lists are sorted with biggest areas first

Definition at line 87 of file Region.cc.

void recomputeProperties (  ) 

sets all properties to be NOTCOMPUTED called after making changes (either addition/deletion) to table

Definition at line 28 of file Region.cc.


Member Data Documentation

int botBound [private]

Definition at line 79 of file Region.h.

Referenced by Region::findBotBound(), and Region::recomputeProperties().

float cmoments[MAX_MOMENT+1][MAX_MOMENT+1] [private]

Definition at line 84 of file Region.h.

Referenced by Region::findCentralMoment(), Region::recomputeProperties(), and Region::Region().

int leftBound [private]

Definition at line 80 of file Region.h.

Referenced by Region::findLeftBound(), and Region::recomputeProperties().

float moments[MAX_MOMENT+1][MAX_MOMENT+1] [private]

Definition at line 83 of file Region.h.

Referenced by Region::findMoment(), Region::recomputeProperties(), and Region::Region().

int rightBound [private]

Definition at line 81 of file Region.h.

Referenced by Region::findRightBound(), and Region::recomputeProperties().

int topBound [private]

Definition at line 78 of file Region.h.

Referenced by Region::findTopBound(), and Region::recomputeProperties().


The documentation for this class was generated from the following files:

DualCoding 3.0beta
Generated Wed Oct 4 00:02:29 2006 by Doxygen 1.4.7