diff --git a/skimage/transform/_hough_transform.pyx b/skimage/transform/_hough_transform.pyx index 83be34ad..35426cad 100644 --- a/skimage/transform/_hough_transform.pyx +++ b/skimage/transform/_hough_transform.pyx @@ -45,7 +45,7 @@ def _hough_circle(np.ndarray img, \ # compute the nonzero indexes cdef np.ndarray[ndim=1, dtype=np.npy_intp] x, y - y, x = np.nonzero(img) + x, y = np.nonzero(img) # Offset the image cdef int max_radius = radius.max() diff --git a/skimage/transform/tests/test_hough_transform.py b/skimage/transform/tests/test_hough_transform.py index f829b1bb..00427332 100644 --- a/skimage/transform/tests/test_hough_transform.py +++ b/skimage/transform/tests/test_hough_transform.py @@ -111,15 +111,15 @@ def test_hough_peaks_num(): def test_houghcircle(): # Prepare picture - img = np.zeros((100, 100), dtype=int) + img = np.zeros((120, 100), dtype=int) radius = 20 - x_0, y_0 = (50, 50) + x_0, y_0 = (99, 50) x, y = circle_perimeter(y_0, x_0, radius) img[y, x] = 1 out = tf.hough_circle(img, np.array([radius])) - y, x = np.where(out[0] == out[0].max()) + x, y = np.where(out[0] == out[0].max()) # Offset for x_0, y_0 assert_equal(x[0], x_0 + radius) assert_equal(y[0], y_0 + radius)