<Python, openCV> How I can use cv2.ellipse? -
opencv2 python have 2 function
[function 1]
- python: cv2.ellipse(img, center, axes, angle, startangle, endangle, color[, thickness[, linetype[, shift]]]) → none
[function 2]
- python: cv2.ellipse(img, box, color[, thickness[, linetype]]) → none
i want use [function 1]
but when use code
cv2.ellipse(resultimage, circle, size, angle, 0, 360, color, 2, cv2.cv_aa, 0)
it raise
typeerror: ellipse() takes @ 5 arguments (10 given)
could me?
the fact python doesn't support multiple dispatch default doesn't here: having 2 functions same name different parameters not pythonic. question is: how cv2
guess version we'd call ? couldn't find explicit doc on that.
anyhow, after experiencing same issue opencv 3.0.0-beta , python 3.4.2, i finally found out in case 1 of circle's point float
, , although running official samples code 8 parameters, reason cv2 defaulted 5-args function. using int
fixed problem, error message pretty misleading.
i believe going python 2 3 may bring kind of confusion in existing code, since integer divisions return floats in python 3.
Comments
Post a Comment