LaplaceFilter.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # import
  2. # ------------------------------------------------------------------------------------------
  3. from . import Processing
  4. from .. import image
  5. import colour, copy
  6. from scipy import ndimage
  7. import numpy as np
  8. # ------------------------------------------------------------------------------------------
  9. # MIAM project 2020
  10. # ------------------------------------------------------------------------------------------
  11. # author: remi.cozot@univ-littoral.fr
  12. # ------------------------------------------------------------------------------------------
  13. class LaplaceFilter(Processing.Processing):
  14. """description of class"""
  15. def __init__(self):
  16. pass
  17. def compute(self, img, **kwargs):
  18. """
  19. compute method:
  20. @params:
  21. self - Required: (MIAM.processing.LaplaceFilter)
  22. img: - Required: image on which Laplace is computed (MIAM.image.IMAGE)
  23. kwargs - Optionnal: optionnal parameter (dict)
  24. """
  25. res = copy.deepcopy(img)
  26. # taking into account optional parameters
  27. if kwargs:
  28. pass
  29. else:
  30. pass
  31. # compute lapalce filter
  32. res.colorData = ndimage.laplace(res.colorData, output=None, mode='reflect', cval=0.0)
  33. return res