diff --git a/skimage/draw/_draw.pyx b/skimage/draw/_draw.pyx index 5bba8c32..4b7fb094 100644 --- a/skimage/draw/_draw.pyx +++ b/skimage/draw/_draw.pyx @@ -97,10 +97,10 @@ def polygon(y, x, shape=None): """ cdef Py_ssize_t nr_verts = x.shape[0] - cdef Py_ssize_t minr = max(0, y.min()) - cdef Py_ssize_t maxr = math.ceil(y.max()) - cdef Py_ssize_t minc = max(0, x.min()) - cdef Py_ssize_t maxc = math.ceil(x.max()) + cdef Py_ssize_t minr = int(max(0, y.min())) + cdef Py_ssize_t maxr = int(math.ceil(y.max())) + cdef Py_ssize_t minc = int(max(0, x.min())) + cdef Py_ssize_t maxc = int(math.ceil(x.max())) # make sure output coordinates do not exceed image size if shape is not None: @@ -148,10 +148,10 @@ def ellipse(double cy, double cx, double yradius, double xradius, shape=None): """ - cdef Py_ssize_t minr = max(0, cy - yradius) - cdef Py_ssize_t maxr = math.ceil(cy + yradius) - cdef Py_ssize_t minc = max(0, cx - xradius) - cdef Py_ssize_t maxc = math.ceil(cx + xradius) + cdef Py_ssize_t minr = int(max(0, cy - yradius)) + cdef Py_ssize_t maxr = int(math.ceil(cy + yradius)) + cdef Py_ssize_t minc = int(max(0, cx - xradius)) + cdef Py_ssize_t maxc = int(math.ceil(cx + xradius)) # make sure output coordinates do not exceed image size if shape is not None: