OpenCV for Unity  2.3.0
Enox Software / Please refer to OpenCV official document( for the details of the argument of the method.
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
OpenCVForUnity.Point Class Reference
Inheritance diagram for OpenCVForUnity.Point:

Public Member Functions

 Point (double x, double y)
 Point ()
 Point (double[] vals)
void set (double[] vals)
Point clone ()
double dot (Point p)
override int GetHashCode ()
override bool Equals (Object obj)
bool inside (Rect r)
override string ToString ()
bool Equals (Point a)

Static Public Member Functions

static Point operator- (Point a)
static Point operator+ (Point a, Point b)
static Point operator- (Point a, Point b)
static Point operator* (Point a, double b)
static Point operator* (double a, Point b)
static Point operator/ (Point a, double b)
static bool operator== (Point a, Point b)
static bool operator!= (Point a, Point b)

Public Attributes

double x

Detailed Description

template<typename _Tp> class CV_EXPORTS Point_

// C++ code:


typedef _Tp value_type;

// various constructors


Point_(_Tp _x, _Tp _y);

Point_(const Point_& pt);

Point_(const CvPoint& pt);

Point_(const CvPoint2D32f& pt);

Point_(const Size_<_Tp>& sz);

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

Point_& operator = (const Point_& pt);

//! conversion to another data type

template<typename _Tp2> operator Point_<_Tp2>() const;

//! conversion to the old-style C structures

operator CvPoint() const;

operator CvPoint2D32f() const;

operator Vec<_Tp, 2>() const;

//! dot product

_Tp dot(const Point_& pt) const;

//! dot product computed in double-precision arithmetics

double ddot(const Point_& pt) const;

//! cross-product

double cross(const Point_& pt) const;

//! checks whether the point is inside the specified rectangle

bool inside(const Rect_<_Tp>& r) const;

_Tp x, y; //< the point coordinates


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 thisoperation for each of the coordinates. Besides the class members listed in the declaration above, the following operations on points are implemented:

// C++ code:

pt1 = pt2 + pt3;

pt1 = pt2 - pt3;

pt1 = pt2 * a;

pt1 = a * pt2;

pt1 += pt2;

pt1 -= pt2;

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;


Point2f a(0.3f, 0.f), b(0.f, 0.4f);

Point pt = (a + b)*10.f;

cout << pt.x << ", " << pt.y << endl;

See also

Constructor & Destructor Documentation

OpenCVForUnity.Point.Point ( double  x,
double  y 
OpenCVForUnity.Point.Point ( )
OpenCVForUnity.Point.Point ( double[]  vals)

Member Function Documentation

Point OpenCVForUnity.Point.clone ( )
double ( Point  p)
override bool OpenCVForUnity.Point.Equals ( Object  obj)
bool OpenCVForUnity.Point.Equals ( Point  a)
override int OpenCVForUnity.Point.GetHashCode ( )
bool OpenCVForUnity.Point.inside ( Rect  r)
static bool OpenCVForUnity.Point.operator!= ( Point  a,
Point  b 
static Point OpenCVForUnity.Point.operator* ( Point  a,
double  b 
static Point OpenCVForUnity.Point.operator* ( double  a,
Point  b 
static Point OpenCVForUnity.Point.operator+ ( Point  a,
Point  b 
static Point OpenCVForUnity.Point.operator- ( Point  a)
static Point OpenCVForUnity.Point.operator- ( Point  a,
Point  b 
static Point OpenCVForUnity.Point.operator/ ( Point  a,
double  b 
static bool OpenCVForUnity.Point.operator== ( Point  a,
Point  b 
void OpenCVForUnity.Point.set ( double[]  vals)
override string OpenCVForUnity.Point.ToString ( )

Member Data Documentation

double OpenCVForUnity.Point.x

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