mirror of
https://github.com/wassname/scikit-image.git
synced 2026-09-12 12:50:49 +08:00
Merge pull request #641 from sciunto/example_ht
Example Hough transform (ellipse)
This commit is contained in:
@@ -184,3 +184,16 @@ def chelsea():
|
||||
|
||||
"""
|
||||
return load("chelsea.png")
|
||||
|
||||
|
||||
def coffee():
|
||||
"""Coffee cup.
|
||||
|
||||
An example with several shapes (including an ellipse).
|
||||
|
||||
Notes
|
||||
-----
|
||||
No copyright restrictions. CC0 by the photographer.
|
||||
|
||||
"""
|
||||
return load("coffee.png")
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 456 KiB |
@@ -44,6 +44,11 @@ def test_chelsea():
|
||||
data.chelsea()
|
||||
|
||||
|
||||
def test_coffee():
|
||||
""" Test that "coffee" image can be loaded. """
|
||||
data.coffee()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from numpy.testing import run_module_suite
|
||||
run_module_suite()
|
||||
|
||||
@@ -130,9 +130,9 @@ def hough_ellipse(cnp.ndarray img, int threshold=4, double accuracy=1,
|
||||
--------
|
||||
>>> img = np.zeros((25, 25), dtype=int)
|
||||
>>> rr, cc = draw.ellipse_perimeter(10, 10, 6, 8)
|
||||
>>> img[rr, cc] = 1
|
||||
>>> result = hough_ellipse(img, threshold=6)
|
||||
[(10.0, 10.0, 8.0, 6.0474292058692187, 0.0, 8)]
|
||||
>>> img[cc, rr] = 1
|
||||
>>> result = hough_ellipse(img, threshold=8)
|
||||
[(10.0, 10.0, 8.0, 6.0, 0.0, 10)]
|
||||
|
||||
Notes
|
||||
-----
|
||||
|
||||
Reference in New Issue
Block a user