OpenCV for Unity
2.6.0
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.9.0/index.html ) for the details of the argument of the method.
|
Public Member Functions | |
Rect (int x, int y, int width, int height) | |
Rect () | |
Rect (Point p1, Point p2) | |
Rect (Point p, Size s) | |
Rect (double[] vals) | |
void | set (double[] vals) |
Rect | clone () |
Point | tl () |
Point | br () |
Size | size () |
double | area () |
bool | empty () |
bool | contains (Point p) |
override int | GetHashCode () |
override bool | Equals (Object obj) |
override string | ToString () |
bool | Equals (Rect a) |
bool | contains (int x, int y) |
bool | contains (Rect rect) |
void | inflate (int width, int height) |
void | inflate (Size size) |
Rect | intersect (Rect rect) |
bool | intersectsWith (Rect rect) |
Rect | union (Rect rect) |
Static Public Member Functions | |
static Rect | operator+ (Rect a, Point b) |
static Rect | operator+ (Rect a, Size b) |
static Rect | operator- (Rect a, Point b) |
static Rect | operator- (Rect a, Size b) |
static Rect | operator& (Rect a, Rect b) |
static Rect | operator| (Rect a, Rect b) |
static bool | operator== (Rect a, Rect b) |
static bool | operator!= (Rect a, Rect b) |
static Rect | inflate (Rect rect, int x, int y) |
static Rect | intersect (Rect a, Rect b) |
static Rect | union (Rect a, Rect b) |
Public Attributes | |
int | x |
template<typename _Tp> class CV_EXPORTS Rect_
// C++ code:
public:
typedef _Tp value_type;
//! various constructors
Rect_();
Rect_(_Tp _x, _Tp _y, _Tp _width, _Tp _height);
Rect_(const Rect_& r);
Rect_(const CvRect& r);
Rect_(const Point_<Tp>& org, const Size<_Tp>& sz);
Rect_(const Point_<Tp>& pt1, const Point<_Tp>& pt2);
Rect_& operator = (const Rect_& r);
//! the top-left corner
Point_<_Tp> tl() const;
//! the bottom-right corner
Point_<_Tp> br() const;
//! size (width, height) of the rectangle
Size_<_Tp> size() const;
//! area (width*height) of the rectangle
_Tp area() const;
//! conversion to another data type
template<typename _Tp2> operator Rect_<_Tp2>() const;
//! conversion to the old-style CvRect
operator CvRect() const;
//! checks whether the rectangle contains the point
bool contains(const Point_<_Tp>& pt) const;
_Tp x, y, width, height; //< the top-left corner, as well as width and height of the rectangle
};
Template class for 2D rectangles, described by the following parameters:
Rect_.x
and Rect_.y
in OpenCV. Though, in your algorithms you may count x
and y
from the bottom-left corner. OpenCV typically assumes that the top and left boundary of the rectangle are inclusive, while the right and bottom boundaries are not. For example, the method Rect_.contains
returns true
if
x <= pt.x < x+width,<BR>y <= pt.y < y+height
Virtually every loop over an imageROI in OpenCV (where ROI is specified by Rect_<int>
) is implemented as:
// C++ code:
for(int y = roi.y; y < roi.y + rect.height; y++)
for(int x = roi.x; x < roi.x + rect.width; x++)
//...
In addition to the class members, the following operations on rectangles are implemented:
rect += point, rect -= point, rect += size, rect -= size
(augmenting operations) rect = rect1 & rect2
(rectangle intersection) rect = rect1 | rect2
(minimum area rectangle containing rect2
and rect3
) rect &= rect1, rect |= rect1
(and the corresponding augmenting operations) rect == rect1, rect != rect1
(rectangle comparison) This is an example how the partial ordering on rectangles can be established (rect1subseteq rect2):
// C++ code:
template<typename _Tp> inline bool
operator <= (const Rect_<Tp>& r1, const Rect<_Tp>& r2)
return (r1 & r2) == r1;
For your convenience, the
Rect_<>
alias is available:
typedef Rect_<int> Rect;
OpenCVForUnity.CoreModule.Rect.Rect | ( | int | x, |
int | y, | ||
int | width, | ||
int | height | ||
) |
OpenCVForUnity.CoreModule.Rect.Rect | ( | ) |
OpenCVForUnity.CoreModule.Rect.Rect | ( | double [] | vals | ) |
double OpenCVForUnity.CoreModule.Rect.area | ( | ) |
Point OpenCVForUnity.CoreModule.Rect.br | ( | ) |
Rect OpenCVForUnity.CoreModule.Rect.clone | ( | ) |
bool OpenCVForUnity.CoreModule.Rect.contains | ( | int | x, |
int | y | ||
) |
bool OpenCVForUnity.CoreModule.Rect.contains | ( | Rect | rect | ) |
bool OpenCVForUnity.CoreModule.Rect.contains | ( | Point | p | ) |
bool OpenCVForUnity.CoreModule.Rect.empty | ( | ) |
bool OpenCVForUnity.CoreModule.Rect.Equals | ( | Rect | a | ) |
override bool OpenCVForUnity.CoreModule.Rect.Equals | ( | Object | obj | ) |
override int OpenCVForUnity.CoreModule.Rect.GetHashCode | ( | ) |
void OpenCVForUnity.CoreModule.Rect.inflate | ( | int | width, |
int | height | ||
) |
void OpenCVForUnity.CoreModule.Rect.inflate | ( | Size | size | ) |
bool OpenCVForUnity.CoreModule.Rect.intersectsWith | ( | Rect | rect | ) |
void OpenCVForUnity.CoreModule.Rect.set | ( | double [] | vals | ) |
Size OpenCVForUnity.CoreModule.Rect.size | ( | ) |
Point OpenCVForUnity.CoreModule.Rect.tl | ( | ) |
override string OpenCVForUnity.CoreModule.Rect.ToString | ( | ) |
int OpenCVForUnity.CoreModule.Rect.x |