OpenCV for Unity 2.6.3
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.Rect2d Class Reference

Template class for 2D rectangles. More...

Inheritance diagram for OpenCVForUnity.CoreModule.Rect2d:

Public Member Functions

 Rect2d (double x, double y, double width, double height)
 
 Rect2d ()
 
 Rect2d (Point p1, Point p2)
 
 Rect2d (Point p, Size s)
 
 Rect2d (double[] vals)
 
void set (double[] vals)
 
Rect2d 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 ()
 
 Rect2d (in Vec4d vals)
 
 Rect2d (in(double x, double y, double width, double height) vals)
 
void set (in Vec4d vals)
 
void set (in(double x, double y, double width, double height) vals)
 
Vec4d cloneAsVec4d ()
 
double double double double height cloneAsValueTuple ()
 
Vec2d tlAsVec2d ()
 
double double y tlAsValueTuple ()
 
Vec2d brAsVec2d ()
 
double double y brAsValueTuple ()
 
Vec2d sizeAsVec2d ()
 
double double height sizeAsValueTuple ()
 
bool contains (double x, double y)
 
bool contains (in Vec2d p)
 
bool contains (in(double x, double y) p)
 
double double double double height ToValueTuple ()
 
Vec4d ToVec4d ()
 
bool contains (Rect2d rect)
 
bool contains (in Vec4d rect)
 
bool contains (in(double x, double y, double width, double height) rect)
 
void inflate (double width, double 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.
 
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.
 
Rect2d intersect (Rect2d rect)
 Computes the intersection of the current rectangle with the specified rectangle.
 
Vec4d intersectAsVec4d (in Vec4d rect)
 Computes the intersection of the current rectangle with the specified rectangle.
 
double double double double height intersectAsValueTuple (in(double x, double y, double width, double height) rect)
 
bool intersectsWith (Rect2d rect)
 Determines whether the current rectangle intersects with the specified rectangle.
 
bool intersectsWith (in Vec4d rect)
 Determines whether the current rectangle intersects with the specified rectangle.
 
bool intersectsWith (in(double x, double y, double width, double height) rect)
 Determines whether the current rectangle intersects with the specified rectangle.
 
Rect2d union (Rect2d rect)
 Returns a new rectangle that represents the union of the current rectangle and the specified rectangle.
 
Vec4d unionAsVec4d (in Vec4d rect)
 Returns a new rectangle that represents the union of the current rectangle and the specified rectangle.
 
double double double double height union (in(double x, double y, double width, double height) rect)
 
bool Equals (Rect2d a)
 

Static Public Member Functions

static operator Vec4d (Rect2d rect)
 
static operator (double x, double y, double width, double height)(Rect2d rect)
 
static operator Rect2d (in(double x, double y, double width, double height) valueTuple)
 
static Rect2d inflate (Rect2d rect, double x, double y)
 Expands the specified rectangle by decreasing its position and increasing its size by the specified amounts.
 
static Vec4d inflateAsVec4d (in Vec4d rect, double x, double y)
 Expands the specified rectangle by decreasing its position and increasing its size by the specified amounts.
 
static double double double double height inflateAsValueTuple (in(double x, double y, double width, double height) rect, double x, double y)
 
static Rect2d intersect (Rect2d a, Rect2d b)
 Computes the intersection of two rectangles.
 
static Vec4d intersectAsVec4d (in Vec4d a, in Vec4d b)
 Computes the intersection of two rectangles.
 
static double double double double height intersectAsValueTuple (in(double x, double y, double width, double height) a, in(double x, double y, double width, double height) b)
 
static Rect2d union (Rect2d a, Rect2d b)
 Returns a new rectangle that represents the union of two specified rectangles.
 
static Vec4d unionAsVec4d (in Vec4d a, in Vec4d b)
 Returns a new rectangle that represents the union of two specified rectangles.
 
static double double double double height unionAsValueTuple (in(double x, double y, double width, double height) a, in(double x, double y, double width, double height) b)
 
static Rect2d operator+ (Rect2d a, Point b)
 
static Rect2d operator+ (Rect2d a, Size b)
 
static Rect2d operator- (Rect2d a, Point b)
 
static Rect2d operator- (Rect2d a, Size b)
 
static Rect2d operator& (Rect2d a, Rect2d b)
 
static Rect2d operator| (Rect2d a, Rect2d b)
 
static bool operator== (Rect2d a, Rect2d b)
 
static bool operator!= (Rect2d a, Rect2d b)
 

Public Attributes

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

Static Public Attributes

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

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

◆ Rect2d() [1/7]

OpenCVForUnity.CoreModule.Rect2d.Rect2d ( double x,
double y,
double width,
double height )

◆ Rect2d() [2/7]

OpenCVForUnity.CoreModule.Rect2d.Rect2d ( )

default constructor

◆ Rect2d() [3/7]

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

◆ Rect2d() [4/7]

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

◆ Rect2d() [5/7]

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

◆ Rect2d() [6/7]

OpenCVForUnity.CoreModule.Rect2d.Rect2d ( in Vec4d vals)

◆ Rect2d() [7/7]

OpenCVForUnity.CoreModule.Rect2d.Rect2d ( in(double x, double y, double width, double height) vals)

Member Function Documentation

◆ area()

double OpenCVForUnity.CoreModule.Rect2d.area ( )

area (width*height) of the rectangle

◆ br()

Point OpenCVForUnity.CoreModule.Rect2d.br ( )

the bottom-right corner

◆ brAsValueTuple()

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

◆ brAsVec2d()

Vec2d OpenCVForUnity.CoreModule.Rect2d.brAsVec2d ( )

the bottom-right corner

◆ clone()

Rect2d OpenCVForUnity.CoreModule.Rect2d.clone ( )

◆ cloneAsValueTuple()

double double double double height OpenCVForUnity.CoreModule.Rect2d.cloneAsValueTuple ( )

◆ cloneAsVec4d()

Vec4d OpenCVForUnity.CoreModule.Rect2d.cloneAsVec4d ( )

◆ contains() [1/7]

bool OpenCVForUnity.CoreModule.Rect2d.contains ( double x,
double y )

checks whether the rectangle contains the point

◆ contains() [2/7]

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

checks whether the rectangle contains the point

◆ contains() [3/7]

bool OpenCVForUnity.CoreModule.Rect2d.contains ( in Vec4d rect)

checks whether the rectangle contains the point

◆ contains() [4/7]

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

checks whether the rectangle contains the point

◆ contains() [5/7]

bool OpenCVForUnity.CoreModule.Rect2d.contains ( in(double x, double y, double width, double height) rect)

checks whether the rectangle contains the point

◆ contains() [6/7]

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

checks whether the rectangle contains the point

◆ contains() [7/7]

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

checks whether the rectangle contains the point

◆ empty()

bool OpenCVForUnity.CoreModule.Rect2d.empty ( )

true if empty

◆ Equals() [1/2]

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

◆ Equals() [2/2]

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

◆ GetHashCode()

override int OpenCVForUnity.CoreModule.Rect2d.GetHashCode ( )

◆ inflate() [1/5]

void OpenCVForUnity.CoreModule.Rect2d.inflate ( double width,
double 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() [2/5]

void OpenCVForUnity.CoreModule.Rect2d.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() [3/5]

void OpenCVForUnity.CoreModule.Rect2d.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() [4/5]

static Rect2d OpenCVForUnity.CoreModule.Rect2d.inflate ( Rect2d rect,
double x,
double 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.Rect2d.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 double double double double height OpenCVForUnity.CoreModule.Rect2d.inflateAsValueTuple ( in(double x, double y, double width, double height) rect,
double x,
double y )
static

◆ inflateAsVec4d()

static Vec4d OpenCVForUnity.CoreModule.Rect2d.inflateAsVec4d ( in Vec4d rect,
double x,
double 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 Rect2d OpenCVForUnity.CoreModule.Rect2d.intersect ( Rect2d a,
Rect2d 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]

Rect2d OpenCVForUnity.CoreModule.Rect2d.intersect ( Rect2d 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 double double double double height OpenCVForUnity.CoreModule.Rect2d.intersectAsValueTuple ( in(double x, double y, double width, double height) a,
in(double x, double y, double width, double height) b )
static

◆ intersectAsValueTuple() [2/2]

double double double double height OpenCVForUnity.CoreModule.Rect2d.intersectAsValueTuple ( in(double x, double y, double width, double height) rect)

◆ intersectAsVec4d() [1/2]

static Vec4d OpenCVForUnity.CoreModule.Rect2d.intersectAsVec4d ( in Vec4d a,
in Vec4d 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.

◆ intersectAsVec4d() [2/2]

Vec4d OpenCVForUnity.CoreModule.Rect2d.intersectAsVec4d ( in Vec4d 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.Rect2d.intersectsWith ( in Vec4d 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.Rect2d.intersectsWith ( in(double x, double y, double width, double 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.Rect2d.intersectsWith ( Rect2d 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.Rect2d.operator ( double x,
double y,
double width,
double height )
explicitstatic

◆ operator Rect2d()

static OpenCVForUnity.CoreModule.Rect2d.operator Rect2d ( in(double x, double y, double width, double height) valueTuple)
explicitstatic

◆ operator Vec4d()

◆ operator!=()

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

◆ operator&()

◆ operator+() [1/2]

◆ operator+() [2/2]

◆ operator-() [1/2]

◆ operator-() [2/2]

◆ operator==()

◆ operator|()

◆ set() [1/3]

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

◆ set() [2/3]

void OpenCVForUnity.CoreModule.Rect2d.set ( in Vec4d vals)

◆ set() [3/3]

void OpenCVForUnity.CoreModule.Rect2d.set ( in(double x, double y, double width, double height) vals)

◆ size()

Size OpenCVForUnity.CoreModule.Rect2d.size ( )

size (width, height) of the rectangle

◆ sizeAsValueTuple()

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

◆ sizeAsVec2d()

Vec2d OpenCVForUnity.CoreModule.Rect2d.sizeAsVec2d ( )

size (width, height) of the rectangle

◆ tl()

Point OpenCVForUnity.CoreModule.Rect2d.tl ( )

the top-left corner

◆ tlAsValueTuple()

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

◆ tlAsVec2d()

Vec2d OpenCVForUnity.CoreModule.Rect2d.tlAsVec2d ( )

the top-left corner

◆ ToString()

override String OpenCVForUnity.CoreModule.Rect2d.ToString ( )

◆ ToValueTuple()

double double double double height OpenCVForUnity.CoreModule.Rect2d.ToValueTuple ( )

◆ ToVec4d()

Vec4d OpenCVForUnity.CoreModule.Rect2d.ToVec4d ( )

◆ union() [1/3]

double double double double height OpenCVForUnity.CoreModule.Rect2d.union ( in(double x, double y, double width, double height) rect)

◆ union() [2/3]

static Rect2d OpenCVForUnity.CoreModule.Rect2d.union ( Rect2d a,
Rect2d 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 Rect2d that represents the smallest rectangle that can contain both a and b .

◆ union() [3/3]

Rect2d OpenCVForUnity.CoreModule.Rect2d.union ( Rect2d 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 Rect2d that represents the smallest rectangle that can contain both the current rectangle and the specified rectangle.

◆ unionAsValueTuple()

static double double double double height OpenCVForUnity.CoreModule.Rect2d.unionAsValueTuple ( in(double x, double y, double width, double height) a,
in(double x, double y, double width, double height) b )
static

◆ unionAsVec4d() [1/2]

static Vec4d OpenCVForUnity.CoreModule.Rect2d.unionAsVec4d ( in Vec4d a,
in Vec4d 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 Rect2d that represents the smallest rectangle that can contain both a and b .

◆ unionAsVec4d() [2/2]

Vec4d OpenCVForUnity.CoreModule.Rect2d.unionAsVec4d ( in Vec4d 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 Rect2d that represents the smallest rectangle that can contain both the current rectangle and the specified rectangle.

Member Data Documentation

◆ height

double OpenCVForUnity.CoreModule.Rect2d.height

height of the rectangle

◆ width [1/3]

static double double double OpenCVForUnity.CoreModule.Rect2d.width

width of the rectangle

size (width, height) of the rectangle

◆ width [2/3]

double double double OpenCVForUnity.CoreModule.Rect2d.width

◆ width [3/3]

double double double OpenCVForUnity.CoreModule.Rect2d.width
static

◆ x [1/2]

static double OpenCVForUnity.CoreModule.Rect2d.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

the top-left corner

the bottom-right 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 Rect2d that represents the smallest rectangle that can contain both the current rectangle and the specified 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 Rect2d that represents the smallest rectangle that can contain both a and b .

◆ x [2/2]

double OpenCVForUnity.CoreModule.Rect2d.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 Rect2d that represents the smallest rectangle that can contain both a and b .

◆ y [1/3]

static double double OpenCVForUnity.CoreModule.Rect2d.y

y coordinate of the top-left corner

◆ y [2/3]

double double OpenCVForUnity.CoreModule.Rect2d.y

◆ y [3/3]

double double OpenCVForUnity.CoreModule.Rect2d.y
static

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