Class Line2D

Class Documentation

class Line2D

A 2D line.

Public Functions

Line2D() = default
Line2D(float k, float b)
Line2D(const Segment &seg)
Line2D(float dx, float dy, const cv::Point2f &p)
Line2D(const cv::Point2f &p1, const cv::Point2f &p2)
float GetLineCoordinate(const cv::Point2f &p)

getLineCoordinate Get the coordinate of a point on this line. With 0 corresponding to the point on a line that is perpendicular to the line and passing through the origin

Parameters:

p

Returns:

cv::Point2f GetPointOfCoordinate(float coord)

The inverse of getLineCoordinate.

cv::Point2f IntersectionWidth(const Line2D &line) const

Compute the point where two lines intersect, or (-1,0) if the lines are.

inline float dx() const
inline float dy() const
inline float x() const
inline float y() const
inline const cv::Point2f &p() const

Public Static Functions

static Line2D LsqFitXyw(const std::vector<cv::Point3f> &xyw)

Protected Functions

void NormalizeSlope()
void NormalizeP()