"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "skimage/restoration/tests/test_denoise.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_denoise.py  (scikit-image-0.19.1):test_denoise.py  (scikit-image-0.19.2)
skipping to change at line 90 skipping to change at line 90
denoised = restoration.denoise_tv_chambolle(astro3, weight=0.1, denoised = restoration.denoise_tv_chambolle(astro3, weight=0.1,
channel_axis=channel_axis) channel_axis=channel_axis)
_at = functools.partial(slice_at_axis, _at = functools.partial(slice_at_axis,
axis=channel_axis % astro3.ndim) axis=channel_axis % astro3.ndim)
assert_array_equal(denoised[_at(0)], denoised0) assert_array_equal(denoised[_at(0)], denoised0)
def test_denoise_tv_chambolle_multichannel_deprecation(): def test_denoise_tv_chambolle_multichannel_deprecation():
denoised0 = restoration.denoise_tv_chambolle(astro[..., 0], weight=0.1) denoised0 = restoration.denoise_tv_chambolle(astro[..., 0], weight=0.1)
with expected_warnings(["`multichannel` is a deprecated argument"]): with expected_warnings(["`multichannel` is a deprecated argument"]):
denoised = restoration.denoise_tv_chambolle(astro, weight=0.1, restoration.denoise_tv_chambolle(astro, weight=0.1,
multichannel=True) multichannel=True)
# providing multichannel argument positionally also warns # providing multichannel argument positionally also warns
with expected_warnings(["Providing the `multichannel` argument"]): with expected_warnings(["Providing the `multichannel` argument"]):
denoised = restoration.denoise_tv_chambolle(astro, 0.1, 2e-4, 200, denoised = restoration.denoise_tv_chambolle(astro, 0.1, 2e-4, 200,
True) True)
assert_array_equal(denoised[..., 0], denoised0) assert_array_equal(denoised[..., 0], denoised0)
def test_denoise_tv_chambolle_n_iter_max_deprecation():
expected = restoration.denoise_tv_chambolle(astro[..., 0], weight=0.1,
max_num_iter=10)
with expected_warnings(["`n_iter_max` is a deprecated argument"]):
denoised = restoration.denoise_tv_chambolle(astro[..., 0], weight=0.1,
n_iter_max=10)
assert_array_equal(expected, denoised)
def test_denoise_tv_chambolle_float_result_range(): def test_denoise_tv_chambolle_float_result_range():
# astronaut image # astronaut image
img = astro_gray img = astro_gray
int_astro = np.multiply(img, 255).astype(np.uint8) int_astro = np.multiply(img, 255).astype(np.uint8)
assert np.max(int_astro) > 1 assert np.max(int_astro) > 1
denoised_int_astro = restoration.denoise_tv_chambolle(int_astro, denoised_int_astro = restoration.denoise_tv_chambolle(int_astro,
weight=0.1) weight=0.1)
# test if the value range of output float data is within [0.0:1.0] # test if the value range of output float data is within [0.0:1.0]
assert denoised_int_astro.dtype == float assert denoised_int_astro.dtype == float
assert np.max(denoised_int_astro) <= 1.0 assert np.max(denoised_int_astro) <= 1.0
 End of changes. 2 change blocks. 
2 lines changed or deleted 12 lines changed or added

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