OpenCV for Unity 2.6.5
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.10.0/index.html ) for the details of the argument of the method.
Loading...
Searching...
No Matches
OpenCVForUnity.CoreModule.Rect Class Reference

Template class for 2D rectangles. More...

Public Member Functions

 Rect ()
 
 Rect (double[] vals)
 
 Rect (in Vec4i vals)
 
 Rect (in(int x, int y, int width, int height) vals)
 
 Rect (int x, int y, int width, int height)
 
 Rect (Point p, Size s)
 
 Rect (Point p1, Point p2)
 
double area ()
 
Point br ()
 
double double y brAsValueTuple ()
 
Vec2d brAsVec2d ()
 
Rect clone ()
 
int int int int height cloneAsValueTuple ()
 
Vec4i cloneAsVec4i ()
 
bool contains (in Vec2d p)
 
bool contains (in Vec4i rect)
 
bool contains (in(double x, double y) p)
 
bool contains (in(int x, int y, int width, int height) rect)
 
bool contains (int x, int y)
 
bool contains (Point p)
 
bool contains (Rect rect)
 
bool empty ()
 
override bool Equals (Object obj)
 
bool Equals (Rect a)
 
override int GetHashCode ()
 
void inflate (in Vec2d size)
 Expands the rectangle by decreasing its position and increasing its size by the specified width and height.
 
void inflate (in(double width, double height) size)
 Expands the rectangle by decreasing its position and increasing its size by the specified width and height.
 
void inflate (int width, int height)
 Expands the rectangle by decreasing its position and increasing its size by the specified width and height.
 
void inflate (Size size)
 Expands the rectangle by decreasing its position and increasing its size by the specified width and height.
 
Rect intersect (Rect rect)
 Computes the intersection of the current rectangle with the specified rectangle.
 
int int int int height intersectAsValueTuple (in(int x, int y, int width, int height) rect)
 
Vec4i intersectAsVec4i (in Vec4i rect)
 Computes the intersection of the current rectangle with the specified rectangle.
 
bool intersectsWith (in Vec4i rect)
 Determines whether the current rectangle intersects with the specified rectangle.
 
bool intersectsWith (in(int x, int y, int width, int height) rect)
 Determines whether the current rectangle intersects with the specified rectangle.
 
bool intersectsWith (Rect rect)
 Determines whether the current rectangle intersects with the specified rectangle.
 
void set (double[] vals)
 
void set (in Vec4i vals)
 
void set (in(int x, int y, int width, int height) vals)
 
Size size ()
 
double double height sizeAsValueTuple ()
 
Vec2d sizeAsVec2d ()
 
Point tl ()
 
double double y tlAsValueTuple ()
 
Vec2d tlAsVec2d ()
 
UnityEngine.RectInt ToRectInt ()
 
override string ToString ()
 
int int int int height ToValueTuple ()
 
Vec4i ToVec4i ()
 
int int int int height union (in(int x, int y, int width, int height) rect)
 
Rect union (Rect rect)
 Returns a new rectangle that represents the union of the current rectangle and the specified rectangle.
 
Vec4i unionAsVec4i (in Vec4i rect)
 Returns a new rectangle that represents the union of the current rectangle and the specified rectangle.
 

Static Public Member Functions

static Rect inflate (Rect rect, int x, int y)
 Expands the specified rectangle by decreasing its position and increasing its size by the specified amounts.
 
static int int int int height inflateAsValueTuple (in(int x, int y, int width, int height) rect, int x, int y)
 
static Vec4i inflateAsVec4i (in Vec4i rect, int x, int y)
 Expands the specified rectangle by decreasing its position and increasing its size by the specified amounts.
 
static Rect intersect (Rect a, Rect b)
 Computes the intersection of two rectangles.
 
static int int int int height intersectAsValueTuple (in(int x, int y, int width, int height) a, in(int x, int y, int width, int height) b)
 
static Vec4i intersectAsVec4i (in Vec4i a, in Vec4i b)
 Computes the intersection of two rectangles.
 
static operator (int x, int y, int width, int height)(Rect rect)
 
static operator Rect (in(int x, int y, int width, int height) valueTuple)
 
static operator UnityEngine.RectInt (Rect rect)
 
static operator Vec4i (Rect rect)
 
static bool operator!= (Rect a, Rect b)
 
static Rect operator& (Rect a, Rect b)
 
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 bool operator== (Rect a, Rect b)
 
static Rect operator| (Rect a, Rect b)
 
static int int int int height union (in(int x, int y, int width, int height) a, in(int x, int y, int width, int height) b)
 
static Rect union (Rect a, Rect b)
 Returns a new rectangle that represents the union of two specified rectangles.
 
static Vec4i unionAsVec4i (in Vec4i a, in Vec4i b)
 Returns a new rectangle that represents the union of two specified rectangles.
 

Public Attributes

int height
 
int width
 
int int int width
 
double width
 
int x
 Computes the intersection of the current rectangle with the specified rectangle.
 
double x
 
int y
 
int int y
 

Static Public Attributes

static int int int width
 
static int x
 Expands the specified rectangle by decreasing its position and increasing its size by the specified amounts.
 
static int int y
 

Detailed Description

Template class for 2D rectangles.

Described by the following parameters:

  • Coordinates of the top-left corner. This is a default interpretation of Rect_::x and Rect_::y in OpenCV. Though, in your algorithms you may count x and y from the bottom-left corner.
  • Rectangle width and height.

OpenCV typically assumes that the top and left boundary of the rectangle are inclusive, while the right and bottom boundaries are not.

C++: cv::Rect_<_Tp> Class Template Reference

See also
https://docs.opencv.org/4.10.0/d2/d44/classcv_1_1Rect__.html

Constructor & Destructor Documentation

◆ Rect() [1/7]

OpenCVForUnity.CoreModule.Rect.Rect ( int x,
int y,
int width,
int height )

◆ Rect() [2/7]

OpenCVForUnity.CoreModule.Rect.Rect ( )

default constructor

◆ Rect() [3/7]

OpenCVForUnity.CoreModule.Rect.Rect ( Point p1,
Point p2 )

◆ Rect() [4/7]

OpenCVForUnity.CoreModule.Rect.Rect ( Point p,
Size s )

◆ Rect() [5/7]

OpenCVForUnity.CoreModule.Rect.Rect ( double[] vals)

◆ Rect() [6/7]

OpenCVForUnity.CoreModule.Rect.Rect ( in Vec4i vals)

◆ Rect() [7/7]

OpenCVForUnity.CoreModule.Rect.Rect ( in(int x, int y, int width, int height) vals)

Member Function Documentation

◆ area()

double OpenCVForUnity.CoreModule.Rect.area ( )

area (width*height) of the rectangle

◆ br()

Point OpenCVForUnity.CoreModule.Rect.br ( )

the bottom-right corner

◆ brAsValueTuple()

double double y OpenCVForUnity.CoreModule.Rect.brAsValueTuple ( )

◆ brAsVec2d()

Vec2d OpenCVForUnity.CoreModule.Rect.brAsVec2d ( )

the bottom-right corner

◆ clone()

Rect OpenCVForUnity.CoreModule.Rect.clone ( )

◆ cloneAsValueTuple()

int int int int height OpenCVForUnity.CoreModule.Rect.cloneAsValueTuple ( )

◆ cloneAsVec4i()

Vec4i OpenCVForUnity.CoreModule.Rect.cloneAsVec4i ( )

◆ contains() [1/7]

bool OpenCVForUnity.CoreModule.Rect.contains ( in Vec2d p)

checks whether the rectangle contains the point

◆ contains() [2/7]

bool OpenCVForUnity.CoreModule.Rect.contains ( in Vec4i rect)

checks whether the rectangle contains the point

◆ contains() [3/7]

bool OpenCVForUnity.CoreModule.Rect.contains ( in(double x, double y) p)

checks whether the rectangle contains the point

◆ contains() [4/7]

bool OpenCVForUnity.CoreModule.Rect.contains ( in(int x, int y, int width, int height) rect)

checks whether the rectangle contains the point

◆ contains() [5/7]

bool OpenCVForUnity.CoreModule.Rect.contains ( int x,
int y )

checks whether the rectangle contains the point

◆ contains() [6/7]

bool OpenCVForUnity.CoreModule.Rect.contains ( Point p)

checks whether the rectangle contains the point

◆ contains() [7/7]

bool OpenCVForUnity.CoreModule.Rect.contains ( Rect rect)

checks whether the rectangle contains the point

◆ empty()

bool OpenCVForUnity.CoreModule.Rect.empty ( )

true if empty

◆ Equals() [1/2]

override bool OpenCVForUnity.CoreModule.Rect.Equals ( Object obj)

◆ Equals() [2/2]

bool OpenCVForUnity.CoreModule.Rect.Equals ( Rect a)

◆ GetHashCode()

override int OpenCVForUnity.CoreModule.Rect.GetHashCode ( )

◆ inflate() [1/5]

void OpenCVForUnity.CoreModule.Rect.inflate ( in Vec2d size)

Expands the rectangle by decreasing its position and increasing its size by the specified width and height.

Parameters
widthThe amount to decrease the x-coordinate and increase the width.
heightThe amount to decrease the y-coordinate and increase the height.

◆ inflate() [2/5]

void OpenCVForUnity.CoreModule.Rect.inflate ( in(double width, double height) size)

Expands the rectangle by decreasing its position and increasing its size by the specified width and height.

Parameters
widthThe amount to decrease the x-coordinate and increase the width.
heightThe amount to decrease the y-coordinate and increase the height.

◆ inflate() [3/5]

void OpenCVForUnity.CoreModule.Rect.inflate ( int width,
int height )

Expands the rectangle by decreasing its position and increasing its size by the specified width and height.

Parameters
widthThe amount to decrease the x-coordinate and increase the width.
heightThe amount to decrease the y-coordinate and increase the height.

◆ inflate() [4/5]

static Rect OpenCVForUnity.CoreModule.Rect.inflate ( Rect rect,
int x,
int y )
static

Expands the specified rectangle by decreasing its position and increasing its size by the specified amounts.

Parameters
rectThe rectangle to be expanded.
xThe amount to decrease the x-coordinate and increase the width.
yThe amount to decrease the y-coordinate and increase the height.
Returns
The expanded rectangle.

◆ inflate() [5/5]

void OpenCVForUnity.CoreModule.Rect.inflate ( Size size)

Expands the rectangle by decreasing its position and increasing its size by the specified width and height.

Parameters
widthThe amount to decrease the x-coordinate and increase the width.
heightThe amount to decrease the y-coordinate and increase the height.

◆ inflateAsValueTuple()

static int int int int height OpenCVForUnity.CoreModule.Rect.inflateAsValueTuple ( in(int x, int y, int width, int height) rect,
int x,
int y )
static

◆ inflateAsVec4i()

static Vec4i OpenCVForUnity.CoreModule.Rect.inflateAsVec4i ( in Vec4i rect,
int x,
int y )
static

Expands the specified rectangle by decreasing its position and increasing its size by the specified amounts.

Parameters
rectThe rectangle to be expanded.
xThe amount to decrease the x-coordinate and increase the width.
yThe amount to decrease the y-coordinate and increase the height.
Returns
The expanded rectangle.

◆ intersect() [1/2]

static Rect OpenCVForUnity.CoreModule.Rect.intersect ( Rect a,
Rect b )
static

Computes the intersection of two rectangles.

Parameters
aThe first rectangle.
bThe second rectangle.
Returns
A rectangle representing the overlapping area of the two rectangles. If the rectangles do not overlap, an empty rectangle is returned.

◆ intersect() [2/2]

Rect OpenCVForUnity.CoreModule.Rect.intersect ( Rect rect)

Computes the intersection of the current rectangle with the specified rectangle.

Parameters
rectThe rectangle to intersect with the current rectangle.
Returns
A rectangle representing the overlapping area of the two rectangles. If the rectangles do not overlap, an empty rectangle is returned.

◆ intersectAsValueTuple() [1/2]

static int int int int height OpenCVForUnity.CoreModule.Rect.intersectAsValueTuple ( in(int x, int y, int width, int height) a,
in(int x, int y, int width, int height) b )
static

◆ intersectAsValueTuple() [2/2]

int int int int height OpenCVForUnity.CoreModule.Rect.intersectAsValueTuple ( in(int x, int y, int width, int height) rect)

◆ intersectAsVec4i() [1/2]

static Vec4i OpenCVForUnity.CoreModule.Rect.intersectAsVec4i ( in Vec4i a,
in Vec4i b )
static

Computes the intersection of two rectangles.

Parameters
aThe first rectangle.
bThe second rectangle.
Returns
A rectangle representing the overlapping area of the two rectangles. If the rectangles do not overlap, an empty rectangle is returned.

◆ intersectAsVec4i() [2/2]

Vec4i OpenCVForUnity.CoreModule.Rect.intersectAsVec4i ( in Vec4i rect)

Computes the intersection of the current rectangle with the specified rectangle.

Parameters
rectThe rectangle to intersect with the current rectangle.
Returns
A rectangle representing the overlapping area of the two rectangles. If the rectangles do not overlap, an empty rectangle is returned.

◆ intersectsWith() [1/3]

bool OpenCVForUnity.CoreModule.Rect.intersectsWith ( in Vec4i rect)

Determines whether the current rectangle intersects with the specified rectangle.

Parameters
rectThe rectangle to check for intersection with the current rectangle.
Returns
true if the rectangles intersect; otherwise, false.

◆ intersectsWith() [2/3]

bool OpenCVForUnity.CoreModule.Rect.intersectsWith ( in(int x, int y, int width, int height) rect)

Determines whether the current rectangle intersects with the specified rectangle.

Parameters
rectThe rectangle to check for intersection with the current rectangle.
Returns
true if the rectangles intersect; otherwise, false.

◆ intersectsWith() [3/3]

bool OpenCVForUnity.CoreModule.Rect.intersectsWith ( Rect rect)

Determines whether the current rectangle intersects with the specified rectangle.

Parameters
rectThe rectangle to check for intersection with the current rectangle.
Returns
true if the rectangles intersect; otherwise, false.

◆ operator()

static OpenCVForUnity.CoreModule.Rect.operator ( int x,
int y,
int width,
int height )
explicitstatic

◆ operator Rect()

static OpenCVForUnity.CoreModule.Rect.operator Rect ( in(int x, int y, int width, int height) valueTuple)
explicitstatic

◆ operator UnityEngine.RectInt()

static OpenCVForUnity.CoreModule.Rect.operator UnityEngine.RectInt ( Rect rect)
explicitstatic

◆ operator Vec4i()

static OpenCVForUnity.CoreModule.Rect.operator Vec4i ( Rect rect)
explicitstatic

◆ operator!=()

static bool OpenCVForUnity.CoreModule.Rect.operator!= ( Rect a,
Rect b )
static

◆ operator&()

◆ operator+() [1/2]

◆ operator+() [2/2]

◆ operator-() [1/2]

◆ operator-() [2/2]

◆ operator==()

static bool OpenCVForUnity.CoreModule.Rect.operator== ( Rect a,
Rect b )
static

◆ operator|()

◆ set() [1/3]

void OpenCVForUnity.CoreModule.Rect.set ( double[] vals)

◆ set() [2/3]

void OpenCVForUnity.CoreModule.Rect.set ( in Vec4i vals)

◆ set() [3/3]

void OpenCVForUnity.CoreModule.Rect.set ( in(int x, int y, int width, int height) vals)

◆ size()

Size OpenCVForUnity.CoreModule.Rect.size ( )

size (width, height) of the rectangle

◆ sizeAsValueTuple()

double double height OpenCVForUnity.CoreModule.Rect.sizeAsValueTuple ( )

◆ sizeAsVec2d()

Vec2d OpenCVForUnity.CoreModule.Rect.sizeAsVec2d ( )

size (width, height) of the rectangle

◆ tl()

Point OpenCVForUnity.CoreModule.Rect.tl ( )

the top-left corner

◆ tlAsValueTuple()

double double y OpenCVForUnity.CoreModule.Rect.tlAsValueTuple ( )

◆ tlAsVec2d()

Vec2d OpenCVForUnity.CoreModule.Rect.tlAsVec2d ( )

the top-left corner

◆ ToRectInt()

UnityEngine.RectInt OpenCVForUnity.CoreModule.Rect.ToRectInt ( )

◆ ToString()

override string OpenCVForUnity.CoreModule.Rect.ToString ( )

◆ ToValueTuple()

int int int int height OpenCVForUnity.CoreModule.Rect.ToValueTuple ( )

◆ ToVec4i()

Vec4i OpenCVForUnity.CoreModule.Rect.ToVec4i ( )

◆ union() [1/4]

static int int int int height OpenCVForUnity.CoreModule.Rect.union ( in(int x, int y, int width, int height) a,
in(int x, int y, int width, int height) b )
static

◆ union() [2/4]

int int int int height OpenCVForUnity.CoreModule.Rect.union ( in(int x, int y, int width, int height) rect)

◆ union() [3/4]

static Rect OpenCVForUnity.CoreModule.Rect.union ( Rect a,
Rect b )
static

Returns a new rectangle that represents the union of two specified rectangles.

Parameters
aThe first rectangle to union.
bThe second rectangle to union.
Returns
A new Rect that represents the smallest rectangle that can contain both a and b .

◆ union() [4/4]

Rect OpenCVForUnity.CoreModule.Rect.union ( Rect rect)

Returns a new rectangle that represents the union of the current rectangle and the specified rectangle.

Parameters
rectThe rectangle to combine with the current rectangle.
Returns
A new Rect that represents the smallest rectangle that can contain both the current rectangle and the specified rectangle.

◆ unionAsVec4i() [1/2]

static Vec4i OpenCVForUnity.CoreModule.Rect.unionAsVec4i ( in Vec4i a,
in Vec4i b )
static

Returns a new rectangle that represents the union of two specified rectangles.

Parameters
aThe first rectangle to union.
bThe second rectangle to union.
Returns
A new Rect that represents the smallest rectangle that can contain both a and b .

◆ unionAsVec4i() [2/2]

Vec4i OpenCVForUnity.CoreModule.Rect.unionAsVec4i ( in Vec4i rect)

Returns a new rectangle that represents the union of the current rectangle and the specified rectangle.

Parameters
rectThe rectangle to combine with the current rectangle.
Returns
A new Rect that represents the smallest rectangle that can contain both the current rectangle and the specified rectangle.

Member Data Documentation

◆ height

int OpenCVForUnity.CoreModule.Rect.height

height of the rectangle

◆ width [1/4]

static int int int OpenCVForUnity.CoreModule.Rect.width

width of the rectangle

◆ width [2/4]

int int int OpenCVForUnity.CoreModule.Rect.width

◆ width [3/4]

double OpenCVForUnity.CoreModule.Rect.width

size (width, height) of the rectangle

◆ width [4/4]

int int int OpenCVForUnity.CoreModule.Rect.width
static

◆ x [1/3]

static int OpenCVForUnity.CoreModule.Rect.x

Computes the intersection of the current rectangle with the specified rectangle.

Returns a new rectangle that represents the union of two specified rectangles.

Computes the intersection of two rectangles.

Returns a new rectangle that represents the union of the current rectangle and the specified rectangle.

x coordinate of the top-left corner

Parameters
rectThe rectangle to intersect with the current rectangle.
Returns
A rectangle representing the overlapping area of the two rectangles. If the rectangles do not overlap, an empty rectangle is returned.
Parameters
rectThe rectangle to combine with the current rectangle.
Returns
A new Rect that represents the smallest rectangle that can contain both the current rectangle and the specified rectangle.

the bottom-right corner

Parameters
aThe first rectangle.
bThe second rectangle.
Returns
A rectangle representing the overlapping area of the two rectangles. If the rectangles do not overlap, an empty rectangle is returned.
Parameters
aThe first rectangle to union.
bThe second rectangle to union.
Returns
A new Rect that represents the smallest rectangle that can contain both a and b .

◆ x [2/3]

double OpenCVForUnity.CoreModule.Rect.x

the top-left corner

the bottom-right corner

◆ x [3/3]

int OpenCVForUnity.CoreModule.Rect.x
static

Expands the specified rectangle by decreasing its position and increasing its size by the specified amounts.

Returns a new rectangle that represents the union of two specified rectangles.

Computes the intersection of two rectangles.

Parameters
rectThe rectangle to be expanded.
xThe amount to decrease the x-coordinate and increase the width.
yThe amount to decrease the y-coordinate and increase the height.
Returns
The expanded rectangle.
Parameters
aThe first rectangle.
bThe second rectangle.
Returns
A rectangle representing the overlapping area of the two rectangles. If the rectangles do not overlap, an empty rectangle is returned.
Parameters
aThe first rectangle to union.
bThe second rectangle to union.
Returns
A new Rect that represents the smallest rectangle that can contain both a and b .

◆ y [1/3]

static int int OpenCVForUnity.CoreModule.Rect.y

y coordinate of the top-left corner

◆ y [2/3]

int int OpenCVForUnity.CoreModule.Rect.y

◆ y [3/3]

int int OpenCVForUnity.CoreModule.Rect.y
static

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