Commit 1f4813bb authored by Jayke Meijer's avatar Jayke Meijer

Removed now obsolete function from GaussianFilter

parent faf30fd9
...@@ -7,24 +7,6 @@ class GaussianFilter: ...@@ -7,24 +7,6 @@ class GaussianFilter:
def __init__(self, scale): def __init__(self, scale):
self.scale = scale self.scale = scale
def gaussian(self, x):
"""Return the value of a 1D Gaussian function for a given x."""
return exp(-(x ** 2 / (2 * self.scale ** 2))) \
/ (sqrt(2 * pi) * self.scale)
def get_1d_gaussian_kernel(self):
"""Sample a one-dimensional Gaussian function of scale s."""
radius = int(ceil(3 * self.scale))
size = 2 * radius + 1
result = zeros(size)
# Sample the Gaussian function
result = array([self.gaussian(x - radius) for x in xrange(size)])
# The sum of all kernel values is equal to one
result /= result.sum()
return result
def get_filtered_copy(self, image): def get_filtered_copy(self, image):
"""Apply a gaussian blur to an image, to suppress noise.""" """Apply a gaussian blur to an image, to suppress noise."""
image = gaussian_filter(image.data, self.scale) image = gaussian_filter(image.data, self.scale)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment