コード例 #1
0
ファイル: __init__.py プロジェクト: AlexG31/scikit-image
from ..filters.edges import (sobel, hsobel, vsobel, sobel_h, sobel_v,
                    scharr, hscharr, vscharr, scharr_h, scharr_v,
                    prewitt, hprewitt, vprewitt, prewitt_h, prewitt_v,
                    roberts, roberts_positive_diagonal,
                    roberts_negative_diagonal, roberts_pos_diag,
                    roberts_neg_diag)
from ..filters._rank_order import rank_order
from ..filters._gabor import gabor_kernel, gabor_filter
from ..filters.thresholding import (threshold_adaptive, threshold_otsu, threshold_yen,
                           threshold_isodata)
from ..filters import rank
from ..filters.rank import median

from skimage._shared.utils import deprecated
from skimage import restoration
denoise_bilateral = deprecated('skimage.restoration.denoise_bilateral')\
                        (restoration.denoise_bilateral)
denoise_tv_bregman = deprecated('skimage.restoration.denoise_tv_bregman')\
                        (restoration.denoise_tv_bregman)
denoise_tv_chambolle = deprecated('skimage.restoration.denoise_tv_chambolle')\
                        (restoration.denoise_tv_chambolle)

# Backward compatibility v<0.11
@deprecated('skimage.feature.canny')
def canny(*args, **kwargs):
    # Hack to avoid circular import
    from skimage.feature._canny import canny as canny_
    return canny_(*args, **kwargs)


__all__ = ['inverse',
           'wiener',
コード例 #2
0
ファイル: _denoise.py プロジェクト: Autodidact24/scikit-image
    >>> x, y, z = np.ogrid[0:40, 0:40, 0:40]
    >>> mask = (x - 22)**2 + (y - 20)**2 + (z - 17)**2 < 8**2
    >>> mask = mask.astype(np.float)
    >>> mask += 0.2*np.random.randn(*mask.shape)
    >>> res = denoise_tv_chambolle(mask, weight=100)

    """

    im_type = im.dtype
    if not im_type.kind == 'f':
        im = img_as_float(im)

    if im.ndim == 2:
        out = _denoise_tv_chambolle_2d(im, weight, eps, n_iter_max)
    elif im.ndim == 3:
        if multichannel:
            out = np.zeros_like(im)
            for c in range(im.shape[2]):
                out[..., c] = _denoise_tv_chambolle_2d(im[..., c], weight, eps,
                                             n_iter_max)
        else:
            out = _denoise_tv_chambolle_3d(im, weight, eps, n_iter_max)
    else:
        raise ValueError('only 2-d and 3-d images may be denoised with this '
                         'function')
    return out


tv_denoise = deprecated('skimage.filter.denoise_tv_chambolle')\
                       (denoise_tv_chambolle)
コード例 #3
0
from .lpi_filter import inverse, wiener, LPIFilter2D
from ._gaussian import gaussian_filter
from ._canny import canny
from .edges import (sobel, hsobel, vsobel, scharr, hscharr, vscharr, prewitt,
                    hprewitt, vprewitt, roberts, roberts_positive_diagonal,
                    roberts_negative_diagonal)
from ._rank_order import rank_order
from ._gabor import gabor_kernel, gabor_filter
from .thresholding import (threshold_adaptive, threshold_otsu, threshold_yen,
                           threshold_isodata)
from . import rank

from skimage._shared.utils import deprecated
from skimage import restoration
denoise_bilateral = deprecated('skimage.restoration.denoise_bilateral')\
                        (restoration.denoise_bilateral)
denoise_tv_bregman = deprecated('skimage.restoration.denoise_tv_bregman')\
                        (restoration.denoise_tv_bregman)
denoise_tv_chambolle = deprecated('skimage.restoration.denoise_tv_chambolle')\
                        (restoration.denoise_tv_chambolle)

__all__ = [
    'inverse', 'wiener', 'LPIFilter2D', 'gaussian_filter', 'canny', 'sobel',
    'hsobel', 'vsobel', 'scharr', 'hscharr', 'vscharr', 'prewitt', 'hprewitt',
    'vprewitt', 'roberts', 'roberts_positive_diagonal',
    'roberts_negative_diagonal', 'denoise_tv_chambolle', 'denoise_bilateral',
    'denoise_tv_bregman', 'rank_order', 'gabor_kernel', 'gabor_filter',
    'threshold_adaptive', 'threshold_otsu', 'threshold_yen',
    'threshold_isodata', 'rank'
]
コード例 #4
0
ファイル: __init__.py プロジェクト: Normatica/scikit-image
from .generic import (autolevel, bottomhat, equalize, gradient, maximum, mean,
                      subtract_mean, median, minimum, modal, enhance_contrast,
                      pop, threshold, tophat, noise_filter, entropy, otsu, sum)
from ._percentile import (autolevel_percentile, gradient_percentile,
                          mean_percentile, subtract_mean_percentile,
                          enhance_contrast_percentile, percentile,
                          pop_percentile, sum_percentile, threshold_percentile)
from .bilateral import mean_bilateral, pop_bilateral, sum_bilateral

from skimage._shared.utils import deprecated


percentile_autolevel = deprecated('autolevel_percentile')(autolevel_percentile)

percentile_gradient = deprecated('gradient_percentile')(gradient_percentile)

percentile_mean = deprecated('mean_percentile')(mean_percentile)
bilateral_mean = deprecated('mean_bilateral')(mean_bilateral)

meansubtraction = deprecated('subtract_mean')(subtract_mean)
percentile_mean_subtraction = deprecated('subtract_mean_percentile')\
                                        (subtract_mean_percentile)

morph_contr_enh = deprecated('enhance_contrast')(enhance_contrast)
percentile_morph_contr_enh = deprecated('enhance_contrast_percentile')\
                                       (enhance_contrast_percentile)

percentile_pop = deprecated('pop_percentile')(pop_percentile)
bilateral_pop = deprecated('pop_bilateral')(pop_bilateral)

percentile_threshold = deprecated('threshold_percentile')(threshold_percentile)
コード例 #5
0
ファイル: __init__.py プロジェクト: jaimebayes/scikit-image
    hprewitt,
    vprewitt,
    roberts,
    roberts_positive_diagonal,
    roberts_negative_diagonal,
)
from ._rank_order import rank_order
from ._gabor import gabor_kernel, gabor_filter
from .thresholding import threshold_adaptive, threshold_otsu, threshold_yen, threshold_isodata
from . import rank


from skimage._shared.utils import deprecated
from skimage import restoration

denoise_bilateral = deprecated("skimage.restoration.denoise_bilateral")(restoration.denoise_bilateral)
denoise_tv_bregman = deprecated("skimage.restoration.denoise_tv_bregman")(restoration.denoise_tv_bregman)
denoise_tv_chambolle = deprecated("skimage.restoration.denoise_tv_chambolle")(restoration.denoise_tv_chambolle)


__all__ = [
    "inverse",
    "wiener",
    "LPIFilter2D",
    "gaussian_filter",
    "canny",
    "sobel",
    "hsobel",
    "vsobel",
    "scharr",
    "hscharr",
コード例 #6
0
ファイル: _denoise.py プロジェクト: williamtang/scikit-image
    >>> x, y, z = np.ogrid[0:40, 0:40, 0:40]
    >>> mask = (x - 22)**2 + (y - 20)**2 + (z - 17)**2 < 8**2
    >>> mask = mask.astype(np.float)
    >>> mask += 0.2*np.random.randn(*mask.shape)
    >>> res = denoise_tv(mask, weight=100)

    """

    im_type = im.dtype
    if not im_type.kind == 'f':
        im = img_as_float(im)

    if im.ndim == 2:
        out = _denoise_tv_chambolle_2d(im, weight, eps, n_iter_max)
    elif im.ndim == 3:
        if multichannel:
            out = np.zeros_like(im)
            for c in range(im.shape[2]):
                out[..., c] = _denoise_tv_chambolle_2d(im[..., c], weight, eps,
                                                       n_iter_max)
        else:
            out = _denoise_tv_chambolle_3d(im, weight, eps, n_iter_max)
    else:
        raise ValueError('only 2-d and 3-d images may be denoised with this '
                         'function')
    return out


tv_denoise = deprecated('skimage.filter.denoise_tv_chambolle')\
                       (denoise_tv_chambolle)
コード例 #7
0
ファイル: denoise.py プロジェクト: andersbll/scikit-image
    ---------
    >>> import scipy
    >>> # 2D example using lena
    >>> lena = scipy.lena()
    >>> import scipy
    >>> lena = scipy.lena().astype(np.float)
    >>> lena += 0.5 * lena.std()*np.random.randn(*lena.shape)
    >>> denoised_lena = denoise_tv(lena, weight=60)
    >>> # 3D example on synthetic data
    >>> x, y, z = np.ogrid[0:40, 0:40, 0:40]
    >>> mask = (x -22)**2 + (y - 20)**2 + (z - 17)**2 < 8**2
    >>> mask = mask.astype(np.float)
    >>> mask += 0.2*np.random.randn(*mask.shape)
    >>> res = denoise_tv_3d(mask, weight=100)
    """
    im_type = im.dtype
    if not im_type.kind == 'f':
        im = img_as_float(im)

    if im.ndim == 2:
        out = _denoise_tv_2d(im, weight, eps, n_iter_max)
    elif im.ndim == 3:
        out = _denoise_tv_3d(im, weight, eps, n_iter_max)
    else:
        raise ValueError('only 2-d and 3-d images may be denoised with this '
                         'function')
    return out


tv_denoise = deprecated('skimage.filter.denoise_tv')(denoise_tv)