mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-16 11:21:25 +08:00
Use NORMALIZE_WHITESPACE directive for block_reduce doctest
This commit is contained in:
@@ -28,27 +28,25 @@ def block_reduce(image, block_size, func=np.sum, cval=0):
|
||||
--------
|
||||
>>> from skimage.measure import block_reduce
|
||||
>>> image = np.arange(3*3*4).reshape(3, 3, 4)
|
||||
>>> image
|
||||
>>> image # doctest: +NORMALIZE_WHITESPACE
|
||||
array([[[ 0, 1, 2, 3],
|
||||
[ 4, 5, 6, 7],
|
||||
[ 8, 9, 10, 11]],
|
||||
<BLANKLINE>
|
||||
[[12, 13, 14, 15],
|
||||
[16, 17, 18, 19],
|
||||
[20, 21, 22, 23]],
|
||||
<BLANKLINE>
|
||||
[[24, 25, 26, 27],
|
||||
[28, 29, 30, 31],
|
||||
[32, 33, 34, 35]]])
|
||||
>>> block_reduce(image, block_size=(3, 3, 1), func=np.mean)
|
||||
array([[[ 16., 17., 18., 19.]]])
|
||||
>>> block_reduce(image, block_size=(1, 3, 4), func=np.max)
|
||||
>>> image_max1 = block_reduce(image, block_size=(1, 3, 4), func=np.max)
|
||||
>>> image_max1 # doctest: +NORMALIZE_WHITESPACE
|
||||
array([[[11]],
|
||||
<BLANKLINE>
|
||||
[[23]],
|
||||
<BLANKLINE>
|
||||
[[35]]])
|
||||
>>> block_reduce(image, block_size=(3, 1, 4), func=np.max)
|
||||
>>> image_max2 = block_reduce(image, block_size=(3, 1, 4), func=np.max)
|
||||
>>> image_max2 # doctest: +NORMALIZE_WHITESPACE
|
||||
array([[[27],
|
||||
[31],
|
||||
[35]]])
|
||||
|
||||
Reference in New Issue
Block a user