mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-01 08:36:49 +08:00
Merge pull request #526 from sciunto/fixtravis
This commit is contained in:
@@ -49,6 +49,9 @@ def hough_circle(cnp.ndarray img,
|
||||
if img.ndim != 2:
|
||||
raise ValueError('The input image must be 2D.')
|
||||
|
||||
cdef Py_ssize_t xmax = img.shape[0]
|
||||
cdef Py_ssize_t ymax = img.shape[1]
|
||||
|
||||
# compute the nonzero indexes
|
||||
cdef cnp.ndarray[ndim=1, dtype=cnp.intp_t] x, y
|
||||
x, y = np.nonzero(img)
|
||||
@@ -90,7 +93,10 @@ def hough_circle(cnp.ndarray img,
|
||||
for c in range(num_circle_pixels):
|
||||
tx = circle_x[c] + x[p]
|
||||
ty = circle_y[c] + y[p]
|
||||
acc[i, tx, ty] += incr
|
||||
if offset:
|
||||
acc[i, tx, ty] += incr
|
||||
elif 0 <= tx < xmax and 0 <= ty < ymax:
|
||||
acc[i, tx, ty] += incr
|
||||
|
||||
return acc
|
||||
|
||||
|
||||
@@ -123,7 +123,6 @@ def test_hough_circle():
|
||||
out = tf.hough_circle(img, np.array([radius]))
|
||||
|
||||
x, y = np.where(out[0] == out[0].max())
|
||||
# Offset for x_0, y_0
|
||||
assert_equal(x[0], x_0)
|
||||
assert_equal(y[0], y_0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user