Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

BlobData Class Reference

Blob shapes, described by bounding boxes and an optional list of runs. More...

#include <BlobData.h>

Inheritance diagram for BlobData:

Detailed Description

Blob shapes, described by bounding boxes and an optional list of runs.

Definition at line 32 of file BlobData.h.

List of all members.

Classes

class  AreaLessThan
struct  run

Public Types

enum  BlobOrientation_t { groundplane, pillar, poster }
 

Assumed orientation of the blob in 3D space.

More...

Public Member Functions

 BlobData (ShapeSpace &_space, const Point &_topLeft, const Point &_topRight, const Point &_bottomLeft, const Point &_bottomRight, const float _area=0, const std::vector< run > &_runvec=std::vector< run >(), const BlobOrientation_t _orientation=groundplane, const coordinate_t assumedHeight=0, const rgb rgbvalue=rgb(), bool _topValid=false, bool _bottomValid=false, bool _leftValid=false, bool _rightValid=false)
 Constructor.
 DATASTUFF_H (BlobData)
virtual Point getCentroid () const
 return the centroid of the shape in point format
float getArea () const
 Area of the blob.
virtual void printParams () const
 Print information about this shape.
virtual void applyTransform (const fmat::Transform &Tmat, const ReferenceFrameType_t newref=unspecified)
 Transformations. (Virtual in BaseData.).
virtual void projectToGround (const fmat::Transform &camToBase, const PlaneEquation &gndplane)
 Project to ground.
virtual void update_derived_properties ()
 Update derived properties.
BoundingBox2D getBoundingBox () const
 returns the bounding box of the blob
virtual bool isMatchFor (const ShapeRoot &other) const
 Match blobs based on their parameters. (Virtual in BaseData.).
virtual bool updateParams (const ShapeRoot &other, bool forceUpdate=false)
 Update shape parameters after matching to another shape.
virtual unsigned short getDimension () const
Corner extraction for rectangular blobs

std::vector< PointfindCorners (unsigned int nExpected, std::vector< Point > &candidates, float &bestValue)
std::vector< PointfindCornersDerivative ()
std::vector< PointfindCornersDiagonal ()
std::vector< PointfindCornersShapeFit (unsigned int ncorners, std::vector< Point > &candidates, float &bestValue)

Static Public Member Functions

static ShapeType_t getStaticType ()
static std::vector< Shape
< BlobData > > 
extractBlobs (const Sketch< bool > &sketch, int minarea=25, BlobOrientation_t orient=BlobData::groundplane, coordinate_t height=0, int maxblobs=50)
 Import blobs from Sketch<bool> as a vector of Shape<BlobData>
static std::vector< Shape
< BlobData > > 
extractBlobs (const Sketch< uchar > &sketch, int minarea=25, BlobOrientation_t orient=BlobData::groundplane, const coordinate_t height=0, int maxblobs=50)
 Import blobs of all colors from Sketch<uchar> as a vector of Shape<BlobData>
static std::vector< Shape
< BlobData > > 
extractBlobs (const Sketch< uchar > &sketch, const std::set< color_index > &colors, const std::map< color_index, int > &minareas, const std::map< color_index, BlobOrientation_t > &orients, const std::map< color_index, coordinate_t > &heights, int maxblobs)
 Import blobs of specified colors from Sketch<uchar> as a vector of Shape<BlobData>
static BlobDatanew_blob (ShapeSpace &space, const CMVision::region &reg, const CMVision::run< CMVision::uchar > *rle_buff, const BlobOrientation_t orient, const coordinate_t height, const rgb rgbvalue)
 Utility function for making a new blob instance from CMVision's region data structures.

Public Attributes

bool topValid
bool bottomValid
bool leftValid
bool rightValid
BlobOrientation_t orientation
 Orientation of the blob.
coordinate_t assumedHeight
Point topLeft
 Bounding quadrilateral: may not be square when projected to ground space.
Point topRight
Point bottomLeft
Point bottomRight
float area
 Area of the blob; may not be integer when projected to ground space.
const std::vector< runrunvec
 Runs (for rendering in camera space).

Private Member Functions

virtual Sketch< bool > * render () const
 Render into a sketch space and return reference. (Private.).
BlobDataoperator= (const BlobData &)
 don't call

Friends

class Shape< BlobData >

Member Enumeration Documentation

Assumed orientation of the blob in 3D space.

Enumerator:
groundplane 

2D shape lying flat on the ground

pillar 

3D shape standing on the ground

poster 

3D shape hanging vertically in space

Definition at line 36 of file BlobData.h.


Constructor & Destructor Documentation

BlobData ( ShapeSpace _space,
const Point _topLeft,
const Point _topRight,
const Point _bottomLeft,
const Point _bottomRight,
const float  _area = 0,
const std::vector< run > &  _runvec = std::vector<run>(),
const BlobOrientation_t  _orientation = groundplane,
const coordinate_t  assumedHeight = 0,
const rgb  rgbvalue = rgb(),
bool  _topValid = false,
bool  _bottomValid = false,
bool  _leftValid = false,
bool  _rightValid = false 
)

Constructor.

Definition at line 26 of file BlobData.cc.

Referenced by BlobData::new_blob().


Member Function Documentation

void applyTransform ( const fmat::Transform Tmat,
const ReferenceFrameType_t  newref = unspecified 
) [virtual]

Transformations. (Virtual in BaseData.).

Implements BaseData.

Definition at line 176 of file BlobData.cc.

DATASTUFF_H ( BlobData   ) 
std::vector< Shape< BlobData > > extractBlobs ( const Sketch< uchar > &  sketch,
const std::set< color_index > &  colors,
const std::map< color_index, int > &  minareas,
const std::map< color_index, BlobOrientation_t > &  orients,
const std::map< color_index, coordinate_t > &  heights,
int  maxblobs 
) [static]

Import blobs of specified colors from Sketch<uchar> as a vector of Shape<BlobData>

Definition at line 336 of file BlobData.cc.

std::vector< Shape< BlobData > > extractBlobs ( const Sketch< uchar > &  sketch,
int  minarea = 25,
BlobOrientation_t  orient = BlobData::groundplane,
const coordinate_t  height = 0,
int  maxblobs = 50 
) [static]

Import blobs of all colors from Sketch<uchar> as a vector of Shape<BlobData>

Definition at line 316 of file BlobData.cc.

std::vector< Shape< BlobData > > extractBlobs ( const Sketch< bool > &  sketch,
int  minarea = 25,
BlobOrientation_t  orient = BlobData::groundplane,
coordinate_t  height = 0,
int  maxblobs = 50 
) [static]

Import blobs from Sketch<bool> as a vector of Shape<BlobData>

Definition at line 288 of file BlobData.cc.

Referenced by BlobData::extractBlobs(), CylinderData::extractCylinders(), and TargetData::extractLineTarget().

std::vector< Point > findCorners ( unsigned int  nExpected,
std::vector< Point > &  candidates,
float bestValue 
)

Definition at line 458 of file BlobData.cc.

std::vector< Point > findCornersDerivative (  ) 

Definition at line 624 of file BlobData.cc.

std::vector< Point > findCornersDiagonal (  ) 

Definition at line 704 of file BlobData.cc.

std::vector< Point > findCornersShapeFit ( unsigned int  ncorners,
std::vector< Point > &  candidates,
float bestValue 
)

Definition at line 821 of file BlobData.cc.

Referenced by BlobData::findCorners().

float getArea (  )  const

Area of the blob.

Definition at line 83 of file BlobData.h.

BoundingBox2D getBoundingBox (  )  const [virtual]

returns the bounding box of the blob

Reimplemented from BaseData.

Definition at line 51 of file BlobData.cc.

Point getCentroid (  )  const [virtual]

return the centroid of the shape in point format

Implements BaseData.

Definition at line 46 of file BlobData.cc.

Referenced by BlobData::findCornersDerivative(), BlobData::findCornersDiagonal(), BlobData::isMatchFor(), BlobData::projectToGround(), and BlobData::render().

virtual unsigned short getDimension (  )  const [virtual]

Implements BaseData.

Definition at line 108 of file BlobData.h.

static ShapeType_t getStaticType (  )  [static]

Definition at line 73 of file BlobData.h.

bool isMatchFor ( const ShapeRoot other  )  const [virtual]

Match blobs based on their parameters. (Virtual in BaseData.).

Implements BaseData.

Definition at line 251 of file BlobData.cc.

BlobData * new_blob ( ShapeSpace space,
const CMVision::region reg,
const CMVision::run< CMVision::uchar > *  rle_buff,
const BlobOrientation_t  orient,
const coordinate_t  height,
const rgb  rgbvalue 
) [static]

Utility function for making a new blob instance from CMVision's region data structures.

Definition at line 391 of file BlobData.cc.

Referenced by BlobData::extractBlobs(), and VRmixin::getBlobsFromRegionGenerator().

BlobData& operator= ( const BlobData  )  [private]

don't call

void printParams (  )  const [virtual]

Print information about this shape.

Implements BaseData.

Definition at line 61 of file BlobData.cc.

void projectToGround ( const fmat::Transform camToBase,
const PlaneEquation gndplane 
) [virtual]

Project to ground.

Implements BaseData.

Definition at line 183 of file BlobData.cc.

Sketch< bool > * render (  )  const [private, virtual]

Render into a sketch space and return reference. (Private.).

Implements BaseData.

Definition at line 72 of file BlobData.cc.

void update_derived_properties (  )  [virtual]

Update derived properties.

Definition at line 218 of file BlobData.cc.

Referenced by BlobData::projectToGround(), and BlobData::updateParams().

bool updateParams ( const ShapeRoot other,
bool  forceUpdate = false 
) [virtual]

Update shape parameters after matching to another shape.

Implements BaseData.

Definition at line 259 of file BlobData.cc.


Friends And Related Function Documentation

friend class Shape< BlobData > [friend]

Definition at line 77 of file BlobData.h.


Member Data Documentation

Area of the blob; may not be integer when projected to ground space.

Definition at line 58 of file BlobData.h.

Referenced by BlobData::getArea(), BlobData::isMatchFor(), BlobData::printParams(), BlobData::update_derived_properties(), and BlobData::updateParams().

Assumed height above ground of blob centroid (for poster) or top (for pillar)

Definition at line 55 of file BlobData.h.

Referenced by BlobData::printParams(), BlobData::projectToGround(), and BlobData::update_derived_properties().

Definition at line 52 of file BlobData.h.

Referenced by BlobData::new_blob(), and BlobData::updateParams().

Definition at line 52 of file BlobData.h.

Referenced by BlobData::new_blob(), and BlobData::updateParams().

Definition at line 52 of file BlobData.h.

Referenced by BlobData::new_blob(), and BlobData::updateParams().

const std::vector<run> runvec

Runs (for rendering in camera space).

Definition at line 59 of file BlobData.h.

Referenced by BlobData::new_blob(), and BlobData::render().

Definition at line 52 of file BlobData.h.

Referenced by BlobData::new_blob(), and BlobData::updateParams().


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

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