skimage.filter.rank.autolevel | Autolevel image using local histogram. |
skimage.filter.rank.bilateral_mean | Apply a flat kernel bilateral filter. |
skimage.filter.rank.bilateral_pop | Return the number (population) of pixels actually inside the bilateral neighborhood, i.e. |
skimage.filter.rank.bottomhat | Returns greyscale local bottomhat of an image. |
skimage.filter.rank.entropy | Returns the entropy [wiki_entropy] computed locally. |
skimage.filter.rank.equalize | Equalize image using local histogram. |
skimage.filter.rank.gradient | Return greyscale local gradient of an image (i.e. |
skimage.filter.rank.maximum | Return greyscale local maximum of an image. |
skimage.filter.rank.mean | Return greyscale local mean of an image. |
skimage.filter.rank.meansubstraction | Return image substracted from its local mean. |
skimage.filter.rank.median | Return greyscale local median of an image. |
skimage.filter.rank.minimum | Return greyscale local minimum of an image. |
skimage.filter.rank.modal | Return greyscale local mode of an image. |
skimage.filter.rank.morph_contr_enh | Enhance an image replacing each pixel by the local maximum if pixel |
skimage.filter.rank.noise_filter | Returns the noise feature as described in [Hashimoto12] |
skimage.filter.rank.otsu | Returns the Otsu’s threshold value for each pixel. |
skimage.filter.rank.percentile | Return greyscale local percentile of an image. |
skimage.filter.rank.percentile_autolevel | Return greyscale local autolevel of an image. |
skimage.filter.rank.percentile_gradient | Return greyscale local percentile_gradient of an image. |
skimage.filter.rank.percentile_mean | Return greyscale local mean of an image. |
skimage.filter.rank.percentile_mean_substraction | Return greyscale local mean_substraction of an image. |
skimage.filter.rank.percentile_morph_contr_enh | Return greyscale local morph_contr_enh of an image. |
skimage.filter.rank.percentile_pop | Return greyscale local pop of an image. |
skimage.filter.rank.percentile_threshold | Return greyscale local threshold of an image. |
skimage.filter.rank.pop | Return the number (population) of pixels actually inside the neighborhood. |
skimage.filter.rank.threshold | Return greyscale local threshold of an image. |
skimage.filter.rank.tophat | Return greyscale local tophat of an image. |
Autolevel image using local histogram.
Parameters : | image : ndarray
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
|
---|---|
Returns : | out : uint8 array or uint16 array (same 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))
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
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : (int)
s0, s1 : int
|
---|---|
Returns : | out : uint16 array
|
See also
Notes
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 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
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : (int)
s0, s1 : int
|
---|---|
Returns : | out : uint16 array
|
Notes
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
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
|
---|---|
Returns : | local bottomhat : uint8 array or uint16 array depending on input image
|
Returns the entropy [wiki_entropy] 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
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
|
---|---|
Returns : | out : uint8 array or uint16 array (same as input image)
|
References
[wiki_entropy] | (1, 2, 3) 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
>>> # defining a 8- and a 16-bit test images
>>> a8 = data.camera()
>>> a16 = data.camera().astype(np.uint16) * 4
>>> # pixel values contain 10x the local entropy
>>> ent8 = entropy(a8, disk(5))
>>> # pixel values contain 1000x the local entropy
>>> ent16 = entropy(a16, disk(5))
Equalize image using local histogram.
Parameters : | image : ndarray
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
|
---|---|
Returns : | out : uint8 array or uint16 array (same 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
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
|
---|---|
Returns : | out : uint8 array or uint16 array (same as input image)
|
Return greyscale local maximum of an image.
Parameters : | image : ndarray
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
|
---|---|
Returns : | out : uint8 array or uint16 array (same as input image)
|
See also
Return greyscale local mean of an image.
Parameters : | image : ndarray
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
|
---|---|
Returns : | out : uint8 array or uint16 array (same 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))
Return image substracted from its local mean.
Parameters : | image : ndarray
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
|
---|---|
Returns : | out : uint8 array or uint16 array (same as input image)
|
Return greyscale local median of an image.
Parameters : | image : ndarray
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
|
---|---|
Returns : | out : uint8 array or uint16 array (same 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
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
|
---|---|
Returns : | out : uint8 array or uint16 array (same as input image)
|
See also
Return greyscale local mode of an image.
Parameters : | image : ndarray
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
|
---|---|
Returns : | out : uint8 array or uint16 array (same 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
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
|
---|---|
Returns : | out : uint8 array or uint16 array (same as input image)
|
Examples
>>> from skimage import data
>>> from skimage.morphology import disk
>>> from skimage.filter.rank import morph_contr_enh
>>> # Load test image
>>> ima = data.camera()
>>> # Local mean
>>> avg = morph_contr_enh(ima, disk(20))
Returns the noise feature as described in [Hashimoto12]
Parameters : | image : ndarray
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
|
---|---|
Returns : | out : uint8 array or uint16 array (same 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 (uint8)
shift_x, shift_y : int
|
---|---|
Returns : | out : uint8 array
|
Notes
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. Only levels between percentiles [p0, p1] are used.
Parameters : | image : ndarray
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns : | local percentile : uint8 array or uint16
|
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
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns : | local autolevel : uint8 array or uint16
|
Return greyscale local percentile_gradient of an image.
percentile_gradient is computed on the given structuring element. Only levels between percentiles [p0, p1] are used.
Parameters : | image : ndarray
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns : | local percentile_gradient : uint8 array or uint16
|
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
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns : | local mean : uint8 array or uint16
|
Return greyscale local mean_substraction of an image.
mean_substraction is computed on the given structuring element. Only levels between percentiles [p0, p1] are used.
Parameters : | image : ndarray
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns : | local mean_substraction : uint8 array or uint16
|
Return greyscale local morph_contr_enh of an image.
morph_contr_enh is computed on the given structuring element. Only levels between percentiles [p0, p1] are used.
Parameters : | image : ndarray
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns : | local morph_contr_enh : uint8 array or 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
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns : | local pop : uint8 array or uint16
|
Return greyscale local threshold of an image.
threshold is computed on the given structuring element. Only levels between percentiles [p0, p1] are used.
Parameters : | image : ndarray
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
p0, p1 : float in [0, ..., 1]
|
---|---|
Returns : | local threshold : uint8 array or uint16
|
Return the number (population) of pixels actually inside the neighborhood.
Parameters : | image : ndarray
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
|
---|---|
Returns : | out : uint8 array or uint16 array (same 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 greyscale local threshold of an image.
Parameters : | image : ndarray
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
|
---|---|
Returns : | out : uint8 array or uint16 array (same 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 tophat of an image.
Parameters : | image : ndarray
selem : ndarray
out : ndarray
mask : ndarray (uint8)
shift_x, shift_y : int
|
---|---|
Returns : | out : uint8 array or uint16 array (same as input image)
|