"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "skimage/transform/tests/test_warps.py" between
scikit-image-0.19.1.tar.gz and scikit-image-0.19.2.tar.gz

About: scikit-image is a collection of algorithms for image processing in Python.

test_warps.py  (scikit-image-0.19.1):test_warps.py  (scikit-image-0.19.2)
skipping to change at line 355 skipping to change at line 355
assert resize(x_b, (10, 10), preserve_range=True).dtype == bool assert resize(x_b, (10, 10), preserve_range=True).dtype == bool
assert resize(x_f32, (10, 10), preserve_range=False).dtype == x_f32.dtype assert resize(x_f32, (10, 10), preserve_range=False).dtype == x_f32.dtype
assert resize(x_f32, (10, 10), preserve_range=True).dtype == x_f32.dtype assert resize(x_f32, (10, 10), preserve_range=True).dtype == x_f32.dtype
@pytest.mark.parametrize('order', [0, 1]) @pytest.mark.parametrize('order', [0, 1])
@pytest.mark.parametrize('preserve_range', [True, False]) @pytest.mark.parametrize('preserve_range', [True, False])
@pytest.mark.parametrize('anti_aliasing', [True, False]) @pytest.mark.parametrize('anti_aliasing', [True, False])
@pytest.mark.parametrize('dtype', [np.float64, np.uint8]) @pytest.mark.parametrize('dtype', [np.float64, np.uint8])
def test_resize_clip(order, preserve_range, anti_aliasing, dtype): def test_resize_clip(order, preserve_range, anti_aliasing, dtype):
# test if clip as expected # test if clip as expected
if dtype == np.uint8 and (preserve_range or order==0): if dtype == np.uint8 and (preserve_range or order == 0):
expected_max = 255 expected_max = 255
else: else:
expected_max = 1.0 expected_max = 1.0
x = np.ones((5, 5), dtype=dtype) x = np.ones((5, 5), dtype=dtype)
if dtype == np.uint8: if dtype == np.uint8:
x *= 255 x *= 255
resized = resize(x, (3, 3), order=order, preserve_range=preserve_range, resized = resize(x, (3, 3), order=order, preserve_range=preserve_range,
anti_aliasing=anti_aliasing) anti_aliasing=anti_aliasing)
assert resized.max() == expected_max assert resized.max() == expected_max
skipping to change at line 850 skipping to change at line 850
assert resize_local_mean(x_u8, (10, 10), assert resize_local_mean(x_u8, (10, 10),
preserve_range=True).dtype == np.double preserve_range=True).dtype == np.double
assert resize_local_mean(x_b, (10, 10), assert resize_local_mean(x_b, (10, 10),
preserve_range=False).dtype == np.double preserve_range=False).dtype == np.double
assert resize_local_mean(x_b, (10, 10), assert resize_local_mean(x_b, (10, 10),
preserve_range=True).dtype == np.double preserve_range=True).dtype == np.double
assert resize_local_mean(x_f32, (10, 10), assert resize_local_mean(x_f32, (10, 10),
preserve_range=False).dtype == x_f32.dtype preserve_range=False).dtype == x_f32.dtype
assert resize_local_mean(x_f32, (10, 10), assert resize_local_mean(x_f32, (10, 10),
preserve_range=True).dtype == x_f32.dtype preserve_range=True).dtype == x_f32.dtype
@pytest.mark.parametrize("_type", [tuple, np.asarray, list])
def test_output_shape_arg_type(_type):
img = np.random.rand(3, 3)
output_shape = _type([5, 5])
assert resize(img, output_shape).shape == tuple(output_shape)
 End of changes. 2 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)