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 (ShapeSpace &_space)
 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.
bool updateParams (const LineData &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.
void renderOnTo (Sketch< bool > *draw_result) const
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 LineData &otherline) const
EndPointsecondPt ()
const EndPointsecondPt () const
const EndPointsecondPt (const LineData &otherline) const
Shape< PointDatafirstPtShape ()
Shape< PointDatasecondPtShape ()
coordinate_t firstPtCoord () const
coordinate_t firstPtCoord (const LineData &otherline) const
coordinate_t secondPtCoord () const
coordinate_t secondPtCoord (const 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)

Static Public Attributes

static const int TSIZE = 180
 number of theta entries in Hough table
static const int RSIZE = 3000
 number of distance entries in Hough table; was 1600
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



static int const beg_dist_thresh = 2
 skel has to be this close to start a segment
static int const end_dist_thresh = 2
 how far line can extend past skel before giving up
static int const line_min_length = 15
 minimum x or y length in pixels
void clearLine (Sketch< bool > &sketch)
 Clears a line from a sketch.
int scanHorizForEndPts (const Sketch< uint > &skelDist, const Sketch< bool > &occlusions, float m, float b, int xstart)
 skel has to be this close to start a segment
int scanVertForEndPts (const Sketch< uint > &skelDist, const Sketch< bool > &occlusions, float m, float b, int ystart)
 skel has to be this close to start a segment
static Shape< LineDatasplitLine (ShapeSpace &ShS, Region &skelchunk, Sketch< bool > &skeleton, const Sketch< bool > &occlusions)
 Extracts most prominent line from a skeletonized image.
static bool pointsOnPerimeterOfWindow (Sketch< bool > const &sketch, double t, double r, Point &pt1, Point &pt2)
 skel has to be this close to start a segment
static double getScore (int t, int r, int height, short hough[TSIZE][RSIZE], float ptsArray[TSIZE][RSIZE])
 skel has to be this close to start a segment
static std::vector< Shape
< LineData > > 
houghExtractLines (Sketch< bool > const &sketch, Sketch< bool > const &occluders, const int num_lines)
 skel has to be this close to start a segment
static Shape< LineDataextractLine (Sketch< bool > &sketch)
 skel has to be this close to start a segment
static Shape< LineDataextractLine (Sketch< bool > &skelsketch, const Sketch< bool > &occlusions)
 skel has to be this close to start a segment
static std::vector< Shape
< LineData > > 
extractLines (Sketch< bool > const &sketch, int const num_lines=20)
 skel has to be this close to start a segment
static std::vector< Shape
< LineData > > 
extractLines (Sketch< bool > const &skel, Sketch< bool > const &occluders, int const num_lines=20)
 skel has to be this close to start a segment
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 > line1, Shape< LineData > line2)
 skel has to be this close to start a segment

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

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

Constructor.

Definition at line 38 of file LineData.cc.

LineData ( ShapeSpace _space  ) 

Constructor.

Definition at line 52 of file LineData.h.

LineData ( const LineData other  ) 

Copy constructor.

Definition at line 72 of file LineData.cc.


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

Referenced by TargetData::applyTransform().

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 289 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 288 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 315 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 1439 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 1595 of file LineData.cc.

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

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

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

skel has to be this close to start a segment

Definition at line 1068 of file LineData.cc.

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

skel has to be this close to start a segment

Definition at line 1060 of file LineData.cc.

Referenced by BrickData::extractBrick(), 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]

skel has to be this close to start a segment

Definition at line 1084 of file LineData.cc.

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

skel has to be this close to start a segment

Definition at line 1076 of file LineData.cc.

Referenced by PolygonData::extractPolygonEdges().

const EndPoint & firstPt ( const 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 345 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 334 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 323 of file LineData.cc.

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

coordinate_t firstPtCoord ( const 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 409 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 405 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 389 of file LineData.cc.

BoundingBox2D getBoundingBox (  )  const [virtual]

Reimplemented from BaseData.

Definition at line 74 of file LineData.h.

Referenced by TargetData::getBoundingBox().

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

Implements BaseData.

Definition at line 109 of file LineData.h.

float getLength (  )  const

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

Definition at line 160 of file LineData.h.

Referenced by CrossData::getArmSemiLength(), 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 159 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 1452 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 157 of file LineData.h.

double getScore ( int  t,
int  r,
int  height,
short  hough[TSIZE][RSIZE],
float  ptsArray[TSIZE][RSIZE] 
) [static]

skel has to be this close to start a segment

Definition at line 910 of file LineData.cc.

Referenced by LineData::houghExtractLines().

static ShapeType_t getStaticType (  )  [static]

Definition at line 61 of file LineData.h.

AngTwoPi getThetaNorm (  )  const

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

Definition at line 158 of file LineData.h.

vector< Shape< LineData > > houghExtractLines ( Sketch< bool > const &  sketch,
Sketch< bool > const &  occluders,
const int  num_lines 
) [static]

skel has to be this close to start a segment

Definition at line 925 of file LineData.cc.

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

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

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

Definition at line 754 of file LineData.cc.

Point intersectionWithLine ( const LineData other  )  const

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

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

Definition at line 681 of file LineData.cc.

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

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

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

Check if point falls between the two lines.

Definition at line 651 of file LineData.cc.

bool isLongerThan ( float  ref_length  )  const

Definition at line 642 of file LineData.cc.

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

Definition at line 639 of file LineData.cc.

bool isMatchFor ( const LineData other  )  const

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

Referenced by LineData::isMatchFor().

bool isShorterThan ( float  ref_length  )  const

Definition at line 648 of file LineData.cc.

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

Definition at line 645 of file LineData.cc.

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

Definition at line 163 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 283 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 282 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 291 of file LineData.cc.

std::vector< float > lineEquation_abc (  )  const

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

Definition at line 496 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 458 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 445 of file LineData.cc.

Referenced by LineData::intersectsLine().

bool linesParallel ( Shape< LineData line1,
Shape< LineData line2 
) [static]

skel has to be this close to start a segment

Definition at line 1832 of file LineData.cc.

void mergeWith ( const ShapeRoot other  )  [virtual]

Definition at line 146 of file LineData.cc.

Referenced by TargetData::mergeWith().

LineData & operator= ( const LineData other  ) 

Definition at line 1846 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 611 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 624 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 585 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 598 of file LineData.cc.

bool pointOnLine ( const Point p  ) 

Definition at line 1874 of file LineData.cc.

bool pointsOnPerimeterOfWindow ( Sketch< bool > const &  sketch,
double  t,
double  r,
Point pt1,
Point pt2 
) [static]

skel has to be this close to start a segment

Definition at line 861 of file LineData.cc.

Referenced by LineData::houghExtractLines().

bool pointsOnSameSide ( const Point p1,
const Point p2 
)

Definition at line 1861 of file LineData.cc.

void printEnds (  )  const

Definition at line 254 of file LineData.cc.

void printParams (  )  const [virtual]

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

Implements BaseData.

Definition at line 230 of file LineData.cc.

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

Project to ground.

Implements BaseData.

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

Referenced by LineData::getRendering().

void renderOnTo ( Sketch< bool > *  draw_result  )  const

Definition at line 1474 of file LineData.cc.

Referenced by LineData::render().

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

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

skel has to be this close to start a segment

Definition at line 1296 of file LineData.cc.

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

skel has to be this close to start a segment

Definition at line 1366 of file LineData.cc.

const EndPoint & secondPt ( const 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 378 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 367 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 356 of file LineData.cc.

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

coordinate_t secondPtCoord ( const 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 419 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 415 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 397 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 1487 of file LineData.cc.

Referenced by LineData::renderOnTo().

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

Makes endpoints inactive if value = true.

Definition at line 80 of file LineData.cc.

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

Extracts most prominent line from a skeletonized image.

Extracts most prominent line from a skeletonized image. It's often useful to use the original sketch as an occluder Helper functions used by extractLine().

Definition at line 1234 of file LineData.cc.

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 287 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 286 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 307 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 209 of file LineData.cc.

Referenced by LineData::updateParams().

bool updateParams ( const LineData other,
bool  force = false 
)

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

Definition at line 177 of file LineData.cc.

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

Referenced by TargetData::updateParams().


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.

friend class Shape< LineData > [friend]

Definition at line 35 of file LineData.h.


Member Data Documentation

int const beg_dist_thresh = 2 [static]

skel has to be this close to start a segment

Definition at line 249 of file LineData.h.

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

const float DEFAULT_MIN_LENGTH = 0.025f [static]

Min line length as a fraction of sketch width.

Definition at line 40 of file LineData.h.

Referenced by LineData::houghTransform().

int const end_dist_thresh = 2 [static]

how far line can extend past skel before giving up

Definition at line 250 of file LineData.h.

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

const int extractorGapTolerance = 15 [static, private]

Definition at line 363 of file LineData.h.

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

int const line_min_length = 15 [static]

minimum x or y length in pixels

Definition at line 251 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().

const int RSIZE = 3000 [static]

number of distance entries in Hough table; was 1600

Definition at line 23 of file LineData.h.

Referenced by LineData::houghExtractLines(), and LineData::pointsOnPerimeterOfWindow().

const int TSIZE = 180 [static]

number of theta entries in Hough table

Definition at line 22 of file LineData.h.

Referenced by LineData::houghExtractLines().


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