转自https://www.cnblogs.com/fdd566/p/6638115.html
转自http://blog.csdn.net/kh1445291129/article/details/51149849
- rect.area();
- rect.size();
- rect.tl();
- rect.br();
- rect.width();
- rect.height();
- rect.contains(Point(x, y));
-
- rect = rect1 & rect2;
- rect = rect1 | rect2;
-
- rect = rect + Point(-100, 100);
- rect = rect + Size(-100, 100);
-
- rect1 == rect2;
- rect1 != rect2;
-
- bool isInside(Rect rect1, Rect rect2)
- {
- return (rect1 == (rect1&rect2));
- }
-
- Point getCenterPoint(Rect rect)
- {
- Point cpt;
- cpt.x = rect.x + cvRound(rect.width/2.0);
- cpt.y = rect.y + cvRound(rect.height/2.0);
- return cpt;
- }
-
- Rect rectCenterScale(Rect rect, Size size)
- {
- rect = rect + size;
- Point pt;
- pt.x = cvRound(size.width/2.0);
- pt.y = cvRound(size.height/2.0);
- return (rect-pt);
- }