Added default value to gaussian filter (sigma parameter)

This commit is contained in:
emmanuelle
2016-06-19 09:38:36 +02:00
parent f9940b18a2
commit b0437045ed
2 changed files with 8 additions and 2 deletions
+2 -2
View File
@@ -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
+6
View File
@@ -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.