22 lines
449 B
Python
22 lines
449 B
Python
|
from scipy import misc
|
||
|
|
||
|
image = misc.imread('LWTC5q8.png')
|
||
|
|
||
|
d = 76
|
||
|
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 > 0:
|
||
|
if y < 30:
|
||
|
continue
|
||
|
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)
|