Advertisement
Francesco-_-

problema 1

Nov 11th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. def equiluminosi(pict1,pict2):
  2. # @param pict1: picture
  3. # @param pict2: picture
  4. # @return bool
  5. for p2 in getPixels(pict2):
  6. for p1 in getPixels(pict1):
  7. if lum(p1,p2) == True :
  8. return True
  9. return False
  10.  
  11. def somma (pix):
  12. # @ param p1: pixel
  13. # @ param p2: pixel
  14. # @return int
  15. Red= getRed(pix)
  16. Blue= getBlue(pix)
  17. Green= getGreen(pix)
  18. sum = Red + Blue + Green
  19. return sum
  20.  
  21. def lum (p1,p2):
  22. if somma (p1) == somma (p2):
  23. return True
  24. else :
  25. return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement