From 54a9deae476c2472b564016bd64d63b31f16173c Mon Sep 17 00:00:00 2001 From: Pieter Holtzhausen Date: Fri, 19 Aug 2011 16:36:01 +0200 Subject: [PATCH] Formatting --- scikits/image/transform/_hough_transform.pyx | 9 ++++----- scikits/image/transform/hough_transform.py | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/scikits/image/transform/_hough_transform.pyx b/scikits/image/transform/_hough_transform.pyx index 98693dbe..9dcd7205 100644 --- a/scikits/image/transform/_hough_transform.pyx +++ b/scikits/image/transform/_hough_transform.pyx @@ -19,7 +19,7 @@ cdef double round(double val): cdef double PI_2 = 1.5707963267948966 cdef double NEG_PI_2 = -PI_2 - +@cython.cdivision(True) @cython.boundscheck(False) def _hough(np.ndarray img, np.ndarray[ndim=1, dtype=np.double_t] theta=None): @@ -66,8 +66,8 @@ def _hough(np.ndarray img, np.ndarray[ndim=1, dtype=np.double_t] theta=None): @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): +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): if img.ndim != 2: raise ValueError('The input image must be 2D.') # compute the array of angles and their sine and cosine @@ -110,7 +110,6 @@ def _probabilistic_hough(np.ndarray img, int value_threshold, int line_length, i mask[y_idxs[i], x_idxs[i]] = 1 while 1: - #for i in range(num_indexes): # select random non-zero point count = len(points) if count == 0: @@ -141,7 +140,7 @@ def _probabilistic_hough(np.ndarray img, int value_threshold, int line_length, i b = ctheta[max_theta] x0 = x y0 = y - # calculate gradient of walks using fixed point math + # calculate gradient of walks using fixed point math xflag = fabs(a) > fabs(b) if xflag: if a > 0: diff --git a/scikits/image/transform/hough_transform.py b/scikits/image/transform/hough_transform.py index d530fa0f..45d44599 100644 --- a/scikits/image/transform/hough_transform.py +++ b/scikits/image/transform/hough_transform.py @@ -59,7 +59,7 @@ except ImportError: pass -def probabilistic_hough(img, value_threshold=10, line_length=50, line_gap=10, theta=None): +def probabilistic_hough(img, threshold=10, line_length=50, line_gap=10, theta=None): """Performs a progressive probabilistic line Hough transform and returns the detected lines. Parameters @@ -84,7 +84,7 @@ def probabilistic_hough(img, value_threshold=10, line_length=50, line_gap=10, th transform for line detection", in IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 1999. """ - return _probabilistic_hough(img, value_threshold, line_length, line_gap, theta) + return _probabilistic_hough(img, threshold, line_length, line_gap, theta) def hough(img, theta=None):