OpenCV 4.13.0
Open Source Computer Vision
読み込み中...
検索中...
見つかりません
🤖 AIによる機械翻訳(非公式) — これは OpenCV 4.13.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
cv::Point_< _Tp > クラステンプレート

座標 xy で指定される2次元の点のテンプレートクラス。 続き...

#include <opencv2/core/types.hpp>

Collaboration diagram for cv::Point_< _Tp >:

公開型

typedef _Tp value_type
 

公開メンバ関数

 Point_ ()
 デフォルトコンストラクタ
 
 Point_ (_Tp _x, _Tp _y)
 
 Point_ (const Point_ &pt)=default
 
 Point_ (const Size_< _Tp > &sz)
 
 Point_ (const Vec< _Tp, 2 > &v)
 
 Point_ (Point_ &&pt) CV_NOEXCEPT=default
 
double cross (const Point_ &pt) const
 外積
 
double ddot (const Point_ &pt) const
 倍精度演算で計算される内積。
 
_Tp dot (const Point_ &pt) const
 内積
 
bool inside (const Rect_< _Tp > &r) const
 点が指定された矩形の内部にあるかどうかをチェックする
 
template<typename _Tp2 >
 operator Point_< _Tp2 > () const
 別のデータ型への変換。
 
 operator Vec< _Tp, 2 > () const
 旧スタイルのC構造体への変換
 
Point_operator= (const Point_ &pt)=default
 
Point_operator= (Point_ &&pt) CV_NOEXCEPT=default
 

公開変数類

_Tp x
 点のx座標
 
_Tp y
 点のy座標
 

詳細説明

template<typename _Tp>
class cv::Point_< _Tp >

座標 xy で指定される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;
double value = norm(pt); // L2 norm
pt1 == pt2;
pt1 != pt2;
double norm(InputArray src1, int normType=NORM_L2, InputArray mask=noArray())
Calculates the absolute norm of an array.

利便性のため、次の型エイリアスが定義されている。

typedef Point2i Point;
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);
Point pt = (a + b)*10.f;
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

型定義メンバ詳解

◆ value_type

template<typename _Tp >
_Tp cv::Point_< _Tp >::value_type

構築子と解体子の詳解

◆ Point_() [1/6]

template<typename _Tp >
cv::Point_< _Tp >::Point_ ( )

デフォルトコンストラクタ

◆ Point_() [2/6]

template<typename _Tp >
cv::Point_< _Tp >::Point_ ( _Tp _x,
_Tp _y )

◆ Point_() [3/6]

template<typename _Tp >
cv::Point_< _Tp >::Point_ ( const Point_< _Tp > & pt)
default

◆ Point_() [4/6]

template<typename _Tp >
cv::Point_< _Tp >::Point_ ( Point_< _Tp > && pt)
default

◆ Point_() [5/6]

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

◆ Point_() [6/6]

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

メンバ関数詳解

◆ cross()

template<typename _Tp >
double cv::Point_< _Tp >::cross ( const Point_< _Tp > & pt) const

外積

◆ ddot()

template<typename _Tp >
double cv::Point_< _Tp >::ddot ( const Point_< _Tp > & pt) const

倍精度演算で計算される内積

◆ dot()

template<typename _Tp >
_Tp cv::Point_< _Tp >::dot ( const Point_< _Tp > & pt) const

内積

◆ inside()

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

点が指定された矩形の内部にあるかどうかをチェックする

◆ operator Point_< _Tp2 >()

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

別のデータ型への変換。

◆ operator Vec< _Tp, 2 >()

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

旧スタイルのC構造体への変換

◆ operator=() [1/2]

template<typename _Tp >
Point_ & cv::Point_< _Tp >::operator= ( const Point_< _Tp > & pt)
default

◆ operator=() [2/2]

template<typename _Tp >
Point_ & cv::Point_< _Tp >::operator= ( Point_< _Tp > && pt)
default

メンバ変数詳解

◆ x

template<typename _Tp >
_Tp cv::Point_< _Tp >::x

点のx座標

◆ y

template<typename _Tp >
_Tp cv::Point_< _Tp >::y

点のy座標


このクラス詳解は次のファイルから抽出されました: