Ymap.py 1.1 KB

123456789101112131415161718192021222324252627282930
  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 Ymap(Processing.Processing):
  14. """description of class"""
  15. def __init__(self):
  16. pass
  17. def compute(self, img, **kwargs):
  18. res = copy.deepcopy(img)
  19. if kwargs and ('oldY' in kwargs) and ('newY' in kwargs):
  20. Yold = kwargs['oldY']
  21. Ynew = kwargs['newY']
  22. res.colorData[:,:,0] = res.colorData[:,:,0]*Ynew/Yold
  23. res.colorData[:,:,1] = res.colorData[:,:,1]*Ynew/Yold
  24. res.colorData[:,:,2] = res.colorData[:,:,2]*Ynew/Yold
  25. return res