From 2f91c003fd0c277f1f404bd120e9dc68c8bc78d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Boulogne?= Date: Tue, 17 May 2016 16:58:36 +0200 Subject: [PATCH 1/2] API: no default none value for internal cython function --- skimage/transform/_hough_transform.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/transform/_hough_transform.pyx b/skimage/transform/_hough_transform.pyx index a189d7b9..818bf489 100644 --- a/skimage/transform/_hough_transform.pyx +++ b/skimage/transform/_hough_transform.pyx @@ -229,7 +229,7 @@ def hough_ellipse(cnp.ndarray img, int threshold=4, double accuracy=1, def hough_line(cnp.ndarray img, - cnp.ndarray[ndim=1, dtype=cnp.double_t] theta=None): + cnp.ndarray[ndim=1, dtype=cnp.double_t] theta): """Perform a straight line Hough transform. Parameters From 1d52ccf0b17aabfcf24616558f704cb25f764392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Boulogne?= Date: Tue, 17 May 2016 17:09:03 +0200 Subject: [PATCH 2/2] DOC: clarifications + comment step size theta DOC: fix wording enhance return name --- skimage/transform/hough_transform.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/skimage/transform/hough_transform.py b/skimage/transform/hough_transform.py index f9a8d2e5..afbe47b4 100644 --- a/skimage/transform/hough_transform.py +++ b/skimage/transform/hough_transform.py @@ -17,14 +17,14 @@ def hough_line(img, theta=None): Input image with nonzero values representing edges. theta : 1D ndarray of double Angles at which to compute the transform, in radians. - Defaults to -pi/2 .. pi/2 + Defaults to a vector of 180 angles evenly spaced from -pi/2 to pi/2. Returns ------- - H : 2-D ndarray of uint64 + hspace : 2-D ndarray of uint64 Hough transform accumulator. - theta : ndarray - Angles at which the transform was computed, in radians. + angles : ndarray + Angles at which the transform is computed, in radians. distances : ndarray Distance values. @@ -34,6 +34,8 @@ def hough_line(img, theta=None): X and Y axis are horizontal and vertical edges respectively. The distance is the minimal algebraic distance from the origin to the detected line. + The angle accuracy can be improved by decreasing the step size in + the `theta` array. Examples -------- @@ -66,7 +68,7 @@ def hough_line(img, theta=None): def hough_line_peaks(hspace, angles, dists, min_distance=9, min_angle=10, threshold=None, num_peaks=np.inf): - """Return peaks in hough transform. + """Return peaks in a straight line Hough transform. Identifies most prominent lines separated by a certain angle and distance in a hough transform. Non-maximum suppression with different sizes is @@ -96,7 +98,7 @@ def hough_line_peaks(hspace, angles, dists, min_distance=9, min_angle=10, Returns ------- - hspace, angles, dists : tuple of array + hspace, angles, distances : tuple of array Peak values in hough space, angles and distances. Examples