Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

Region Class Reference

#include <Region.h>

Inheritance diagram for Region:

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 uint 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< uint > &labels, uint 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

std::list< Region > extractRegions ( const Sketch< uint > &  labels,
uint  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().

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().

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.

int findTopBound (  ) 

int findBotBound (  ) 

int findLeftBound (  ) 

int findRightBound (  ) 

Point findTopBoundPoint (  ) 

Definition at line 171 of file Region.cc.

Referenced by LineData::splitLine().

Point findBotBoundPoint (  ) 

Definition at line 175 of file Region.cc.

Referenced by LineData::splitLine().

Point findLeftBoundPoint (  ) 

Definition at line 179 of file Region.cc.

Referenced by LineData::splitLine().

Point findRightBoundPoint (  ) 

Definition at line 183 of file Region.cc.

Referenced by LineData::splitLine().

bool isContained ( const Point pt,
const uint  max_dist = 0 
)

Definition at line 188 of file Region.cc.

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

Point mostDistantPtFrom ( const LineData ln  ) 

Definition at line 201 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 220 of file Region.cc.

Referenced by Region::findCentroid().

float findCentralMoment ( size_t  p,
size_t  q 
)

float findNormCentralMoment ( size_t  p,
size_t  q 
)

Finds the area-normalized central moment.

Definition at line 295 of file Region.cc.

Point findCentroid (  ) 

returns coords of center of mass

Definition at line 311 of file Region.cc.

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

AngPi findPrincipalAxisOrientation (  ) 

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

Definition at line 333 of file Region.cc.

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

float findSemiMajorAxisLength (  ) 

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

Definition at line 338 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 347 of file Region.cc.

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

float findRadius (  )  [inline]

Definition at line 73 of file Region.h.

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

int findXcoordFor ( const coordinate_t  y_coord  )  [private]

Definition at line 150 of file Region.cc.

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

int findYcoordFor ( const coordinate_t  x_coord  )  [private]

Definition at line 162 of file Region.cc.

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

const SketchSpace& getSpace (  )  const [inline]

Definition at line 92 of file Region.h.


Member Data Documentation

int topBound [private]

Definition at line 78 of file Region.h.

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

int botBound [private]

Definition at line 79 of file Region.h.

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

int leftBound [private]

Definition at line 80 of file Region.h.

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

int rightBound [private]

Definition at line 81 of file Region.h.

Referenced by Region::findRightBound(), 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().

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().


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

DualCoding 4.0
Generated Thu Nov 22 00:54:02 2007 by Doxygen 1.5.4