template<typename
_Tp>
class cv::Point_< _Tp >
座標 x と y で指定される2次元の点のテンプレートクラス。
このクラスのインスタンスは、C構造体である CvPoint および CvPoint2D32f と相互に交換可能である。また、点の座標を指定した型に変換するキャスト演算子もある。浮動小数点座標から整数座標への変換は丸めによって行われる。一般に、この変換は各座標に対してこの操作を使用する。上記の宣言に列挙されているクラスメンバーに加えて、点に対する次の演算が実装されている。
pt1 = pt2 + pt3;
pt1 = pt2 - pt3;
pt1 = pt2 * a;
pt1 = a * pt2;
pt1 = pt2 / a;
pt1 += pt2;
pt1 -= pt2;
pt1 *= a;
pt1 /= a;
pt1 == pt2;
pt1 != pt2;
double norm(InputArray src1, int normType=NORM_L2, InputArray mask=noArray())
Calculates the absolute norm of an array.
利便性のため、次の型エイリアスが定義されている。
Template class for 2D points specified by its coordinates x and y.
Definition types.hpp:163
Point_< int > Point2i
Definition types.hpp:205
Point2i Point
Definition types.hpp:209
Point_< double > Point2d
Definition types.hpp:208
Point_< float > Point2f
Definition types.hpp:207
例:
Point2f a(0.3f, 0.f), b(0.f, 0.4f);
cout << pt.
x <<
", " << pt.
y << endl;
_Tp y
y coordinate of the point
Definition types.hpp:202
_Tp x
x coordinate of the point
Definition types.hpp:201