I need to draw an arc (part of a circle) but I need the angles to be precise (float). But when I run the code below, I find 2 'bugs':
First, when the start/end angle is less than .5 it draws the 'arc' not at 0 degrees but at the CENTER OF THE ELLIPSE. Then, as it reaches 1 degree 2 degrees 3 degrees it draws an extra 'chunk' of the arc. Why am I not able to draw for example startAngle 0
and endAngle 2.7
. Why will it only draw integer angles. The parameters in c++ seem to be 'double' and i'm using floats.
import numpy as np
import cv2
image = np.zeros((720,1280,3), np.uint8)
height, width = image.shape[0:2]
# Ellipse parameters
radius = 640
center = (0, height //2)
axes = (radius, radius)
angle = 0.
startAngle = .0001
endAngle = -.01
thickness = 200
for i in range(400):
cv2.ellipse(image, center, axes, angle, startAngle, endAngle*float(i), (255,0,0), thickness)
cv2.imshow('image', image)
if cv2.waitKey(20) & 0xFF == 27:
break
cv2.destroyAllWindows()