Skip to content
Snippets Groups Projects
Commit 98c9cb74 authored by Jayke Meijer's avatar Jayke Meijer
Browse files

Commented GaussianFilter class.

parent 239b4ab8
No related branches found
No related tags found
No related merge requests found
# Gaussian Filter Class for use with License Plate Recognition with
# Local Binary Patterns.
#
# Authors: Taddeüs Kroes
# Jayke Meijer
# Fabiën Tesselaar
# Richard Torenvliet
# Gijs van der Voort
from GrayscaleImage import GrayscaleImage
from scipy.ndimage import gaussian_filter
class GaussianFilter:
"""This class can apply a Gaussian blur on an image."""
def __init__(self, scale):
"""Create a GaussianFilter object with a given scale."""
self.scale = scale
def get_filtered_copy(self, image):
......@@ -12,12 +23,15 @@ class GaussianFilter:
return GrayscaleImage(None, image)
def filter(self, image):
"""Apply a Gaussian blur on the image data."""
image.data = gaussian_filter(image.data, self.scale)
def get_scale(self):
return self.scale
"""Return the scale of the Gaussian kernel."""
return self.scale
def set_scale(self, scale):
"""Set the scale of the Gaussian kernel."""
self.scale = float(scale)
scale = property(get_scale, set_scale)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment