Remove unused CAPI numpy import and extend cython directives

This commit is contained in:
Johannes Schönberger
2013-02-16 08:03:12 +01:00
parent 572000f0e2
commit 2d9c211cf2
+4 -6
View File
@@ -1,3 +1,7 @@
#cython: cdivision=True
#cython: boundscheck=False
#cython: nonecheck=False
#cython: wraparound=False
cimport cython
import math
import numpy as np
@@ -7,9 +11,6 @@ from libc.math cimport abs, fabs, sqrt, ceil, floor
from libc.stdlib cimport rand
np.import_array()
cdef double PI_2 = 1.5707963267948966
cdef double NEG_PI_2 = -PI_2
@@ -18,7 +19,6 @@ cdef inline Py_ssize_t round(double r):
return <Py_ssize_t>((r + 0.5) if (r > 0.0) else (r - 0.5))
@cython.boundscheck(False)
def _hough(np.ndarray img, np.ndarray[ndim=1, dtype=np.double_t] theta=None):
if img.ndim != 2:
@@ -62,8 +62,6 @@ def _hough(np.ndarray img, np.ndarray[ndim=1, dtype=np.double_t] theta=None):
return accum, theta, bins
@cython.cdivision(True)
@cython.boundscheck(False)
def _probabilistic_hough(np.ndarray img, int value_threshold,
int line_length, int line_gap,
np.ndarray[ndim=1, dtype=np.double_t] theta=None):