mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-02 14:15:10 +08:00
BUG: Hough failed on provision of angles argument.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2006 Stefan van der Walt <stefan@sun.ac.za>
|
||||
## Copyright (C) 2005 Stefan van der Walt <stefan@sun.ac.za>
|
||||
##
|
||||
## Redistribution and use in source and binary forms, with or without
|
||||
## modification, are permitted provided that the following conditions are
|
||||
@@ -78,7 +78,7 @@ def hough(img, angles=None):
|
||||
|
||||
img = img.astype(bool)
|
||||
|
||||
if not angles:
|
||||
if angles is None:
|
||||
angles = np.linspace(-90,90,180)
|
||||
|
||||
theta = angles / 180. * np.pi
|
||||
|
||||
@@ -16,3 +16,15 @@ def test_hough():
|
||||
|
||||
assert_equal(out.max(), 100)
|
||||
assert_equal(len(angles), 180)
|
||||
|
||||
def test_hough_angles():
|
||||
img = np.zeros((10, 10))
|
||||
img[0, 0] = 1
|
||||
|
||||
out, angles, d = hough(img, np.linspace(0, 360, 10))
|
||||
|
||||
assert_equal(len(angles), 10)
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_module_suite()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user