Created
October 5, 2019 10:19
-
-
Save joelbarmettlerUZH/6c937fb69be04c077faea9b54ca007ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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