opencv on mbed
Point_< _Tp > Class Template Reference
[Basic structures]
Template class for 2D points specified by its coordinates `x` and `y`. More...
#include <types.hpp>
Public Member Functions | |
template<typename _Tp2 > | |
operator Point_< _Tp2 > () const | |
conversion to another data type | |
operator Vec< _Tp, 2 > () const | |
conversion to the old-style C structures | |
_Tp | dot (const Point_ &pt) const |
dot product | |
double | ddot (const Point_ &pt) const |
dot product computed in double-precision arithmetics | |
double | cross (const Point_ &pt) const |
cross-product | |
bool | inside (const Rect_< _Tp > &r) const |
checks whether the point is inside the specified rectangle |
Detailed Description
template<typename _Tp>
class cv::Point_< _Tp >
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;
Definition at line 147 of file types.hpp.
Member Function Documentation
double cross | ( | const Point_< _Tp > & | pt ) | const |
cross-product
double ddot | ( | const Point_< _Tp > & | pt ) | const |
dot product computed in double-precision arithmetics
_Tp dot | ( | const Point_< _Tp > & | pt ) | const |
dot product
bool inside | ( | const Rect_< _Tp > & | r ) | const |
checks whether the point is inside the specified rectangle
operator Point_< _Tp2 > | ( | ) | const |
conversion to another data type
operator Vec< _Tp, 2 > | ( | ) | const |
conversion to the old-style C structures
Generated on Tue Jul 12 2022 16:42:43 by 1.7.2