20 lines
418 B
Python
20 lines
418 B
Python
from scipy import misc
|
|
|
|
image = misc.imread('LWTC5q8.png')
|
|
|
|
d = 9
|
|
total = 0
|
|
for y in range(85):
|
|
counter = 0
|
|
value = 0
|
|
for x in range(30):
|
|
if image[x+1,y+5,0] == 0:
|
|
counter += 1
|
|
value += 2**x
|
|
if counter > 3:
|
|
length = len(str(abs(value)))+ len(str(abs(y - d)))
|
|
if y - d == 0: length -= 2
|
|
total += length
|
|
print('%2d %2d %9d %2d' % (counter, length, value, y - d))
|
|
#print(total, d)
|