mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-08 06:11:19 +08:00
Remove unused CAPI numpy import and extend cython directives
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user