mirror of
https://github.com/wassname/scikit-image.git
synced 2026-09-12 12:50:49 +08:00
Added function to generate binary image with rounded (blob-like) objects.
This commit is contained in:
@@ -54,6 +54,14 @@ def test_coffee():
|
||||
data.coffee()
|
||||
|
||||
|
||||
def test_binary_blobs():
|
||||
blobs = data.binary_blobs(length=128)
|
||||
assert blobs.mean() == 0.5
|
||||
blobs = data.binary_blobs(length=128, volume_fraction=0.25)
|
||||
assert blobs.mean() == 0.25
|
||||
blobs = data.binary_blobs(length=32, volume_fraction=0.25, n_dim=3)
|
||||
assert blobs.mean() == 0.25
|
||||
|
||||
if __name__ == "__main__":
|
||||
from numpy.testing import run_module_suite
|
||||
run_module_suite()
|
||||
|
||||
Reference in New Issue
Block a user