diff --git a/skimage/filter/__init__.py b/skimage/filter/__init__.py index 8a9cffaa..04c972cc 100644 --- a/skimage/filter/__init__.py +++ b/skimage/filter/__init__.py @@ -4,4 +4,4 @@ from .canny import canny from .edges import sobel, hsobel, vsobel, hprewitt, vprewitt, prewitt from .tv_denoise import tv_denoise from .rank_order import rank_order -from .thresholding import threshold_otsu, adaptive_threshold +from .thresholding import threshold_otsu, threshold_adaptive diff --git a/skimage/filter/_thresholding.pyx b/skimage/filter/_thresholding.pyx index 88badf31..57d67e9c 100644 --- a/skimage/filter/_thresholding.pyx +++ b/skimage/filter/_thresholding.pyx @@ -6,12 +6,8 @@ cimport cython @cython.boundscheck(False) @cython.wraparound(False) -def _adaptive_threshold( - np.ndarray[np.double_t, ndim=2] image, - int block_size, - double offset, - method -): +def _threshold_adaptive(np.ndarray[np.double_t, ndim=2] image, + int block_size, double offset, method): cdef int r, c cdef np.ndarray[np.float64_t, ndim=2] mean_image if method == 'gaussian': diff --git a/skimage/filter/thresholding.py b/skimage/filter/thresholding.py index 09e6eaea..68ba1482 100644 --- a/skimage/filter/thresholding.py +++ b/skimage/filter/thresholding.py @@ -1,13 +1,13 @@ import numpy as np from skimage.exposure import histogram -from ._thresholding import _adaptive_threshold +from ._thresholding import _threshold_adaptive -__all__ = ['threshold_otsu', 'adaptive_threshold'] +__all__ = ['threshold_otsu', 'threshold_adaptive'] -def adaptive_threshold(image, block_size, offset, method='gaussian'): +def threshold_adaptive(image, block_size, offset, method='gaussian'): """Applies an adaptive threshold to an array. Also known as local or dynamic thresholding where the threshold value is the @@ -40,7 +40,7 @@ def adaptive_threshold(image, block_size, offset, method='gaussian'): """ # not using img_as_float because threshold parameter wouldn't work image = image.astype('double') - return _adaptive_threshold(image, block_size, offset, method) + return _threshold_adaptive(image, block_size, offset, method) def threshold_otsu(image, nbins=256): """Return threshold value based on Otsu's method.