Draws a simple or thick elliptic arc or fills an ellipse sector
img = cv.ellipse(img, center, axes)
img = cv.ellipse(img, box)
[...] = cv.ellipse(..., 'OptionName', optionValue, ...)
Input
- img Image where the ellipse is drawn.
- center Center of the ellipse
[x,y]
.
- axes Half of the size of the ellipse main axes
[a,b]
.
- box Alternative ellipse representation via a rotated rectangle box.
This means that the function draws an ellipse inscribed in the rotated
rectangle. A scalar structure with the following fields:
- center The rectangle mass center
[x,y]
.
- size Width and height of the rectangle
[w,h]
.
- angle The rotation angle in a clockwise direction. When the
angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right
rectangle.
Output
- img Output image, same size and type as input
img
.
Options
- Angle Ellipse rotation angle in degrees. default 0.
- StartAngle Starting angle of the elliptic arc in degrees. default 0
- EndAngle Ending angle of the elliptic arc in degrees. default 360
- Color 3-element floating point vector specifying ellipse color.
- Thickness Thickness of the ellipse arc outline, if positive.
Otherwise, this indicates that a filled ellipse sector is to be drawn
(-1 or the string 'Filled'). default 1.
- LineType Type of the ellipse boundary. One of 8,4,'AA' (Anti-aliased
line). default 8.
- Shift Number of fractional bits in the coordinates of the center and
values of axes. default 0.
The first variant of the cv.ellipse function draw an ellipse outline, a
filled ellipse, an elliptic arc, or a filled ellipse sector. 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
cv.ellipse2Poly and then render it with cv.polylines or fill it with
cv.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
.
The second variant of the function (with rotated rectange as input) does not
support the Angle
, StartAngle
, EndAngle
, and Shift
parameters
(always draw a whole ellipse, not an arc).