mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-07 11:28:14 +08:00
renamed adaptive_threshold to threshold_adaptive
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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':
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user