mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-21 12:50:27 +08:00
FIX: Pass arguments from deprecated function, update examples.
This commit is contained in:
@@ -25,7 +25,7 @@ import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
from skimage import data, img_as_float
|
||||
from skimage.measure import structural_similarity as ssim
|
||||
from skimage.measure import compare_ssim as ssim
|
||||
|
||||
img = img_as_float(data.camera())
|
||||
rows, cols = img.shape
|
||||
|
||||
@@ -17,7 +17,7 @@ from six import BytesIO
|
||||
from PIL import Image
|
||||
from .._plugins.pil_plugin import (
|
||||
pil_to_ndarray, ndarray_to_pil, _palette_is_grayscale)
|
||||
from ...measure import structural_similarity as ssim
|
||||
from ...measure import compare_ssim as ssim
|
||||
from ...color import rgb2lab
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ from ._label import label
|
||||
__all__ = ['find_contours',
|
||||
'regionprops',
|
||||
'perimeter',
|
||||
'structural_similarity',
|
||||
'approximate_polygon',
|
||||
'subdivide_polygon',
|
||||
'LineModel',
|
||||
|
||||
@@ -225,6 +225,7 @@ def structural_similarity(X, Y, win_size=None, gradient=False,
|
||||
dynamic_range=None, multichannel=False,
|
||||
gaussian_weights=False, full=False, **kwargs):
|
||||
"""""" + compare_ssim.__doc__
|
||||
return compare_ssim(X, Y, win_size=None, gradient=False,
|
||||
dynamic_range=None, multichannel=False,
|
||||
gaussian_weights=False, full=False, **kwargs)
|
||||
return compare_ssim(X, Y, win_size=win_size, gradient=gradient,
|
||||
dynamic_range=dynamic_range,
|
||||
multichannel=multichannel,
|
||||
gaussian_weights=gaussian_weights, full=full, **kwargs)
|
||||
|
||||
@@ -26,7 +26,7 @@ def test_old_name_deprecated():
|
||||
with expected_warnings('Call to deprecated function '
|
||||
'``structural_similarity``. Use '
|
||||
'``compare_ssim`` instead.'):
|
||||
ssim_result = structural_similarity(cam, cam_noisy, win_size=32)
|
||||
ssim_result = structural_similarity(cam, cam_noisy, win_size=31)
|
||||
|
||||
|
||||
def test_ssim_patch_range():
|
||||
|
||||
@@ -108,8 +108,8 @@ def test_denoise_tv_chambolle_weighting():
|
||||
w = 0.2
|
||||
denoised_2d = restoration.denoise_tv_chambolle(img2d, weight=w)
|
||||
denoised_4d = restoration.denoise_tv_chambolle(img4d, weight=w)
|
||||
assert measure.structural_similarity(denoised_2d,
|
||||
denoised_4d[:, :, 0, 0]) > 0.99
|
||||
assert measure.compare_ssim(denoised_2d,
|
||||
denoised_4d[:, :, 0, 0]) > 0.99
|
||||
|
||||
|
||||
def test_denoise_tv_bregman_2d():
|
||||
|
||||
Reference in New Issue
Block a user