mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-13 16:56:11 +08:00
Add test case for separate scale factors
This commit is contained in:
@@ -95,6 +95,7 @@ def test_resize():
|
||||
|
||||
|
||||
def test_scale():
|
||||
# same scale factor
|
||||
x = np.zeros((5, 5), dtype=np.double)
|
||||
x[1, 1] = 1
|
||||
scaled = scale(x, 2, order=0)
|
||||
@@ -102,6 +103,14 @@ def test_scale():
|
||||
ref[2:4, 2:4] = 1
|
||||
assert_array_almost_equal(scaled, ref)
|
||||
|
||||
# different scale factors
|
||||
x = np.zeros((5, 5), dtype=np.double)
|
||||
x[1, 1] = 1
|
||||
scaled = scale(x, (2, 1), order=0)
|
||||
ref = np.zeros((10, 5))
|
||||
ref[2:4, 1] = 1
|
||||
assert_array_almost_equal(scaled, ref)
|
||||
|
||||
|
||||
def test_swirl():
|
||||
image = img_as_float(data.checkerboard())
|
||||
|
||||
Reference in New Issue
Block a user