Openv2.1基本数据类型

1、Point_

template<typename _Tp> class Point_

{_Tp x, y;}

可使用的运算:

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;

预定义:

 typedef Point_<int> Point2i;
typedef Point2i Point;
typedef Point_<float> Point2f;
typedef Point_<double> Point2d;

Point3_(3维点类)

2、Size_

 _Tp width, height;
typedef Size_<int> Size2i;
typedef Size2i Size;
typedef Size_<float> Size2f;

3、Rect_

 _Tp x, y, width, height;
typedef Rect_<int> Rect;

Openv2.1基本数据类型

运算:

  • Openv2.1基本数据类型 (平移)
  • Openv2.1基本数据类型 (放缩)
  • rect = rect1 & rect2 (矩形交集)
  • rect = rect1 | rect2 (包含两矩形的最小区域 )
  • rect == rect1, rect != rect1 (比较)

4. RotatedRect

Point2f  center;  Size2f  size;  float  angle;

5、Vec

 typedef Vec<uchar, > Vec2b;
typedef Vec<uchar, > Vec3b;
typedef Vec<uchar, > Vec4b; typedef Vec<short, > Vec2s;
typedef Vec<short, > Vec3s;
typedef Vec<short, > Vec4s; typedef Vec<int, > Vec2i;
typedef Vec<int, > Vec3i;
typedef Vec<int, > Vec4i; typedef Vec<float, > Vec2f;
typedef Vec<float, > Vec3f;
typedef Vec<float, > Vec4f;
typedef Vec<float, > Vec6f; typedef Vec<double, > Vec2d;
typedef Vec<double, > Vec3d; typedef Vec<double, > Vec4d;
typedef Vec<double, > Vec6d;

6、Scalar_

 template<typename _Tp> class Scalar_ : public Vec<_Tp, >
{
Scalar_(_Tp v0, _Tp v1, _Tp v2=, _Tp v3=);
Scalar_(const CvScalar& s);
Scalar_(_Tp v0);
static Scalar_<_Tp> all(_Tp v0);
} typedef Scalar_<double> Scalar;

7、Range

 class Range
{
public:
Range();
Range(int _start, int _end);
Range(const CvSlice& slice);
int size() const;
bool empty() const;
static Range all();
operator CvSlice() const; int start, end;
};
上一篇:node.js中对 mysql 进行增删改查等操作和async,await处理


下一篇:记录一次追查server死机& 登录异常情况