Class cv::Point_#

Template class for 2D points specified by its coordinates x and y. View details

Collaboration diagram for cv::Point_:

Detailed Description#

Template class for 2D points specified by its coordinates x and y.

An instance of the class is interchangeable with C structures, CvPoint and CvPoint2D32f . There is also a cast operator to convert point coordinates to the specified type. The conversion from floating-point coordinates to integer coordinates is done by rounding. Commonly, the conversion uses this operation for each of the coordinates. Besides the class members listed in the declaration above, the following operations on points are implemented:

pt1 = pt2 + pt3;
pt1 = pt2 - pt3;
pt1 = pt2 * a;
pt1 = a * pt2;
pt1 = pt2 / a;
pt1 += pt2;
pt1 -= pt2;
pt1 *= a;
pt1 /= a;
double value = norm(pt); // L2 norm
pt1 == pt2;
pt1 != pt2;
For your convenience, the following type aliases are defined:
typedef Point_<int> Point2i;
typedef Point2i Point;
typedef Point_<float> Point2f;
typedef Point_<double> Point2d;
Example:
Point2f a(0.3f, 0.f), b(0.f, 0.4f);
Point pt = (a + b)*10.f;
cout << pt.x << ", " << pt.y << endl;

Member Typedef Documentation#

value_type#

typedef Tp cv::Point::value_type

Constructor & Destructor Documentation#

Point_()#

cv::Point_::Point_()

default constructor

Point_()#

cv::Point_::Point_(
_Tp _x,
_Tp _y )

Point_()#

cv::Point_::Point_(const Point_ & pt)

Point_()#

cv::Point_::Point_(const Size_< _Tp > & sz)

Point_()#

cv::Point_::Point_(const Vec< _Tp, 2 > & v)

Point_()#

cv::Point_::Point_(Point_ && pt)

Member Function Documentation#

cross()#

double cv::Point_::cross(const Point_ & pt)

cross-product

ddot()#

double cv::Point_::ddot(const Point_ & pt)

dot product computed in double-precision arithmetics

dot()#

Tp cv::Point::dot(const Point_ & pt)

dot product

inside()#

bool cv::Point_::inside(const Rect_< _Tp > & r)

checks whether the point is inside the specified rectangle

operator Point_< _Tp2 >()#

template<typename _Tp2>
cv::Point_::operator Point_< _Tp2 >()

conversion to another data type

operator Vec< _Tp, 2 >()#

cv::Point_::operator Vec< _Tp, 2 >()

conversion to the old-style C structures

operator=()#

Point_ & cv::Point_::operator=(const Point_ & pt)

operator=()#

Point_ & cv::Point_::operator=(Point_ && pt)

Member Data Documentation#

x#

Tp cv::Point::x

x coordinate of the point

y#

Tp cv::Point::y

y coordinate of the point

Source file#

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