Skip to content

Instantly share code, notes, and snippets.

@joelbarmettlerUZH
Created October 5, 2019 10:19
Show Gist options
  • Save joelbarmettlerUZH/6c937fb69be04c077faea9b54ca007ac to your computer and use it in GitHub Desktop.
Save joelbarmettlerUZH/6c937fb69be04c077faea9b54ca007ac to your computer and use it in GitHub Desktop.
@staticmethod
def normalizeBinary(image):
for column in image:
for pixel in range(len(column)):
total_color = 0
for color in column[pixel]:
total_color += color
if total_color/3 < 255/2:
column[pixel] = 0
else:
column[pixel] = 1
return image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment