mirror of
https://github.com/wassname/scikit-image.git
synced 2026-09-11 12:43:04 +08:00
Merge pull request #632 from ahojnnes/local-blocks
Refactor N-dimensial array resampling and add additional functionality
This commit is contained in:
@@ -6,7 +6,7 @@ from skimage.transform import (warp, warp_coords, rotate, resize, rescale,
|
||||
AffineTransform,
|
||||
ProjectiveTransform,
|
||||
SimilarityTransform,
|
||||
downscale_local_means)
|
||||
downscale_local_mean)
|
||||
from skimage import transform as tf, data, img_as_float
|
||||
from skimage.color import rgb2gray
|
||||
|
||||
@@ -195,15 +195,15 @@ def test_warp_coords_example():
|
||||
map_coordinates(image[:, :, 0], coords[:2])
|
||||
|
||||
|
||||
def test_downscale_local_means():
|
||||
"""Verifying downsampling of an array with expected result in mean mode"""
|
||||
image1 = np.arange(4*6).reshape(4, 6)
|
||||
out1 = downscale_local_means(image1, (2, 3))
|
||||
def test_downscale_local_mean():
|
||||
image1 = np.arange(4 * 6).reshape(4, 6)
|
||||
out1 = downscale_local_mean(image1, (2, 3))
|
||||
expected1 = np.array([[ 4., 7.],
|
||||
[ 16., 19.]])
|
||||
assert_array_equal(expected1, out1)
|
||||
image2 = np.arange(5*8).reshape(5, 8)
|
||||
out2 = downscale_local_means(image2, (4, 5))
|
||||
|
||||
image2 = np.arange(5 * 8).reshape(5, 8)
|
||||
out2 = downscale_local_mean(image2, (4, 5))
|
||||
expected2 = np.array([[ 14. , 10.8],
|
||||
[ 8.5, 5.7]])
|
||||
assert_array_equal(expected2, out2)
|
||||
|
||||
Reference in New Issue
Block a user