Skip to content

ellipse1

Image processingfunctionOpenCV 5.0.0
import { ellipse1 } from '@banou/opencv-wasm'

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

ARGUMENTSimg, box, color, thickness
FUNCTIONellipse1
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Draws a simple or thick elliptic arc or fills an ellipse sector.

The function cv::ellipse with more parameters draws an ellipse outline, a filled ellipse, an elliptic arc, or a filled ellipse sector. The drawing code uses general parametric form. A piecewise-linear curve is used to approximate the elliptic arc boundary. If you need more control of the ellipse rendering, you can retrieve the curve using #ellipse2Poly and then render it with #polylines or fill it with #fillPoly. If you use the first variant of the function and want to draw the whole ellipse, not an arc, pass startAngle=0 and endAngle=360. If startAngle is greater than endAngle, they are swapped. The figure below explains the meaning of the parameters to draw the blue arc.

Parameters of Elliptic Arc

ellipse1(img: Mat, box: RotatedRect, color: Scalar, thickness: number, lineType: number): void;
3 available overloads
ellipse1(img: Mat, box: RotatedRect, color: Scalar): void;
ellipse1(img: Mat, box: RotatedRect, color: Scalar, thickness: number): void;
ellipse1(img: Mat, box: RotatedRect, color: Scalar, thickness: number, lineType: number): void;
img

Input/output value, modified by the native operation. Image.

box

Alternative ellipse representation via RotatedRect. This means that the function draws an ellipse inscribed in the rotated rectangle.

color

Ellipse color.

thickness

Thickness of the ellipse arc outline, if positive. Otherwise, this indicates that a filled ellipse sector is to be drawn.

lineType

Type of the ellipse boundary. See #LineTypes

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.