Click or drag to resize

Cv2.Rectangle Method (InputOutputArray, Point, Point, Scalar, Int32, LineTypes, Int32)

Draws simple, thick or filled rectangle

Namespace:  OpenCvSharp
Assembly:  OpenCvSharp (in OpenCvSharp.dll) Version: 3.4.1.20180605-33-CaRLSharp
Syntax
public static void Rectangle(
	InputOutputArray img,
	Point pt1,
	Point pt2,
	Scalar color,
	int thickness = 1,
	LineTypes lineType = LineTypes.Link8,
	int shift = 0
)

Parameters

img
Type: OpenCvSharp.InputOutputArray
Image.
pt1
Type: OpenCvSharp.Point
One of the rectangle vertices.
pt2
Type: OpenCvSharp.Point
Opposite rectangle vertex.
color
Type: OpenCvSharp.Scalar
Line color (RGB) or brightness (grayscale image).
thickness (Optional)
Type: System.Int32
Thickness of lines that make up the rectangle. Negative values make the function to draw a filled rectangle. [By default this is 1]
lineType (Optional)
Type: OpenCvSharp.LineTypes
Type of the line, see cvLine description. [By default this is LineType.Link8]
shift (Optional)
Type: System.Int32
Number of fractional bits in the point coordinates. [By default this is 0]
See Also