Cython division fixes. Ignore version file after build.

This commit is contained in:
Stefan van der Walt
2009-12-03 09:45:20 +02:00
parent 5f4d939733
commit 7dbbf8b397
3 changed files with 6 additions and 5 deletions
+1
View File
@@ -2,6 +2,7 @@
all:
python setup.py build_ext --inplace
git update-index --assume-unchanged scikits/image/version.py
clean:
find . -name "*.so" | xargs rm
+1 -1
View File
@@ -1,3 +1,3 @@
cimport numpy as np
cpdef shortest_path(np.ndarray, int)
cpdef shortest_path(np.ndarray, int reach=?)
+4 -4
View File
@@ -22,8 +22,8 @@ cdef inline int int_min(int a, int b): return a if a <= b else b
def dilate(np.ndarray[IMAGE_DTYPE_t, ndim=2] image not None,
np.ndarray[IMAGE_DTYPE_t, ndim=2] selem not None,
np.ndarray[IMAGE_DTYPE_t, ndim=2] out):
cdef int hw = selem.shape[0] / 2
cdef int hh = selem.shape[1] / 2
cdef int hw = selem.shape[0] // 2
cdef int hh = selem.shape[1] // 2
cdef int width = image.shape[0], height = image.shape[1]
if out is None:
out = np.zeros([width, height], dtype=IMAGE_DTYPE)
@@ -65,8 +65,8 @@ def dilate(np.ndarray[IMAGE_DTYPE_t, ndim=2] image not None,
def erode(np.ndarray[IMAGE_DTYPE_t, ndim=2] image not None,
np.ndarray[IMAGE_DTYPE_t, ndim=2] selem not None,
np.ndarray[IMAGE_DTYPE_t, ndim=2] out):
cdef int hw = selem.shape[0] / 2
cdef int hh = selem.shape[1] / 2
cdef int hw = selem.shape[0] // 2
cdef int hh = selem.shape[1] // 2
cdef int width = image.shape[0], height = image.shape[1]
if out is None:
out = np.zeros([width, height], dtype=IMAGE_DTYPE)