5 #include <opencv2/core/core.hpp> 19 class Point2D :
public cv::Vec<double, 3 > {
47 Point2D (
double x,
double y,
double h );
53 template<
typename T>
Point2D (
const cv::Vec<T,3> &p ) :
cv::Vec<double,3> ( p ) {};
54 template<
typename T>
Point2D (
const cv::Vec<T,2> &p ) :
cv::Vec<double,3> ( p ) {};
55 template<
typename T>
Point2D (
const cv::Point_<T> &p ) :
cv::Vec<double,3> ( p.x,p.y,1. ) {};
75 const double &
x ()
const;
85 const double &
y ()
const;
95 const double &
h ()
const;
105 void set_x (
double v);
110 double get_x ()
const;
115 void set_y (
double v);
120 double get_y ()
const;
125 void set_h (
double v);
130 double get_h ()
const;
137 double angle ()
const;
149 cv::Vec<double, 2>
vector ()
const;
159 const cv::Point_<double> &
cv ()
const;
164 cv::Point_<double> &
cv () ;
173 bool inside (
double x0,
double y0,
double x1,
double y1 )
const;
181 os <<
"[" << o.
x() <<
", " << o.
y() <<
"]";
189 std::string
str(
const char*
format =
"[%6.4lf, %6.4lf, %6.5lf]")
const;
196 bool equal(
const Point2D& o,
double tolerance = 0.0001 )
const ;
210 Matx<_Tp, 3, 1> c ( a, b, Matx_MatMulOp() );
bool inside(double x0, double y0, double x1, double y1) const
cv::Vec< double, 2 > vector() const
bool equal(const Point2D &o, double tolerance=0.0001) const
friend std::ostream & operator<<(std::ostream &os, const Point2D &o)
std::shared_ptr< Point2D const > Point2DConstPtr
static tuw::Point2D operator*(const Matx< _Tp, 3, 3 > &a, const tuw::Point2D &b)
double distanceTo(const Point2D &p) const
std::shared_ptr< Point2D > Point2DPtr
std::string str(const char *format="[%6.4lf, %6.4lf, %6.5lf]") const
std::string format(const cv::Mat_< int8_t > &m)
Point2D(const cv::Vec< T, 2 > &p)
Point2D(const cv::Point_< T > &p)
Point2D(const cv::Vec< T, 3 > &p)
const cv::Point_< double > & cv() const