Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. @staticmethod
  2. def normalizeBinary(image):
  3. for column in image:
  4. for pixel in range(len(column)):
  5. total_color = 0
  6. for color in column[pixel]:
  7. total_color += color
  8. if total_color/3 < 255/2:
  9. column[pixel] = 0
  10. else:
  11. column[pixel] = 1
  12. return image
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement