Duplicate.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # import
  2. # ------------------------------------------------------------------------------------------
  3. from . import Processing
  4. import copy
  5. import numpy as np
  6. # ------------------------------------------------------------------------------------------
  7. # MIAM project 2020
  8. # ------------------------------------------------------------------------------------------
  9. # author: remi.cozot@univ-littoral.fr
  10. # ------------------------------------------------------------------------------------------
  11. class Duplicate(Processing.Processing):
  12. """description of class"""
  13. def __init__(self):
  14. pass
  15. def compute(self, img, **kwargs):
  16. """
  17. Duplicate image
  18. """
  19. nbDuplicate = 1
  20. if not kwargs: kwargs = {'nb': 1}
  21. # number of duplicate
  22. if 'nb' in kwargs:
  23. # auto or manual mode
  24. nbDuplicate = kwargs['nb']
  25. else:
  26. # if not auto in kwargs -> manual mode
  27. nbDuplicate = 1
  28. res = []
  29. for i in range(nbDuplicate):
  30. res.append(copy.deepcopy(img))
  31. return res