rectangle
import { rectangle } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Draws a simple, thick, or filled up-right rectangle.
The function cv::rectangle draws a rectangle outline or a filled rectangle whose two opposite corners are pt1 and pt2.
rectangle(img: Mat, pt1: Point, pt2: Point, color: Scalar, thickness: number, lineType: number, shift: number): void;4 available overloads
rectangle(img: Mat, pt1: Point, pt2: Point, color: Scalar): void;rectangle(img: Mat, pt1: Point, pt2: Point, color: Scalar, thickness: number): void;rectangle(img: Mat, pt1: Point, pt2: Point, color: Scalar, thickness: number, lineType: number): void;rectangle(img: Mat, pt1: Point, pt2: Point, color: Scalar, thickness: number, lineType: number, shift: number): void;imgInput/output value, modified by the native operation. Image.
pt1Vertex of the rectangle.
pt2Vertex of the rectangle opposite to pt1 .
colorRectangle color or brightness (grayscale image).
thicknessThickness of lines that make up the rectangle. Negative values, like #FILLED, mean that the function has to draw a filled rectangle.
lineTypeType of the line. See #LineTypes
shiftNumber of fractional bits in the point coordinates.
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.