Bases: object
Decorator to mark deprecated functions with warning.
Adapted from <http://wiki.python.org/moin/PythonDecoratorLibrary>.
Parameters: | alt_func : str
behavior : {‘warn’, ‘raise’}
|
---|
skimage.filter.rank.autolevel(image, selem) | Autolevel image using local histogram. |
skimage.filter.rank.autolevel_percentile(...) | Return greyscale local autolevel of an image. |
skimage.filter.rank.bilateral_mean(*args, ...) | Deprecated function. Use mean_bilateral instead. |
skimage.filter.rank.bilateral_pop(*args, ...) | Deprecated function. Use pop_bilateral instead. |
skimage.filter.rank.bottomhat(image, selem) | Returns greyscale local bottomhat of an image. |
skimage.filter.rank.enhance_contrast(image, ...) | Enhance an image replacing each pixel by the local maximum if pixel greylevel is closest to maximimum than local minimum OR local minimum otherwise. |
skimage.filter.rank.enhance_contrast_percentile(...) | Return greyscale local enhance_contrast of an image. |
skimage.filter.rank.entropy(image, selem[, ...]) | Returns the entropy [R145] computed locally. |
skimage.filter.rank.equalize(image, selem[, ...]) | Equalize image using local histogram. |
skimage.filter.rank.gradient(image, selem[, ...]) | Return greyscale local gradient of an image (i.e. |
skimage.filter.rank.gradient_percentile(...) | Return greyscale local gradient of an image. |
skimage.filter.rank.maximum(image, selem[, ...]) | Return greyscale local maximum of an image. |
skimage.filter.rank.mean(image, selem[, ...]) | Return greyscale local mean of an image. |
skimage.filter.rank.mean_bilateral(image, selem) | Apply a flat kernel bilateral filter. |
skimage.filter.rank.mean_percentile(image, selem) | Return greyscale local mean of an image. |
skimage.filter.rank.meansubtraction(*args, ...) | Deprecated function. Use subtract_mean instead. |
skimage.filter.rank.median(image, selem[, ...]) | Return greyscale local median of an image. |
skimage.filter.rank.minimum(image, selem[, ...]) | Return greyscale local minimum of an image. |
skimage.filter.rank.modal(image, selem[, ...]) | Return greyscale local mode of an image. |
skimage.filter.rank.morph_contr_enh(*args, ...) | Deprecated function. Use enhance_contrast instead. |
skimage.filter.rank.noise_filter(image, selem) | Returns the noise feature as described in [Hashimoto12] |
skimage.filter.rank.otsu(image, selem[, ...]) | Returns the Otsu’s threshold value for each pixel. |
skimage.filter.rank.percentile(image, selem) | Return greyscale local percentile of an image. |
skimage.filter.rank.percentile_autolevel(...) | Deprecated function. Use autolevel_percentile instead. |
skimage.filter.rank.percentile_gradient(...) | Deprecated function. Use gradient_percentile instead. |
skimage.filter.rank.percentile_mean(*args, ...) | Deprecated function. Use mean_percentile instead. |
skimage.filter.rank.percentile_mean_subtraction(...) | Deprecated function. Use subtract_mean_percentile instead. |
skimage.filter.rank.percentile_morph_contr_enh(...) | Deprecated function. Use enhance_contrast_percentile instead. |
skimage.filter.rank.percentile_pop(*args, ...) | Deprecated function. Use pop_percentile instead. |
skimage.filter.rank.percentile_threshold(...) | Deprecated function. Use threshold_percentile instead. |
skimage.filter.rank.pop(image, selem[, out, ...]) | Return the number (population) of pixels actually inside the neighborhood. |
skimage.filter.rank.pop_bilateral(image, selem) | Return the number (population) of pixels actually inside the bilateral neighborhood, i.e. |
skimage.filter.rank.pop_percentile(image, selem) | Return greyscale local pop of an image. |
skimage.filter.rank.subtract_mean(image, selem) | Return image subtracted from its local mean. |
skimage.filter.rank.subtract_mean_percentile(...) | Return greyscale local subtract_mean of an image. |
skimage.filter.rank.threshold(image, selem) | Return greyscale local threshold of an image. |
skimage.filter.rank.threshold_percentile(...) | Return greyscale local threshold of an image. |
skimage.filter.rank.tophat(image, selem[, ...]) | Return greyscale local tophat of an image. |
Autolevel image using local histogram.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Examples
>>> from skimage import data
>>> from skimage.morphology import disk
>>> from skimage.filter.rank import autolevel
>>> # Load test image
>>> ima = data.camera()
>>> # Stretch image contrast locally
>>> auto = autolevel(ima, disk(20))
Return greyscale local autolevel of an image.
Autolevel is computed on the given structuring element. Only levels between percentiles [p0, p1] are used.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Deprecated function. Use mean_bilateral instead.
Apply a flat kernel bilateral filter.
This is an edge-preserving and noise reducing denoising filter. It averages pixels based on their spatial closeness and radiometric similarity.
Spatial closeness is measured by considering only the local pixel neighborhood given by a structuring element (selem).
Radiometric similarity is defined by the greylevel interval [g-s0, g+s1] where g is the current pixel greylevel. Only pixels belonging to the structuring element AND having a greylevel inside this interval are averaged. Return greyscale local bilateral_mean of an image.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
s0, s1 : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
See also
Examples
>>> from skimage import data
>>> from skimage.morphology import disk
>>> from skimage.filter.rank import bilateral_mean
>>> # Load test image / cast to uint16
>>> ima = data.camera().astype(np.uint16)
>>> # bilateral filtering of cameraman image using a flat kernel
>>> bilat_ima = bilateral_mean(ima, disk(20), s0=10,s1=10)
Deprecated function. Use pop_bilateral instead.
Return the number (population) of pixels actually inside the bilateral neighborhood, i.e. being inside the structuring element AND having a gray level inside the interval [g-s0, g+s1].
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
s0, s1 : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Examples
>>> # Local mean
>>> from skimage.morphology import square
>>> import skimage.filter.rank as rank
>>> ima16 = 255 * np.array([[0, 0, 0, 0, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint16)
>>> rank.bilateral_pop(ima16, square(3), s0=10,s1=10)
array([[3, 4, 3, 4, 3],
[4, 4, 6, 4, 4],
[3, 6, 9, 6, 3],
[4, 4, 6, 4, 4],
[3, 4, 3, 4, 3]], dtype=uint16)
Returns greyscale local bottomhat of an image.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
|
---|---|
Returns: | bottomhat : ndarray (same dtype as input image)
|
Enhance an image replacing each pixel by the local maximum if pixel greylevel is closest to maximimum than local minimum OR local minimum otherwise.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
Returns :
out : ndarray (same dtype as input image)
|
---|
Examples
>>> from skimage import data
>>> from skimage.morphology import disk
>>> from skimage.filter.rank import enhance_contrast
>>> # Load test image
>>> ima = data.camera()
>>> # Local mean
>>> avg = enhance_contrast(ima, disk(20))
Return greyscale local enhance_contrast of an image.
enhance_contrast is computed on the given structuring element. Only levels between percentiles [p0, p1] are used.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Returns the entropy [R146] computed locally. Entropy is computed using base 2 logarithm i.e. the filter returns the minimum number of bits needed to encode local greylevel distribution.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
|
---|---|
Returns: | out : ndarray (double)
|
References
[R146] | (1, 2) http://en.wikipedia.org/wiki/Entropy_(information_theory)> |
Examples
>>> # Local entropy
>>> from skimage import data
>>> from skimage.filter.rank import entropy
>>> from skimage.morphology import disk
>>> a8 = data.camera()
>>> ent8 = entropy(a8, disk(5))
Equalize image using local histogram.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Examples
>>> from skimage import data
>>> from skimage.morphology import disk
>>> from skimage.filter.rank import equalize
>>> # Load test image
>>> ima = data.camera()
>>> # Local equalization
>>> equ = equalize(ima, disk(20))
Return greyscale local gradient of an image (i.e. local maximum - local minimum).
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Return greyscale local gradient of an image.
gradient is computed on the given structuring element. Only levels between percentiles [p0, p1] are used.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Return greyscale local maximum of an image.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
See also
Return greyscale local mean of an image.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Examples
>>> from skimage import data
>>> from skimage.morphology import disk
>>> from skimage.filter.rank import mean
>>> # Load test image
>>> ima = data.camera()
>>> # Local mean
>>> avg = mean(ima, disk(20))
Apply a flat kernel bilateral filter.
This is an edge-preserving and noise reducing denoising filter. It averages pixels based on their spatial closeness and radiometric similarity.
Spatial closeness is measured by considering only the local pixel neighborhood given by a structuring element (selem).
Radiometric similarity is defined by the greylevel interval [g-s0, g+s1] where g is the current pixel greylevel. Only pixels belonging to the structuring element AND having a greylevel inside this interval are averaged. Return greyscale local bilateral_mean of an image.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
s0, s1 : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
See also
Examples
>>> from skimage import data
>>> from skimage.morphology import disk
>>> from skimage.filter.rank import bilateral_mean
>>> # Load test image / cast to uint16
>>> ima = data.camera().astype(np.uint16)
>>> # bilateral filtering of cameraman image using a flat kernel
>>> bilat_ima = bilateral_mean(ima, disk(20), s0=10,s1=10)
Return greyscale local mean of an image.
Mean is computed on the given structuring element. Only levels between percentiles [p0, p1] are used.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Deprecated function. Use subtract_mean instead.
Return image subtracted from its local mean.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Return greyscale local median of an image.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Examples
>>> from skimage import data
>>> from skimage.morphology import disk
>>> from skimage.filter.rank import median
>>> # Load test image
>>> ima = data.camera()
>>> # Local mean
>>> avg = median(ima, disk(20))
Return greyscale local minimum of an image.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
See also
Return greyscale local mode of an image.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Deprecated function. Use enhance_contrast instead.
Enhance an image replacing each pixel by the local maximum if pixel greylevel is closest to maximimum than local minimum OR local minimum otherwise.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
Returns :
out : ndarray (same dtype as input image)
|
---|
Examples
>>> from skimage import data
>>> from skimage.morphology import disk
>>> from skimage.filter.rank import enhance_contrast
>>> # Load test image
>>> ima = data.camera()
>>> # Local mean
>>> avg = enhance_contrast(ima, disk(20))
Returns the noise feature as described in [Hashimoto12]
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
References
[Hashimoto12] | (1, 2, 3) N. Hashimoto et al. Referenceless image quality evaluation for whole slide imaging. J Pathol Inform 2012;3:9. |
Returns the Otsu’s threshold value for each pixel.
Parameters: | image : ndarray
selem : ndarray
out : ndarray
mask : ndarray
shift_x, shift_y : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
References
[otsu] | http://en.wikipedia.org/wiki/Otsu’s_method |
Examples
>>> # Local entropy
>>> from skimage import data
>>> from skimage.filter.rank import otsu
>>> from skimage.morphology import disk
>>> # defining a 8-bit test images
>>> a8 = data.camera()
>>> loc_otsu = otsu(a8, disk(5))
>>> thresh_image = a8 >= loc_otsu
Return greyscale local percentile of an image.
percentile is computed on the given structuring element. Returns the value of the p0 lower percentile of the neighborhood value distribution.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
p0 : float in [0, ..., 1]
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Deprecated function. Use autolevel_percentile instead.
Return greyscale local autolevel of an image.
Autolevel is computed on the given structuring element. Only levels between percentiles [p0, p1] are used.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Deprecated function. Use gradient_percentile instead.
Return greyscale local gradient of an image.
gradient is computed on the given structuring element. Only levels between percentiles [p0, p1] are used.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Deprecated function. Use mean_percentile instead.
Return greyscale local mean of an image.
Mean is computed on the given structuring element. Only levels between percentiles [p0, p1] are used.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Deprecated function. Use subtract_mean_percentile instead.
Return greyscale local subtract_mean of an image.
subtract_mean is computed on the given structuring element. Only levels between percentiles [p0, p1] are used.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Deprecated function. Use enhance_contrast_percentile instead.
Return greyscale local enhance_contrast of an image.
enhance_contrast is computed on the given structuring element. Only levels between percentiles [p0, p1] are used.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Deprecated function. Use pop_percentile instead.
Return greyscale local pop of an image.
pop is computed on the given structuring element. Only levels between percentiles [p0, p1] are used.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Deprecated function. Use threshold_percentile instead.
Return greyscale local threshold of an image.
threshold is computed on the given structuring element. Returns thresholded image such that pixels having a higher value than the the p0 percentile of the neighborhood value distribution are set to 2^nbit-1 (e.g. 255 for 8bit image).
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
p0 : float in [0, ..., 1]
local threshold : ndarray (same dtype as input)
|
---|
Return the number (population) of pixels actually inside the neighborhood.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Examples
>>> # Local mean
>>> from skimage.morphology import square
>>> import skimage.filter.rank as rank
>>> ima = 255 * np.array([[0, 0, 0, 0, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint8)
>>> rank.pop(ima, square(3))
array([[4, 6, 6, 6, 4],
[6, 9, 9, 9, 6],
[6, 9, 9, 9, 6],
[6, 9, 9, 9, 6],
[4, 6, 6, 6, 4]], dtype=uint8)
Return the number (population) of pixels actually inside the bilateral neighborhood, i.e. being inside the structuring element AND having a gray level inside the interval [g-s0, g+s1].
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
s0, s1 : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Examples
>>> # Local mean
>>> from skimage.morphology import square
>>> import skimage.filter.rank as rank
>>> ima16 = 255 * np.array([[0, 0, 0, 0, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint16)
>>> rank.bilateral_pop(ima16, square(3), s0=10,s1=10)
array([[3, 4, 3, 4, 3],
[4, 4, 6, 4, 4],
[3, 6, 9, 6, 3],
[4, 4, 6, 4, 4],
[3, 4, 3, 4, 3]], dtype=uint16)
Return greyscale local pop of an image.
pop is computed on the given structuring element. Only levels between percentiles [p0, p1] are used.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Return image subtracted from its local mean.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Return greyscale local subtract_mean of an image.
subtract_mean is computed on the given structuring element. Only levels between percentiles [p0, p1] are used.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Return greyscale local threshold of an image.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|
Examples
>>> # Local threshold
>>> from skimage.morphology import square
>>> from skimage.filter.rank import threshold
>>> ima = 255 * np.array([[0, 0, 0, 0, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint8)
>>> threshold(ima, square(3))
array([[0, 0, 0, 0, 0],
[0, 1, 1, 1, 0],
[0, 1, 0, 1, 0],
[0, 1, 1, 1, 0],
[0, 0, 0, 0, 0]], dtype=uint8)
Return greyscale local threshold of an image.
threshold is computed on the given structuring element. Returns thresholded image such that pixels having a higher value than the the p0 percentile of the neighborhood value distribution are set to 2^nbit-1 (e.g. 255 for 8bit image).
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
p0 : float in [0, ..., 1]
local threshold : ndarray (same dtype as input)
|
---|
Return greyscale local tophat of an image.
Parameters: | image : ndarray (uint8, uint16)
selem : ndarray
out : ndarray (same dtype as input)
mask : ndarray
shift_x, shift_y : int
|
---|---|
Returns: | out : ndarray (same dtype as input image)
|