mirror of
https://github.com/wassname/scikit-image.git
synced 2026-10-30 13:40:44 +08:00
Add examples to doc string of clear_border
This commit is contained in:
1 parent
1177cf1393
commit
bbeaec6b3f
1 file changed
+18
@@ -21,6 +21,24 @@ def clear_border(image, buffer_size=0, bgval=0):
|
||||
image : (N, M) array
|
||||
Cleared binary image.
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> import numpy as np
|
||||
>>> from skimage.segmentation import clear_border
|
||||
>>> image = np.array([[0, 0, 0, 0, 0, 0, 0, 1, 0],
|
||||
... [0, 0, 0, 0, 1, 0, 0, 0, 0],
|
||||
... [1, 0, 0, 1, 0, 1, 0, 0, 0],
|
||||
... [0, 0, 1, 1, 1, 1, 1, 0, 0],
|
||||
... [0, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
... [0, 0, 0, 0, 0, 0, 0, 0, 0]])
|
||||
>>> clear_border(image)
|
||||
array([[0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 1, 0, 0, 0, 0],
|
||||
[0, 0, 0, 1, 0, 1, 0, 0, 0],
|
||||
[0, 0, 1, 1, 1, 1, 1, 0, 0],
|
||||
[0, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0]])
|
||||
|
||||
"""
|
||||
|
||||
rows, cols = image.shape
|
||||
|
||||
Reference in new issue
Block a user