Fuse.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # import
  2. # ------------------------------------------------------------------------------------------
  3. from . import Processing
  4. from . import ColorSpaceTransform
  5. from .. import image
  6. import colour, copy, skimage
  7. import numpy as np
  8. # ------------------------------------------------------------------------------------------
  9. # MIAM project 2020
  10. # ------------------------------------------------------------------------------------------
  11. # author: remi.cozot@univ-littoral.fr
  12. # ------------------------------------------------------------------------------------------
  13. class Fuse(Processing.Processing):
  14. """description of class"""
  15. def __init__(self):
  16. pass
  17. def compute(self, img, **kwargs):
  18. """
  19. Add([img], {})
  20. !! assert !! len([img]) = 2
  21. img[0] + img[1]
  22. """
  23. # kwargs
  24. if isinstance(img,list) :
  25. res = copy.deepcopy(img[0])
  26. if len(img) > 1: # at least two images in the list
  27. for image in img[1:]:
  28. res= res+image
  29. else: # not list
  30. res = copy.deepcopy(img)
  31. return res