Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

Region Class Reference

#include <Region.h>

Inheritance diagram for Region:

Detailed Description

Definition at line 20 of file Region.h.

List of all members.

Public Member Functions

 Region (const SketchSpace &_space)
 initializes all properties to be NOTCOMPUTED
 ~Region ()
Sketch< boolgetRendering () const
 Render a region as a Sketch<bool>
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
Regionoperator= (const Region &other)

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

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

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

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(), NaughtData::extractNaughts(), and SphereData::extractSpheres().

int findBotBound (  ) 
Point findBotBoundPoint (  ) 

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

Referenced by Region::findCentralMoment().

int findLeftBound (  ) 
Point findLeftBoundPoint (  ) 

Definition at line 181 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 222 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 297 of file Region.cc.

AngPi findPrincipalAxisOrientation (  ) 

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

Definition at line 335 of file Region.cc.

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

float findRadius (  ) 

Definition at line 78 of file Region.h.

int findRightBound (  ) 
Point findRightBoundPoint (  ) 

Definition at line 185 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 340 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 348 of file Region.cc.

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

int findTopBound (  ) 
Point findTopBoundPoint (  ) 

Definition at line 173 of file Region.cc.

Referenced by LineData::splitLine().

int findXcoordFor ( const coordinate_t  y_coord  )  [private]

Definition at line 152 of file Region.cc.

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

int findYcoordFor ( const coordinate_t  x_coord  )  [private]

Definition at line 164 of file Region.cc.

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

Sketch<bool> getRendering (  )  const

Render a region as a Sketch<bool>

Definition at line 34 of file Region.h.

const SketchSpace& getSpace (  )  const

Definition at line 97 of file Region.h.

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

Definition at line 190 of file Region.cc.

Referenced by LineData::splitLine().

Point mostDistantPtFrom ( const LineData ln  ) 

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

Region & operator= ( const Region other  ) 

Definition at line 357 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 84 of file Region.h.

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

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

Definition at line 85 of file Region.h.

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

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

Definition at line 86 of file Region.h.

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

int topBound [private]

Definition at line 83 of file Region.h.

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


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

DualCoding 5.1CVS
Generated Mon May 9 04:56:31 2016 by Doxygen 1.6.3