Homepage Demos Overview Downloads Tutorials Reference
Credits

LineData Class Reference

#include <LineData.h>

Inheritance diagram for LineData:

Inheritance graph
[legend]
List of all members.

Detailed Description

Definition at line 24 of file LineData.h.
void clearLine (Sketch< bool > &sketch)
 Clear out pixels that are on or close to this line.
void scanHorizForEndPts (const Sketch< usint > &skelDist, const Sketch< bool > &occlusions, float m, float b)
 Clear out pixels that are on or close to this line.
void scanVertForEndPts (const Sketch< usint > &skelDist, const Sketch< bool > &occlusions, float m, float b)
 Clear out pixels that are on or close to this line.
void balanceEndPointHoriz (EndPoint &pt, Sketch< bool > const &occluders, float m, float b)
 Clear out pixels that are on or close to this line.
void balanceEndPointVert (EndPoint &pt, Sketch< bool > const &occluders, float m, float b)
 Clear out pixels that are on or close to this line.
static Shape< LineDataextractLine (Sketch< bool > &sketch)
 Extracts most prominent line from a skeletonized image.
static Shape< LineDataextractLine (Sketch< bool > &skelsketch, const Sketch< bool > &occlusions)
static Shape< LineDatasplitLine (ShapeSpace &ShS, Region &skelchunk, Sketch< bool > &skeleton, const Sketch< bool > &occlusions)
 Helper functions used by extractLine().
static vector< Shape< LineData > > extractLines (Sketch< bool > const &sketch, int const num_lines=10)
 Clear out pixels that are on or close to this line.
static vector< Shape< LineData > > extractLines (Sketch< bool > const &skel, Sketch< bool > const &occluders, int const num_lines=10)
 Clear out pixels that are on or close to this line.
static std::vector< Shape<
LineData > > 
houghTransform (const Sketch< bool > &fat, const Sketch< bool > &skinny, const Sketch< bool > &occlusions, const size_t num_lines, int minLength=DEFAULT_MIN_LENGTH)
static bool linesParallel (Shape< LineData > l1, Shape< LineData >l2)
 Clear out pixels that are on or close to this line.
Sketch< bool > * render () const
 Render into a sketch space and return reference.
void setDrawCoords (float &x1, float &y1, float &x2, float &y2, const int width, const int height) const
static void drawline2d (Sketch< bool > &canvas, int x0, int y0, int x1, int y1)
 Render into a sketch space and return reference.

Public Member Functions

 LineData (ShapeSpace &_space, const Point &p1, const Point &p2)
 Constructor.
 LineData (ShapeSpace &_space, const Point &pt, orientation_t orient)
 Constructor.
 LineData (const LineData &other)
 Copy constructor.
 DATASTUFF_H (LineData)
virtual Point getCentroid () const
 Centroid. (Virtual in BaseData.).
void setInfinite (bool value=true)
 Makes endpoints inactive if value = true.
BoundingBox getBoundingBox () const
virtual bool isMatchFor (const ShapeRoot &other) const
 Match lines based on their parameters. (Virtual in BaseData.).
bool isMatchFor (const LineData &other) const
virtual bool isAdmissible () const
 Lines are admissible to the local map if they're long enough to not be noise.
virtual bool updateParams (const ShapeRoot &other, bool force=false)
 Update a line in the local map with info from a matching line in the ground space.
virtual void mergeWith (const ShapeRoot &other)
LineDataoperator= (const LineData &)
bool isValidUpdate (coordinate_t p1, coordinate_t p2, coordinate_t p3, coordinate_t p4)
virtual void printParams () const
 Print information about this shape. (Virtual in BaseData.).
virtual unsigned short getDimension () const
void printEnds () const
void setEndPts (const EndPoint &_end1_pt, const EndPoint &_end2_pt)
 Functions to set endpoints.
bool isOverlappedWith (const LineData &otherline, int amount=0) const
bool isBetween (const Point &p, const LineData &other) const
 Check if point falls between the two lines.
bool pointsOnSameSide (const Point &p1, const Point &p2)
bool pointOnLine (const Point &p)
virtual Sketch< bool > & getRendering ()
 Rendering.
void update_derived_properties ()
 Functions to set values dealing with orientation.
bool isNotVertical () const
 True if line orientation is far enough from vertical.
virtual void applyTransform (const NEWMAT::Matrix &Tmat)
 Apply a transformation to this shape.
virtual void projectToGround (const NEWMAT::Matrix &camToBase, const NEWMAT::ColumnVector &groundplane)
 Project to ground.
EndPointend1Pt ()
 Point Access functions.
EndPointend2Pt ()
 Point Access functions.
const EndPointend1Pt () const
 Point Access functions.
const EndPointend2Pt () const
 Point Access functions.
EndPointleftPt ()
 Logical endpoints.
EndPointrightPt ()
 Point Access functions.
EndPointtopPt ()
 Point Access functions.
EndPointbottomPt ()
 Point Access functions.
Shape< PointDataleftPtShape ()
 Point Access functions.
Shape< PointDatarightPtShape ()
 Point Access functions.
Shape< PointDatatopPtShape ()
 Point Access functions.
Shape< PointDatabottomPtShape ()
 Point Access functions.
EndPointfirstPt ()
EndPointfirstPt (const Shape< LineData > &otherline) const
 Point Access functions.
EndPointsecondPt ()
 Point Access functions.
EndPointsecondPt (const Shape< LineData > &otherline) const
 Point Access functions.
coordinate_t firstPtCoord () const
 Point Access functions.
coordinate_t firstPtCoord (const Shape< LineData > &otherline) const
 Point Access functions.
coordinate_t secondPtCoord () const
 Point Access functions.
coordinate_t secondPtCoord (const Shape< LineData > &otherline) const
 Point Access functions.
float getRhoNorm () const
 Properties functions.
AngTwoPi getThetaNorm () const
 Properties functions.
AngPi getOrientation () const
 Properties functions.
float getLength () const
 Properties functions.
pair< float, float > lineEquation_mb () const
 Properties functions.
vector< float > lineEquation_abc () const
 Determine parameters a, b, c satisfying the equation ax + by = c.
vector< float > lineEquation_abc_xz () const
 Determine parameters a, b, c, d satisfying the equation ax + bz = c.
bool isLongerThan (const Shape< LineData > &other) const
 These functions are true based on line length.
bool isLongerThan (float ref_length) const
 These functions are true based on line length.
bool isShorterThan (const Shape< LineData > &other) const
 These functions are true based on line length.
bool isShorterThan (float ref_length) const
 These functions are true based on line length.
bool intersectsLine (const Shape< LineData > &other) const
 Check intersection.
bool intersectsLine (const LineData &other) const
 Check intersection.
Point intersectionWithLine (const Shape< LineData > &other) const
 Check intersection.
Point intersectionWithLine (const Shape< LineData > &other, bool &intersection_on_this, bool &intersection_on_other) const
 Check intersection.
Point intersectionWithLine (const LineData &other) const
 Check intersection.
Point intersectionWithLine (const LineData &other, bool &intersection_on_this, bool &intersection_on_other) const
 Check intersection.
float perpendicularDistanceFrom (const Point &other) const
 Distance.

Static Public Member Functions

static ShapeType_t getStaticType ()
static void updateLinePt (EndPoint &localPt, coordinate_t local_coord, const EndPoint &groundPt, coordinate_t ground_coord, int sign)

Private Attributes

EndPoint end1_pt
EndPoint end2_pt
float rho_norm
AngTwoPi theta_norm
AngPi orientation
float length

Static Private Attributes

static const Point origin_pt = Point(0,0)
static const int extractorGapTolerance = 8

Friends

class Shape< LineData >
class PolygonData
class BlobData

Classes

class  ColinearTest
class  IsHorizontal
class  LengthLessThan
 Comparison predicates used by shape functions. More...
class  ParallelTest
class  PerpendicularTest


Constructor & Destructor Documentation

LineData ( ShapeSpace _space,
const Point p1,
const Point p2 
) [inline]

Constructor.

Definition at line 42 of file LineData.h.

LineData ( ShapeSpace _space,
const Point pt,
orientation_t  orient 
)

Constructor.

Definition at line 27 of file LineData.cc.

LineData ( const LineData other  )  [inline]

Copy constructor.

Definition at line 51 of file LineData.h.


Member Function Documentation

void applyTransform ( const NEWMAT::Matrix &  Tmat  )  [virtual]

Apply a transformation to this shape.

Implements BaseData.

Definition at line 218 of file LineData.cc.

void balanceEndPointHoriz ( EndPoint pt,
Sketch< bool > const &  occluders,
float  m,
float  b 
)

Clear out pixels that are on or close to this line.

Definition at line 964 of file LineData.cc.

void balanceEndPointVert ( EndPoint pt,
Sketch< bool > const &  occluders,
float  m,
float  b 
)

Clear out pixels that are on or close to this line.

Definition at line 974 of file LineData.cc.

EndPoint & bottomPt (  ) 

Point Access functions.

Definition at line 237 of file LineData.cc.

Referenced by LineData::pointOnLine().

Shape< PointData > bottomPtShape (  ) 

Point Access functions.

Definition at line 263 of file LineData.cc.

void clearLine ( Sketch< bool > &  sketch  ) 

Clear out pixels that are on or close to this line.

Definition at line 1022 of file LineData.cc.

DATASTUFF_H ( LineData   ) 

void drawline2d ( Sketch< bool > &  canvas,
int  x0,
int  y0,
int  x1,
int  y1 
) [static, private]

Render into a sketch space and return reference.

Render line to SketchSpace and return reference. This function does not link the Sketch<bool>* in the shape to the sketch returned.

Definition at line 1171 of file LineData.cc.

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

const EndPoint& end1Pt (  )  const [inline]

Point Access functions.

Definition at line 111 of file LineData.h.

const EndPoint& end2Pt (  )  const [inline]

Point Access functions.

Definition at line 112 of file LineData.h.

Shape< LineData > extractLine ( Sketch< bool > &  skelsketch,
const Sketch< bool > &  occlusions 
) [static]

Extracts most prominent line from a skeletonized image. It's often useful to use the original sketch as an occluder

Definition at line 727 of file LineData.cc.

Shape< LineData > extractLine ( Sketch< bool > &  sketch  )  [static]

Extracts most prominent line from a skeletonized image.

Definition at line 721 of file LineData.cc.

Referenced by BrickData::extractBrick(), LineData::extractLines(), PyramidData::extractPyramid(), and LineData::splitLine().

vector< Shape< LineData > > extractLines ( Sketch< bool > const &  skel,
Sketch< bool > const &  occluders,
int const   num_lines = 10 
) [static]

Clear out pixels that are on or close to this line.

Definition at line 1003 of file LineData.cc.

vector< Shape< LineData > > extractLines ( Sketch< bool > const &  sketch,
int const   num_lines = 10 
) [static]

Clear out pixels that are on or close to this line.

Definition at line 996 of file LineData.cc.

Referenced by PolygonData::extractPolygonEdges(), and MapBuilder::getCamLines().

EndPoint & firstPt ( const Shape< LineData > &  otherline  )  const

Point Access functions.

Definition at line 282 of file LineData.cc.

EndPoint & firstPt (  ) 

The first point of a line is the leftmost point if the line is horizontal, else the topmost point. With an optional Shape<LineData> argument, uses the current line's orientation to pick the appropriate point of the other line.

Definition at line 271 of file LineData.cc.

Referenced by LineData::firstPtCoord(), and LineData::updateParams().

coordinate_t firstPtCoord ( const Shape< LineData > &  otherline  )  const

Point Access functions.

Definition at line 321 of file LineData.cc.

coordinate_t firstPtCoord (  )  const

Point Access functions.

Definition at line 315 of file LineData.cc.

Referenced by LineData::isOverlappedWith(), and LineData::updateParams().

BoundingBox getBoundingBox (  )  const [inline, virtual]

Reimplemented from BaseData.

Definition at line 70 of file LineData.h.

Point getCentroid (  )  const [virtual]

Centroid. (Virtual in BaseData.).

Implements BaseData.

Definition at line 61 of file LineData.cc.

Referenced by LineData::isMatchFor().

virtual unsigned short getDimension (  )  const [inline, virtual]

Implements BaseData.

Definition at line 105 of file LineData.h.

float getLength (  )  const [inline]

Properties functions.

Definition at line 148 of file LineData.h.

Referenced by LineData::printParams().

AngPi getOrientation (  )  const [inline]

Sketch< bool > & getRendering (  )  [virtual]

Rendering.

Returns a pointer to the rendering associated with the ShapeRoot object. If no such rendering exists, it is created.

Reimplemented from BaseData.

Definition at line 1036 of file LineData.cc.

Referenced by LineData::clearLine(), PyramidData::render(), and BrickData::render().

float getRhoNorm (  )  const [inline]

Properties functions.

Definition at line 145 of file LineData.h.

static ShapeType_t getStaticType (  )  [inline, static]

Definition at line 57 of file LineData.h.

AngTwoPi getThetaNorm (  )  const [inline]

Properties functions.

Definition at line 146 of file LineData.h.

std::vector< Shape< LineData > > houghTransform ( const Sketch< bool > &  fat,
const Sketch< bool > &  skinny,
const Sketch< bool > &  occlusions,
const size_t  num_lines,
int  minLength = DEFAULT_MIN_LENGTH 
) [static]

Definition at line 1222 of file LineData.cc.

Point intersectionWithLine ( const LineData other,
bool intersection_on_this,
bool intersection_on_other 
) const

Check intersection.

Definition at line 611 of file LineData.cc.

Point intersectionWithLine ( const LineData other  )  const [inline]

Check intersection.

Definition at line 184 of file LineData.h.

Point intersectionWithLine ( const Shape< LineData > &  other,
bool intersection_on_this,
bool intersection_on_other 
) const

Check intersection.

Definition at line 604 of file LineData.cc.

Point intersectionWithLine ( const Shape< LineData > &  other  )  const [inline]

Check intersection.

Definition at line 179 of file LineData.h.

Referenced by BlobData::findCorners(), LineData::intersectionWithLine(), and LineData::isBetween().

bool intersectsLine ( const LineData other  )  const

Check intersection.

Definition at line 538 of file LineData.cc.

bool intersectsLine ( const Shape< LineData > &  other  )  const

Check intersection.

Definition at line 533 of file LineData.cc.

Referenced by PolygonData::isInside().

bool isAdmissible (  )  const [virtual]

Lines are admissible to the local map if they're long enough to not be noise.

Reimplemented from BaseData.

Definition at line 174 of file LineData.cc.

bool isBetween ( const Point p,
const LineData other 
) const

Check if point falls between the two lines.

Definition at line 509 of file LineData.cc.

bool isLongerThan ( float  ref_length  )  const

These functions are true based on line length.

Definition at line 499 of file LineData.cc.

bool isLongerThan ( const Shape< LineData > &  other  )  const

These functions are true based on line length.

Definition at line 496 of file LineData.cc.

bool isMatchFor ( const LineData other  )  const

Definition at line 81 of file LineData.cc.

bool isMatchFor ( const ShapeRoot other  )  const [virtual]

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

Implements BaseData.

Definition at line 72 of file LineData.cc.

Referenced by PolygonData::isClosed().

bool isNotVertical (  )  const

True if line orientation is far enough from vertical.

Definition at line 470 of file LineData.cc.

Referenced by LineData::firstPt(), LineData::firstPtCoord(), LineData::secondPt(), and LineData::secondPtCoord().

bool isOverlappedWith ( const LineData otherline,
int  amount = 0 
) const

Definition at line 100 of file LineData.cc.

Referenced by LineData::isMatchFor().

bool isShorterThan ( float  ref_length  )  const

These functions are true based on line length.

Definition at line 505 of file LineData.cc.

bool isShorterThan ( const Shape< LineData > &  other  )  const

These functions are true based on line length.

Definition at line 502 of file LineData.cc.

bool isValidUpdate ( coordinate_t  p1,
coordinate_t  p2,
coordinate_t  p3,
coordinate_t  p4 
)

Definition at line 120 of file LineData.cc.

Referenced by LineData::updateParams().

EndPoint & leftPt (  ) 

Shape< PointData > leftPtShape (  ) 

Point Access functions.

Definition at line 239 of file LineData.cc.

std::vector< float > lineEquation_abc (  )  const

Determine parameters a, b, c satisfying the equation ax + by = c.

Definition at line 414 of file LineData.cc.

Referenced by LineData::perpendicularDistanceFrom(), LineData::printParams(), SphereData::projectToGround(), and LineData::update_derived_properties().

std::vector< float > lineEquation_abc_xz (  )  const

Determine parameters a, b, c, d satisfying the equation ax + bz = c.

Definition at line 374 of file LineData.cc.

Referenced by SphereData::projectToGround().

std::pair< float, float > lineEquation_mb (  )  const

Properties functions.

Definition at line 361 of file LineData.cc.

Referenced by LineData::intersectsLine().

bool linesParallel ( Shape< LineData l1,
Shape< LineData l2 
) [static]

Clear out pixels that are on or close to this line.

Definition at line 1413 of file LineData.cc.

void mergeWith ( const ShapeRoot other  )  [virtual]

Definition at line 108 of file LineData.cc.

LineData & operator= ( const LineData  ) 

Definition at line 1427 of file LineData.cc.

float perpendicularDistanceFrom ( const Point other  )  const

bool pointOnLine ( const Point p  ) 

Definition at line 1455 of file LineData.cc.

bool pointsOnSameSide ( const Point p1,
const Point p2 
)

Definition at line 1442 of file LineData.cc.

void printEnds (  )  const

Definition at line 205 of file LineData.cc.

void printParams (  )  const [virtual]

Print information about this shape. (Virtual in BaseData.).

Implements BaseData.

Definition at line 182 of file LineData.cc.

Referenced by PolygonData::tryClosePolygon().

void projectToGround ( const NEWMAT::Matrix &  camToBase,
const NEWMAT::ColumnVector &  groundplane 
) [virtual]

Project to ground.

Implements BaseData.

Definition at line 224 of file LineData.cc.

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

Render into a sketch space and return reference.

Render line to SketchSpace and return reference. This function does not link the Sketch<bool>* in the shape to the sketch returned.

Implements BaseData.

Definition at line 1046 of file LineData.cc.

Referenced by LineData::getRendering().

EndPoint & rightPt (  ) 

Point Access functions.

Definition at line 235 of file LineData.cc.

Referenced by LineData::pointOnLine().

Shape< PointData > rightPtShape (  ) 

Point Access functions.

Definition at line 247 of file LineData.cc.

void scanHorizForEndPts ( const Sketch< usint > &  skelDist,
const Sketch< bool > &  occlusions,
float  m,
float  b 
)

Clear out pixels that are on or close to this line.

Definition at line 816 of file LineData.cc.

void scanVertForEndPts ( const Sketch< usint > &  skelDist,
const Sketch< bool > &  occlusions,
float  m,
float  b 
)

Clear out pixels that are on or close to this line.

Definition at line 890 of file LineData.cc.

EndPoint & secondPt ( const Shape< LineData > &  otherline  )  const

Point Access functions.

Definition at line 304 of file LineData.cc.

EndPoint & secondPt (  ) 

Point Access functions.

Definition at line 293 of file LineData.cc.

Referenced by LineData::secondPtCoord(), and LineData::updateParams().

coordinate_t secondPtCoord ( const Shape< LineData > &  otherline  )  const

Point Access functions.

Definition at line 333 of file LineData.cc.

coordinate_t secondPtCoord (  )  const

Point Access functions.

Definition at line 327 of file LineData.cc.

Referenced by LineData::isOverlappedWith(), and LineData::updateParams().

void setDrawCoords ( float &  x1,
float &  y1,
float &  x2,
float &  y2,
const int  width,
const int  height 
) const [private]

returns a Sketch which is true where the specified line is end0_stop and end1_stop specify whether rendering should stop at endpoints

Definition at line 1065 of file LineData.cc.

Referenced by LineData::render().

void setEndPts ( const EndPoint _end1_pt,
const EndPoint _end2_pt 
)

Functions to set endpoints.

Definition at line 343 of file LineData.cc.

Referenced by PolygonData::tryImportNewEndline(), and LineData::updateParams().

void setInfinite ( bool  value = true  ) 

Makes endpoints inactive if value = true.

Definition at line 63 of file LineData.cc.

Shape< LineData > splitLine ( ShapeSpace ShS,
Region skelchunk,
Sketch< bool > &  skeleton,
const Sketch< bool > &  occlusions 
) [static]

Helper functions used by extractLine().

Definition at line 788 of file LineData.cc.

Referenced by LineData::extractLine().

EndPoint & topPt (  ) 

Point Access functions.

Definition at line 236 of file LineData.cc.

Referenced by LineData::pointOnLine().

Shape< PointData > topPtShape (  ) 

Point Access functions.

Definition at line 255 of file LineData.cc.

void update_derived_properties (  ) 

Functions to set values dealing with orientation.

Definition at line 454 of file LineData.cc.

Referenced by LineData::applyTransform(), LineData::LineData(), LineData::mergeWith(), LineData::projectToGround(), LineData::setEndPts(), and LineData::updateParams().

void updateLinePt ( EndPoint localPt,
coordinate_t  local_coord,
const EndPoint groundPt,
coordinate_t  ground_coord,
int  sign 
) [static]

Definition at line 161 of file LineData.cc.

Referenced by LineData::updateParams().

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

Update a line in the local map with info from a matching line in the ground space.

Implements BaseData.

Definition at line 128 of file LineData.cc.


Friends And Related Function Documentation

friend class BlobData [friend]

Definition at line 37 of file LineData.h.

friend class PolygonData [friend]

Definition at line 36 of file LineData.h.


Member Data Documentation

const int extractorGapTolerance = 8 [static, private]

Definition at line 296 of file LineData.h.

Referenced by LineData::scanHorizForEndPts(), and LineData::scanVertForEndPts().

const Point origin_pt = Point(0,0) [static, private]

Definition at line 33 of file LineData.h.

Referenced by LineData::update_derived_properties().


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

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