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;
预定义:
1 typedef Point_ Point2i;2 typedef Point2i Point;3 typedef Point_Point2f;4 typedef Point_ Point2d;
Point3_(3维点类)
2、Size_
1 _Tp width, height;2 typedef Size_ Size2i;3 typedef Size2i Size;4 typedef Size_Size2f;
3、Rect_
1 _Tp x, y, width, height;2 typedef Rect_ Rect;
运算:
- (平移)
- (放缩)
- rect = rect1 & rect2 (矩形交集)
- rect = rect1 | rect2 (包含两矩形的最小区域 )
- rect == rect1, rect != rect1 (比较)
4. RotatedRect
Point2f center; Size2f size; float angle;
5、Vec
1 typedef VecVec2b; 2 typedef Vec Vec3b; 3 typedef Vec Vec4b; 4 5 typedef Vec Vec2s; 6 typedef Vec Vec3s; 7 typedef Vec Vec4s; 8 9 typedef Vec Vec2i;10 typedef Vec Vec3i;11 typedef Vec Vec4i;12 13 typedef Vec Vec2f;14 typedef Vec Vec3f;15 typedef Vec Vec4f;16 typedef Vec Vec6f;17 18 typedef Vec Vec2d;19 typedef Vec Vec3d;20 21 typedef Vec Vec4d;22 typedef Vec Vec6d;
6、Scalar_
1 templateclass Scalar_ : public Vec<_Tp, 4>2 {3 Scalar_(_Tp v0, _Tp v1, _Tp v2=0, _Tp v3=0);4 Scalar_(const CvScalar& s);5 Scalar_(_Tp v0);6 static Scalar_<_Tp> all(_Tp v0);7 }8 9 typedef Scalar_ Scalar;
7、Range
1 class Range 2 { 3 public: 4 Range(); 5 Range(int _start, int _end); 6 Range(const CvSlice& slice); 7 int size() const; 8 bool empty() const; 9 static Range all();10 operator CvSlice() const;11 12 int start, end;13 };