mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-03 18:06:42 +08:00
Merge pull request #581 from ankit-maverick/subtract
STY: Replacing every occurence of ``substract*`` with ``subtract*``.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
from .rank import (autolevel, bottomhat, equalize, gradient, maximum, mean,
|
||||
meansubstraction, median, minimum, modal, morph_contr_enh,
|
||||
meansubtraction, median, minimum, modal, morph_contr_enh,
|
||||
pop, threshold, tophat, noise_filter, entropy, otsu)
|
||||
from .percentile_rank import (percentile_autolevel, percentile_gradient,
|
||||
percentile_mean, percentile_mean_substraction,
|
||||
percentile_mean, percentile_mean_subtraction,
|
||||
percentile_morph_contr_enh, percentile,
|
||||
percentile_pop, percentile_threshold)
|
||||
from .bilateral_rank import bilateral_mean, bilateral_pop
|
||||
@@ -14,7 +14,7 @@ __all__ = ['autolevel',
|
||||
'gradient',
|
||||
'maximum',
|
||||
'mean',
|
||||
'meansubstraction',
|
||||
'meansubtraction',
|
||||
'median',
|
||||
'minimum',
|
||||
'modal',
|
||||
@@ -28,7 +28,7 @@ __all__ = ['autolevel',
|
||||
'percentile_autolevel',
|
||||
'percentile_gradient',
|
||||
'percentile_mean',
|
||||
'percentile_mean_substraction',
|
||||
'percentile_mean_subtraction',
|
||||
'percentile_morph_contr_enh',
|
||||
'percentile',
|
||||
'percentile_pop',
|
||||
|
||||
@@ -126,7 +126,7 @@ cdef inline dtype_t kernel_mean(Py_ssize_t * histo, float pop,
|
||||
return <dtype_t>(0)
|
||||
|
||||
|
||||
cdef inline dtype_t kernel_meansubstraction(Py_ssize_t * histo,
|
||||
cdef inline dtype_t kernel_meansubtraction(Py_ssize_t * histo,
|
||||
float pop,
|
||||
dtype_t g,
|
||||
Py_ssize_t bitdepth,
|
||||
@@ -341,12 +341,12 @@ def mean(cnp.ndarray[dtype_t, ndim=2] image,
|
||||
bitdepth, 0, 0, <Py_ssize_t>0, <Py_ssize_t>0)
|
||||
|
||||
|
||||
def meansubstraction(cnp.ndarray[dtype_t, ndim=2] image,
|
||||
def meansubtraction(cnp.ndarray[dtype_t, ndim=2] image,
|
||||
cnp.ndarray[cnp.uint8_t, ndim=2] selem,
|
||||
cnp.ndarray[cnp.uint8_t, ndim=2] mask=None,
|
||||
cnp.ndarray[dtype_t, ndim=2] out=None,
|
||||
char shift_x=0, char shift_y=0, Py_ssize_t bitdepth=8):
|
||||
_core16(kernel_meansubstraction, image, selem, mask, out, shift_x, shift_y,
|
||||
_core16(kernel_meansubtraction, image, selem, mask, out, shift_x, shift_y,
|
||||
bitdepth, 0, 0, <Py_ssize_t>0, <Py_ssize_t>0)
|
||||
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ cdef inline dtype_t kernel_mean(Py_ssize_t * histo, float pop,
|
||||
return <dtype_t>(0)
|
||||
|
||||
|
||||
cdef inline dtype_t kernel_mean_substraction(Py_ssize_t * histo,
|
||||
cdef inline dtype_t kernel_mean_subtraction(Py_ssize_t * histo,
|
||||
float pop,
|
||||
dtype_t g,
|
||||
Py_ssize_t bitdepth,
|
||||
@@ -269,7 +269,7 @@ def mean(cnp.ndarray[dtype_t, ndim=2] image,
|
||||
bitdepth, p0, p1, <Py_ssize_t>0, <Py_ssize_t>0)
|
||||
|
||||
|
||||
def mean_substraction(cnp.ndarray[dtype_t, ndim=2] image,
|
||||
def mean_subtraction(cnp.ndarray[dtype_t, ndim=2] image,
|
||||
cnp.ndarray[cnp.uint8_t, ndim=2] selem,
|
||||
cnp.ndarray[cnp.uint8_t, ndim=2] mask=None,
|
||||
cnp.ndarray[dtype_t, ndim=2] out=None,
|
||||
@@ -278,7 +278,7 @@ def mean_substraction(cnp.ndarray[dtype_t, ndim=2] image,
|
||||
"""return original - mean between [p0 and p1] percentiles *.5 +127
|
||||
"""
|
||||
_core16(
|
||||
kernel_mean_substraction, image, selem, mask, out, shift_x, shift_y,
|
||||
kernel_mean_subtraction, image, selem, mask, out, shift_x, shift_y,
|
||||
bitdepth, p0, p1, <Py_ssize_t>0, <Py_ssize_t>0)
|
||||
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ cdef inline dtype_t kernel_mean(Py_ssize_t * histo, float pop,
|
||||
return <dtype_t>(0)
|
||||
|
||||
|
||||
cdef inline dtype_t kernel_meansubstraction(Py_ssize_t * histo, float pop,
|
||||
cdef inline dtype_t kernel_meansubtraction(Py_ssize_t * histo, float pop,
|
||||
dtype_t g, float p0, float p1,
|
||||
Py_ssize_t s0, Py_ssize_t s1):
|
||||
|
||||
@@ -384,12 +384,12 @@ def mean(cnp.ndarray[dtype_t, ndim=2] image,
|
||||
0, 0, <Py_ssize_t>0, <Py_ssize_t>0)
|
||||
|
||||
|
||||
def meansubstraction(cnp.ndarray[dtype_t, ndim=2] image,
|
||||
def meansubtraction(cnp.ndarray[dtype_t, ndim=2] image,
|
||||
cnp.ndarray[dtype_t, ndim=2] selem,
|
||||
cnp.ndarray[dtype_t, ndim=2] mask=None,
|
||||
cnp.ndarray[dtype_t, ndim=2] out=None,
|
||||
char shift_x=0, char shift_y=0):
|
||||
_core8(kernel_meansubstraction, image, selem, mask, out, shift_x, shift_y,
|
||||
_core8(kernel_meansubtraction, image, selem, mask, out, shift_x, shift_y,
|
||||
0, 0, <Py_ssize_t>0, <Py_ssize_t>0)
|
||||
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ cdef inline dtype_t kernel_mean(Py_ssize_t * histo, float pop,
|
||||
return <dtype_t>(0)
|
||||
|
||||
|
||||
cdef inline dtype_t kernel_mean_substraction(Py_ssize_t * histo,
|
||||
cdef inline dtype_t kernel_mean_subtraction(Py_ssize_t * histo,
|
||||
float pop,
|
||||
dtype_t g,
|
||||
float p0, float p1,
|
||||
@@ -239,14 +239,14 @@ def mean(cnp.ndarray[dtype_t, ndim=2] image,
|
||||
<Py_ssize_t>0, <Py_ssize_t>0)
|
||||
|
||||
|
||||
def mean_substraction(cnp.ndarray[dtype_t, ndim=2] image,
|
||||
def mean_subtraction(cnp.ndarray[dtype_t, ndim=2] image,
|
||||
cnp.ndarray[dtype_t, ndim=2] selem,
|
||||
cnp.ndarray[dtype_t, ndim=2] mask=None,
|
||||
cnp.ndarray[dtype_t, ndim=2] out=None,
|
||||
char shift_x=0, char shift_y=0, float p0=0., float p1=0.):
|
||||
"""return original - mean between [p0 and p1] percentiles *.5 +127
|
||||
"""
|
||||
_core8(kernel_mean_substraction, image, selem, mask, out, shift_x, shift_y,
|
||||
_core8(kernel_mean_subtraction, image, selem, mask, out, shift_x, shift_y,
|
||||
p0, p1, <Py_ssize_t>0, <Py_ssize_t>0)
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ from skimage.filter.rank import _crank16_percentiles, _crank8_percentiles
|
||||
|
||||
|
||||
__all__ = ['percentile_autolevel', 'percentile_gradient',
|
||||
'percentile_mean', 'percentile_mean_substraction',
|
||||
'percentile_mean', 'percentile_mean_subtraction',
|
||||
'percentile_morph_contr_enh', 'percentile', 'percentile_pop',
|
||||
'percentile_threshold']
|
||||
|
||||
@@ -191,11 +191,11 @@ def percentile_mean(image, selem, out=None, mask=None, shift_x=False,
|
||||
shift_y=shift_y, p0=p0, p1=p1)
|
||||
|
||||
|
||||
def percentile_mean_substraction(image, selem, out=None, mask=None,
|
||||
def percentile_mean_subtraction(image, selem, out=None, mask=None,
|
||||
shift_x=False, shift_y=False, p0=.0, p1=1.):
|
||||
"""Return greyscale local mean_substraction of an image.
|
||||
"""Return greyscale local mean_subtraction of an image.
|
||||
|
||||
mean_substraction is computed on the given structuring element. Only levels
|
||||
mean_subtraction is computed on the given structuring element. Only levels
|
||||
between percentiles [p0, p1] are used.
|
||||
|
||||
Parameters
|
||||
@@ -221,13 +221,13 @@ def percentile_mean_substraction(image, selem, out=None, mask=None,
|
||||
|
||||
Returns
|
||||
-------
|
||||
local mean_substraction : uint8 array or uint16
|
||||
The result of the local mean_substraction.
|
||||
local mean_subtraction : uint8 array or uint16
|
||||
The result of the local mean_subtraction.
|
||||
|
||||
"""
|
||||
|
||||
return _apply(_crank8_percentiles.mean_substraction,
|
||||
_crank16_percentiles.mean_substraction,
|
||||
return _apply(_crank8_percentiles.mean_subtraction,
|
||||
_crank16_percentiles.mean_subtraction,
|
||||
image, selem, out=out, mask=mask, shift_x=shift_x,
|
||||
shift_y=shift_y, p0=p0, p1=p1)
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ from skimage.filter.rank.generic import find_bitdepth
|
||||
|
||||
|
||||
__all__ = ['autolevel', 'bottomhat', 'equalize', 'gradient', 'maximum', 'mean',
|
||||
'meansubstraction', 'median', 'minimum', 'modal', 'morph_contr_enh',
|
||||
'meansubtraction', 'median', 'minimum', 'modal', 'morph_contr_enh',
|
||||
'pop', 'threshold', 'tophat', 'noise_filter', 'entropy', 'otsu']
|
||||
|
||||
|
||||
@@ -298,9 +298,9 @@ def mean(image, selem, out=None, mask=None, shift_x=False, shift_y=False):
|
||||
mask=mask, shift_x=shift_x, shift_y=shift_y)
|
||||
|
||||
|
||||
def meansubstraction(image, selem, out=None, mask=None, shift_x=False,
|
||||
def meansubtraction(image, selem, out=None, mask=None, shift_x=False,
|
||||
shift_y=False):
|
||||
"""Return image substracted from its local mean.
|
||||
"""Return image subtracted from its local mean.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@@ -323,11 +323,11 @@ def meansubstraction(image, selem, out=None, mask=None, shift_x=False,
|
||||
Returns
|
||||
-------
|
||||
out : uint8 array or uint16 array (same as input image)
|
||||
The result of the local meansubstraction.
|
||||
The result of the local meansubtraction.
|
||||
|
||||
"""
|
||||
|
||||
return _apply(_crank8.meansubstraction, _crank16.meansubstraction, image,
|
||||
return _apply(_crank8.meansubtraction, _crank16.meansubtraction, image,
|
||||
selem, out=out, mask=mask, shift_x=shift_x, shift_y=shift_y)
|
||||
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ def test_compare_8bit_vs_16bit():
|
||||
assert_array_equal(image8, image16)
|
||||
|
||||
methods = ['autolevel', 'bottomhat', 'equalize', 'gradient', 'maximum',
|
||||
'mean', 'meansubstraction', 'median', 'minimum', 'modal',
|
||||
'mean', 'meansubtraction', 'median', 'minimum', 'modal',
|
||||
'morph_contr_enh', 'pop', 'threshold', 'tophat']
|
||||
|
||||
for method in methods:
|
||||
|
||||
Reference in New Issue
Block a user