mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-04 13:14:23 +08:00
Added default value to gaussian filter (sigma parameter)
This commit is contained in:
@@ -9,7 +9,7 @@ from .._shared.utils import warn
|
||||
__all__ = ['gaussian']
|
||||
|
||||
|
||||
def gaussian(image, sigma, output=None, mode='nearest', cval=0,
|
||||
def gaussian(image, sigma=1, output=None, mode='nearest', cval=0,
|
||||
multichannel=None):
|
||||
"""Multi-dimensional Gaussian filter
|
||||
|
||||
@@ -17,7 +17,7 @@ def gaussian(image, sigma, output=None, mode='nearest', cval=0,
|
||||
----------
|
||||
image : array-like
|
||||
input image (grayscale or color) to filter.
|
||||
sigma : scalar or sequence of scalars
|
||||
sigma : scalar or sequence of scalars, optional
|
||||
standard deviation for Gaussian kernel. The standard
|
||||
deviations of the Gaussian filter are given for each axis as a
|
||||
sequence, or as a single number, in which case it is equal for
|
||||
|
||||
@@ -19,6 +19,12 @@ def test_null_sigma():
|
||||
assert np.all(gaussian(a, 0) == a)
|
||||
|
||||
|
||||
def test_default_sigma():
|
||||
a = np.zeros((3, 3))
|
||||
a[1, 1] = 1.
|
||||
assert np.all(gaussian(a) == gaussian(a, sigma=1))
|
||||
|
||||
|
||||
def test_energy_decrease():
|
||||
a = np.zeros((3, 3))
|
||||
a[1, 1] = 1.
|
||||
|
||||
Reference in New Issue
Block a user