Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

LineData Class Reference

A line shape, with two endpoints, a length, orientation, etc. More...

#include <LineData.h>

Inheritance diagram for LineData:

Detailed Description

A line shape, with two endpoints, a length, orientation, etc.

Definition at line 20 of file LineData.h.

List of all members.

Classes

class  ColinearTest
 True if line orientations are within ang_tol (default 20 deg) and normpoints are within dist_tol (default 10 units). More...
class  IsHorizontal
 Predicate returns true if line orientation is within threshold of horizontal. More...
class  IsVertical
 Predicate returns true if line orientation is within threshold of vertical. More...
class  LengthLessThan
 True if line1 shorter than line2. More...
class  LineDataLengthLessThan
class  ParallelTest
 True if difference in line orientations is <= tolerance (default 20 deg). More...
class  PerpendicularTest
 True if difference in line orientations is 90 deg +/- tolerance (default 20 deg). More...

Public Member Functions

 LineData (ShapeSpace &_space, const EndPoint &p1, const EndPoint &p2)
 Constructor.
 LineData (ShapeSpace &_space, const Point &pt, orientation_t orient)
 Constructor.
 LineData (const LineData &other)
 Copy constructor.
 DATASTUFF_H (LineData)
void update_derived_properties ()
 Updates norm parameters (rho and theta).
virtual Point getCentroid () const
 Centroid. (Virtual in BaseData.).
void setInfinite (bool value=true)
 Makes endpoints inactive if value = true.
BoundingBox2D 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 void applyTransform (const fmat::Transform &Tmat, const ReferenceFrameType_t newref=unspecified)
 Transformations. (Virtual in BaseData.).
virtual void projectToGround (const fmat::Transform &camToBase, const PlaneEquation &groundplane)
 Project to ground.
virtual unsigned short getDimension () const
void printEnds () const
void setEndPts (const EndPoint &_end1_pt, const EndPoint &_end2_pt)
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)
float perpendicularDistanceFrom (const Point &other) const
 Distance.
virtual Sketch< bool > & getRendering ()
 Update properties of the shape derived from endpoints or other basic parameters.
Point access functions.

EndPointend1Pt ()
EndPointend2Pt ()
const EndPointend1Pt () const
const EndPointend2Pt () const
EndPointleftPt ()
const EndPointleftPt () const
EndPointrightPt ()
const EndPointrightPt () const
EndPointtopPt ()
const EndPointtopPt () const
EndPointbottomPt ()
const EndPointbottomPt () const
Shape< PointDataleftPtShape ()
Shape< PointDatarightPtShape ()
Shape< PointDatatopPtShape ()
Shape< PointDatabottomPtShape ()
EndPointfirstPt ()
const EndPointfirstPt () const
const EndPointfirstPt (const Shape< LineData > &otherline) const
EndPointsecondPt ()
const EndPointsecondPt () const
const EndPointsecondPt (const Shape< LineData > &otherline) const
Shape< PointDatafirstPtShape ()
Shape< PointDatasecondPtShape ()
coordinate_t firstPtCoord () const
coordinate_t firstPtCoord (const Shape< LineData > &otherline) const
coordinate_t secondPtCoord () const
coordinate_t secondPtCoord (const Shape< LineData > &otherline) const
Properties functions

float getRhoNorm () const
 Determine parameters a, b, c satisfying the equation ax + by = c.
AngTwoPi getThetaNorm () const
 Determine parameters a, b, c satisfying the equation ax + by = c.
AngPi getOrientation () const
 Determine parameters a, b, c satisfying the equation ax + by = c.
float getLength () const
 Determine parameters a, b, c satisfying the equation ax + by = c.
std::pair< float, floatlineEquation_mb () const
 Determine parameters a, b, c satisfying the equation ax + by = c.
std::vector< floatlineEquation_abc () const
 Determine parameters a, b, c satisfying the equation ax + by = c.
std::vector< floatlineEquation_abc_xz () const
 Determine parameters a, b, c, d satisfying the equation ax + bz = c.
Orientation functions

bool isNotVertical () const
 True if line orientation is far enough from vertical.
bool isOverlappedWith (const LineData &otherline, int amount=0) const
 True if line orientation is far enough from vertical.
Left/Right predicates

bool pointIsLeftOf (const Point &pt) const
 Defined on Point, but will also work on PointData or Shape<PointData> due to type coercion.
bool pointIsRightOf (const Point &pt) const
 Defined on Point, but will also work on PointData or Shape<PointData> due to type coercion.
bool pointIsAbove (const Point &pt) const
 Defined on Point, but will also work on PointData or Shape<PointData> due to type coercion.
bool pointIsBelow (const Point &pt) const
 Defined on Point, but will also work on PointData or Shape<PointData> due to type coercion.
Predicates based on line length

bool isLongerThan (const Shape< LineData > &other) const
bool isLongerThan (float ref_length) const
bool isShorterThan (const Shape< LineData > &other) const
bool isShorterThan (float ref_length) const
Check line intersection

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

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)
Line extraction

static Shape< LineDataextractLine (Sketch< bool > &sketch)
 Extracts most prominent line from a skeletonized image.
static Shape< LineDataoldExtractLine (Sketch< bool > &sketch)
 Extracts most prominent line from a skeletonized image.
static Shape< LineDataextractLine (Sketch< bool > &skelsketch, const Sketch< bool > &occlusions)
static Shape< LineDataoldExtractLine (Sketch< bool > &skelsketch, const Sketch< bool > &occlusions)
 Extracts most prominent line from a skeletonized image.

Static Public Attributes

static const float DEFAULT_MIN_LENGTH = 0.025f
 Min line length as a fraction of sketch width.

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 = 15

Friends

class Shape< LineData >
class PolygonData
class BlobData



void clearLine (Sketch< bool > &sketch)
 Clears a line from a sketch.
void scanHorizForEndPts (const Sketch< uint > &skelDist, const Sketch< bool > &occlusions, float m, float b)
 Clears a line from a sketch.
void scanVertForEndPts (const Sketch< uint > &skelDist, const Sketch< bool > &occlusions, float m, float b)
 Clears a line from a sketch.
void balanceEndPointHoriz (EndPoint &pt, Sketch< bool > const &occluders, float m, float b)
 Clears a line from a sketch.
void balanceEndPointVert (EndPoint &pt, Sketch< bool > const &occluders, float m, float b)
 Clears a line from a sketch.
static Shape< LineDatasplitLine (ShapeSpace &ShS, Region &skelchunk, Sketch< bool > &skeleton, const Sketch< bool > &occlusions)
 Helper functions used by extractLine().
static Shape< LineDataoldSplitLine (ShapeSpace &ShS, Region &skelchunk, Sketch< bool > &skeleton, const Sketch< bool > &occlusions)
 Clears a line from a sketch.
static std::vector< Shape
< LineData > > 
oldExtractLines (Sketch< bool > const &sketch, int const num_lines=20)
 Clears a line from a sketch.
static std::vector< Shape
< LineData > > 
extractLines (Sketch< bool > const &sketch, int const num_lines=20)
 Clears a line from a sketch.
static std::vector< Shape
< LineData > > 
oldExtractLines (Sketch< bool > const &skel, Sketch< bool > const &occluders, int const num_lines=20)
 Clears a line from a sketch.
static std::vector< Shape
< LineData > > 
extractLines (Sketch< bool > const &skel, Sketch< bool > const &occluders, int const num_lines=20)
 Clears a line from a sketch.
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=-1)
static bool linesParallel (Shape< LineData > l1, Shape< LineData >l2)
 Clears a line from a sketch.

Rendering.



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.

Constructor & Destructor Documentation

LineData ( ShapeSpace _space,
const EndPoint p1,
const EndPoint p2 
)

Constructor.

Definition at line 39 of file LineData.h.

Referenced by LineData::extractLine().

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

Constructor.

Definition at line 35 of file LineData.cc.

LineData ( const LineData other  ) 

Copy constructor.

Definition at line 48 of file LineData.h.


Member Function Documentation

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

Transformations. (Virtual in BaseData.).

Apply a transformation to this shape.

Implements BaseData.

Definition at line 245 of file LineData.cc.

Referenced by TargetData::applyTransform().

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

Clears a line from a sketch.

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

Definition at line 1189 of file LineData.cc.

Referenced by LineData::scanHorizForEndPts().

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

Clears a line from a sketch.

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

Definition at line 1199 of file LineData.cc.

Referenced by LineData::scanVertForEndPts().

const EndPoint & bottomPt (  )  const

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 267 of file LineData.cc.

EndPoint & bottomPt (  ) 

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 266 of file LineData.cc.

Referenced by LineData::bottomPtShape(), and LineData::pointOnLine().

Shape< PointData > bottomPtShape (  ) 

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 293 of file LineData.cc.

void clearLine ( Sketch< bool > &  sketch  ) 

Clears a line from a sketch.

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

Definition at line 1289 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 a pointer to the sketch. This function does not link the Sketch<bool>* in the shape to the sketch returned.

Definition at line 1438 of file LineData.cc.

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

const EndPoint& end1Pt (  )  const

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 114 of file LineData.h.

const EndPoint& end2Pt (  )  const

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 115 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 852 of file LineData.cc.

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

Extracts most prominent line from a skeletonized image.

Definition at line 838 of file LineData.cc.

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

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

Clears a line from a sketch.

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

Definition at line 1257 of file LineData.cc.

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

Clears a line from a sketch.

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

Definition at line 1230 of file LineData.cc.

Referenced by PolygonData::extractPolygonEdges().

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

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 323 of file LineData.cc.

const EndPoint & firstPt (  )  const

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 312 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 301 of file LineData.cc.

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

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

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 387 of file LineData.cc.

coordinate_t firstPtCoord (  )  const

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 383 of file LineData.cc.

Referenced by LineData::updateParams().

Shape< PointData > firstPtShape (  ) 

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 367 of file LineData.cc.

BoundingBox2D getBoundingBox (  )  const [virtual]

Reimplemented from BaseData.

Definition at line 67 of file LineData.h.

Referenced by TargetData::getBoundingBox().

Point getCentroid (  )  const [virtual]
virtual unsigned short getDimension (  )  const [virtual]

Implements BaseData.

Definition at line 101 of file LineData.h.

float getLength (  )  const

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

Definition at line 152 of file LineData.h.

Referenced by PolygonData::isFirstLineLonger(), LineDataLengthLessThan::operator()(), LineData::printParams(), and TargetData::update_derived_properties().

AngPi getOrientation (  )  const

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

Definition at line 151 of file LineData.h.

Referenced by LineData::intersectionWithLine(), PolygonData::intersectsLine(), LineData::isBetween(), PolygonData::isInside(), LineData::isNotVertical(), and LineData::printParams().

Sketch< bool > & getRendering (  )  [virtual]

Update properties of the shape derived from endpoints or other basic parameters.

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 1302 of file LineData.cc.

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

float getRhoNorm (  )  const

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

Definition at line 149 of file LineData.h.

Referenced by LineData::extractLine().

static ShapeType_t getStaticType (  )  [static]

Definition at line 54 of file LineData.h.

AngTwoPi getThetaNorm (  )  const

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

Definition at line 150 of file LineData.h.

Referenced by LineData::extractLine().

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

Check to see if any endpoints are near any edge of the screen. If they are, invalidate them, assuming that line continues beyond screen.

Definition at line 1487 of file LineData.cc.

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

Definition at line 732 of file LineData.cc.

Point intersectionWithLine ( const LineData other  )  const

Definition at line 195 of file LineData.h.

Referenced by LineData::intersectionWithLine().

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

Definition at line 725 of file LineData.cc.

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

Definition at line 659 of file LineData.cc.

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

Definition at line 654 of file LineData.cc.

Referenced by PolygonData::intersectsLine(), and 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 200 of file LineData.cc.

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

Check if point falls between the two lines.

Definition at line 629 of file LineData.cc.

bool isLongerThan ( float  ref_length  )  const

Definition at line 620 of file LineData.cc.

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

Definition at line 617 of file LineData.cc.

bool isMatchFor ( const LineData other  )  const

Definition at line 91 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 82 of file LineData.cc.

Referenced by PolygonData::isClosed(), TargetData::isMatchFor(), and PolygonData::tryClosePolygon().

bool isNotVertical (  )  const

True if line orientation is far enough from vertical.

Definition at line 528 of file LineData.cc.

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

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

True if line orientation is far enough from vertical.

Definition at line 116 of file LineData.cc.

Referenced by LineData::isMatchFor().

bool isShorterThan ( float  ref_length  )  const

Definition at line 626 of file LineData.cc.

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

Definition at line 623 of file LineData.cc.

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

Definition at line 146 of file LineData.cc.

Referenced by LineData::updateParams().

const EndPoint & leftPt (  )  const

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 261 of file LineData.cc.

EndPoint & leftPt (  ) 

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 260 of file LineData.cc.

Referenced by LineData::leftPtShape(), and LineData::pointOnLine().

Shape< PointData > leftPtShape (  ) 

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 269 of file LineData.cc.

std::vector< float > lineEquation_abc (  )  const

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

Definition at line 474 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 436 of file LineData.cc.

Referenced by SphereData::projectToGround().

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

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

Definition at line 423 of file LineData.cc.

Referenced by LineData::intersectsLine().

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

Clears a line from a sketch.

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

Definition at line 1680 of file LineData.cc.

void mergeWith ( const ShapeRoot other  )  [virtual]

Definition at line 133 of file LineData.cc.

Referenced by TargetData::mergeWith().

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

Extracts most prominent line from a skeletonized image.

Definition at line 918 of file LineData.cc.

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

Extracts most prominent line from a skeletonized image.

Definition at line 845 of file LineData.cc.

Referenced by LineData::oldExtractLines(), and LineData::oldSplitLine().

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

Clears a line from a sketch.

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

Definition at line 1238 of file LineData.cc.

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

Clears a line from a sketch.

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

Definition at line 1222 of file LineData.cc.

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

Clears a line from a sketch.

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

Definition at line 1013 of file LineData.cc.

Referenced by LineData::oldExtractLine().

LineData & operator= ( const LineData other  ) 

Definition at line 1694 of file LineData.cc.

bool pointIsAbove ( const Point pt  )  const

Defined on Point, but will also work on PointData or Shape<PointData> due to type coercion.

Definition at line 589 of file LineData.cc.

bool pointIsBelow ( const Point pt  )  const

Defined on Point, but will also work on PointData or Shape<PointData> due to type coercion.

Definition at line 602 of file LineData.cc.

bool pointIsLeftOf ( const Point pt  )  const

Defined on Point, but will also work on PointData or Shape<PointData> due to type coercion.

Definition at line 563 of file LineData.cc.

bool pointIsRightOf ( const Point pt  )  const

Defined on Point, but will also work on PointData or Shape<PointData> due to type coercion.

Definition at line 576 of file LineData.cc.

bool pointOnLine ( const Point p  ) 

Definition at line 1722 of file LineData.cc.

bool pointsOnSameSide ( const Point p1,
const Point p2 
)

Definition at line 1709 of file LineData.cc.

void printEnds (  )  const

Definition at line 232 of file LineData.cc.

void printParams (  )  const [virtual]

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

Implements BaseData.

Definition at line 208 of file LineData.cc.

Referenced by LineData::intersectionWithLine(), and PolygonData::tryClosePolygon().

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

Project to ground.

Implements BaseData.

Definition at line 251 of file LineData.cc.

Referenced by TargetData::projectToGround().

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

Render into a sketch space and return reference.

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

Implements BaseData.

Definition at line 1312 of file LineData.cc.

Referenced by LineData::getRendering().

const EndPoint & rightPt (  )  const

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 263 of file LineData.cc.

EndPoint & rightPt (  ) 

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 262 of file LineData.cc.

Referenced by LineData::pointOnLine(), and LineData::rightPtShape().

Shape< PointData > rightPtShape (  ) 

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 277 of file LineData.cc.

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

Clears a line from a sketch.

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

Definition at line 1041 of file LineData.cc.

Referenced by LineData::extractLine().

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

Clears a line from a sketch.

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

Definition at line 1115 of file LineData.cc.

Referenced by LineData::extractLine().

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

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 356 of file LineData.cc.

const EndPoint & secondPt (  )  const

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 345 of file LineData.cc.

EndPoint & secondPt (  ) 

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 334 of file LineData.cc.

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

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

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 397 of file LineData.cc.

coordinate_t secondPtCoord (  )  const

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 393 of file LineData.cc.

Referenced by LineData::updateParams().

Shape< PointData > secondPtShape (  ) 

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 375 of file LineData.cc.

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 1332 of file LineData.cc.

Referenced by LineData::render().

void setEndPts ( const EndPoint _end1_pt,
const EndPoint _end2_pt 
)
void setInfinite ( bool  value = true  ) 

Makes endpoints inactive if value = true.

Definition at line 71 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 979 of file LineData.cc.

Referenced by LineData::extractLine().

const EndPoint & topPt (  )  const

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 265 of file LineData.cc.

EndPoint & topPt (  ) 

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 264 of file LineData.cc.

Referenced by LineData::pointOnLine(), and LineData::topPtShape().

Shape< PointData > topPtShape (  ) 

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 285 of file LineData.cc.

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

Definition at line 187 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 154 of file LineData.cc.

Referenced by TargetData::updateParams().


Friends And Related Function Documentation

friend class BlobData [friend]

Definition at line 33 of file LineData.h.

friend class PolygonData [friend]

Definition at line 32 of file LineData.h.

friend class Shape< LineData > [friend]

Definition at line 31 of file LineData.h.


Member Data Documentation

const float DEFAULT_MIN_LENGTH = 0.025f [static]

Min line length as a fraction of sketch width.

Definition at line 36 of file LineData.h.

Referenced by LineData::extractLines(), LineData::houghTransform(), and LineData::oldExtractLines().

const int extractorGapTolerance = 15 [static, private]

Definition at line 338 of file LineData.h.

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

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

Definition at line 29 of file LineData.h.

Referenced by LineData::update_derived_properties().


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

DualCoding 5.1CVS
Generated Fri Mar 16 05:23:52 2012 by Doxygen 1.6.3