fix signature

This commit is contained in:
François Boulogne
2013-03-24 15:39:07 +01:00
parent 42e872f926
commit 0e4d107754
3 changed files with 9 additions and 8 deletions
+5 -5
View File
@@ -174,8 +174,8 @@ def hough_line(cnp.ndarray img, cnp.ndarray[ndim=1, dtype=cnp.double_t] theta=No
return accum, theta, bins
def probabilistic_hough_line(cnp.ndarray img, int value_threshold,
int line_length, int line_gap,
def probabilistic_hough_line(cnp.ndarray img, int threshold=10,
int line_length=50, int line_gap=10,
cnp.ndarray[ndim=1, dtype=cnp.double_t] theta=None):
"""Return lines from a progressive probabilistic line Hough transform.
@@ -183,7 +183,7 @@ def probabilistic_hough_line(cnp.ndarray img, int value_threshold,
----------
img : (M, N) ndarray
Input image with nonzero values representing edges.
threshold : int
threshold : int, optional (default 10)
Threshold
line_length : int, optional (default 50)
Minimum accepted length of detected lines.
@@ -267,7 +267,7 @@ def probabilistic_hough_line(cnp.ndarray img, int value_threshold,
continue
value = 0
max_value = value_threshold - 1
max_value = threshold - 1
max_theta = -1
# apply hough transform on point
@@ -278,7 +278,7 @@ def probabilistic_hough_line(cnp.ndarray img, int value_threshold,
if value > max_value:
max_value = value
max_theta = j
if max_value < value_threshold:
if max_value < threshold:
continue
# from the random point walk in opposite directions and find line
+2 -1
View File
@@ -17,7 +17,8 @@ def hough(img, theta=None):
@deprecated('probabilistic_hough')
def probabilistic_hough(img, threshold=10, line_length=50, line_gap=10,
theta=None):
return probabilistic_hough_line(img, threshold, line_length, line_gap, theta)
return probabilistic_hough_line(img, threshold=threshold,
line_length=line_length, line_gap=line_gap, theta=theta)
@deprecated('hough_peaks')
def hough_peaks(hspace, angles, dists, min_distance=10, min_angle=10,
@@ -49,8 +49,8 @@ def test_probabilistic_hough():
# decrease default theta sampling because similar orientations may confuse
# as mentioned in article of Galambos et al
theta = np.linspace(0, np.pi, 45)
lines = tf.probabilistic_hough_line(img, theta=theta, threshold=10, line_length=10,
line_gap=1)
lines = tf.probabilistic_hough_line(img, threshold=10, line_length=10,
line_gap=1, theta=theta)
# sort the lines according to the x-axis
sorted_lines = []
for line in lines: