Class Point2D

Inheritance Relationships

Base Type

  • public cv::Vec< double, 3 >

Derived Type

Class Documentation

class Point2D : public cv::Vec<double, 3>

class to represent a point using homogeneous coordinates [x, y, 1]

Subclassed by tuw::Polar2D

Public Functions

Point2D()

constructor

Point2D(const cv::Point &p)

constructor

Parameters:

p – source

Point2D(double x, double y)

constructor

Parameters:
  • x

  • y

Point2D(double x, double y, double h)

constructor

Parameters:
  • x

  • y

  • h

Point2D(const Polar2D &p)

constructor

Parameters:

p

template<typename T>
inline Point2D(const cv::Vec<T, 3> &p)
template<typename T>
inline Point2D(const cv::Vec<T, 2> &p)
template<typename T>
inline Point2D(const cv::Point_<T> &p)
Point2D &set(const Point2D &p)

sets values

Parameters:

p

Returns:

this reference

Point2D &set(double x, double y)

sets values

Parameters:
  • x

  • y

Returns:

this reference

Point2D &set(double x, double y, double h)

sets values

Parameters:
  • x

  • y

Returns:

this reference

const double &x() const

translational x component

translational x component

Returns:

x component

Returns:

rotation

double &x()

translational x component

translational x component

Returns:

x component

Returns:

rotation

const double &y() const

translational y component

Returns:

y component

double &y()

translational y component

Returns:

y component

const double &h() const

homogeneous component

Returns:

rotation

double &h()

homogeneous component

Returns:

rotation

void set_x(double v)

set funktion for x

Parameters:

x – component

double get_x() const

get function for x

Returns:

x component

void set_y(double v)

set funktion for y

Parameters:

y – component

double get_y() const

get function for y

Returns:

y component

void set_h(double v)

set funktion for h

Parameters:

h – component

double get_h() const

get function for h

Returns:

h component

double angle() const

angle form origin to point (alpha in polar space)

See also

radius

See also

Polar2D

Returns:

angle between -PI and +PI

double radius() const

distance to origin (rho in polar space)

See also

angle

See also

Polar2D

Returns:

distance

cv::Vec<double, 2> vector() const

vector without homogeneous component

Returns:

state vector

double distanceTo(const Point2D &p) const

returns the distance to an other point

returns the distance to an other point

Parameters:

p

Returns:

disance

Returns:

disance

double distanceTo(double x, double y) const

returns the distance to an other point

returns the distance to an other point

Parameters:
  • x

  • y

Returns:

disance

Returns:

disance

const cv::Point_<double> &cv() const

returns a cv::Point_<double> reference

Returns:

cv

cv::Point_<double> &cv()

returns a cv::Point_<double> reference

Returns:

cv

cv::Point &to(cv::Point &des) const

copy to cv::Point

Parameters:

des

Returns:

cv::Point to des reference

cv::Point &to(cv::Point &des)

copy to cv::Point

Parameters:

des

Returns:

cv::Point to des reference

cv::Point p() const

returns a cv::Point

returns a cv::Point reference

Returns:

cv

Returns:

cv

cv::Point p()

returns a cv::Point

returns a cv::Point reference

Returns:

cv

Returns:

cv

bool inside(double x0, double y0, double x1, double y1) const

checks if a point is within a rectangle

Parameters:
  • x0 – top left x

  • y0 – top left y

  • x1 – bottom right x

  • y1 – bottom right y

Returns:

true if inside

std::string str(const char *format = "[%6.4lf, %6.4lf, %6.5lf]") const

returns x and y as formated string

Parameters:

format – using printf format

Returns:

string

bool equal(const Point2D &o, double tolerance = 0.0001) const

compares with within tolerance

Parameters:
  • o

  • tolerance

Friends

inline friend std::ostream &operator<<(std::ostream &os, const Point2D &o)

Stream extraction

Parameters:
  • os – outputstream

  • o – object

Returns:

stream