Skip to content

boxPoints

geometryfunctionOpenCV 5.0.0
import { boxPoints } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSbox
FUNCTIONboxPoints
RETURN TYPE[Point2f, Point2f, Point2f, Point2f]
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Finds the four vertices of a rotated rect. Useful to draw the rotated rectangle.

The function finds the four vertices of a rotated rectangle. The four vertices are returned in clockwise order starting from the point with greatest y. If two points have the same y coordinate the rightmost is the starting point. This function is useful to draw the rectangle. In C++, instead of using this function, you can directly use RotatedRect::points method. Please visit the tutorial_bounding_rotated_ellipses "tutorial on Creating Bounding rotated boxes and ellipses for contours" for more information.

boxPoints(box: RotatedRect): [Point2f, Point2f, Point2f, Point2f];
box

The input rotated rectangle. It may be the output of minAreaRect.

Returns

The [Point2f, Point2f, Point2f, Point2f] result.

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.