Commit b4af023e authored by Michael Keller's avatar Michael Keller
Browse files

working version definite

parent 73d41984
x = 1
y = 9
R = lambda a, b: 1 if abs(a - b) <= 1 else 0
dist = [1,1,1,1,1,1,1,1,1]
y = 4
R = lambda a, b: 1 if abs(a - b) == 0 else 0
dist = [2,2]
numb_crops = len(dist)
......@@ -44,17 +45,27 @@ def score(field):
for i in range(x):
for j in range(y):
score += scorePixel(field, (i, j))
print((i, j), scorePixel(field, (i, j)))
return score
x0 = [1.0, 1.0, 1.0, 4.590202509439396e-12, 4.590202509439396e-12, 4.590202509439396e-12, 4.590202509439396e-12, 4.590202509439396e-12, 4.590202509439396e-12, -1.0476920291210941e-13, 8.70963648832408e-12, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, 1.0000000281552288, 1.0000000096375863, 0.9999999622071887, 4.590202509557559e-12, 4.590202509415376e-12, 4.590202509733667e-12, 4.590202509529271e-12, 4.590202509636449e-12, 4.590202509723023e-12, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13, -1.0476920291210941e-13]
x0 = [0.5, 0.5,
0.5, 0.5,
0.5, 0.5,
0.5, 0.5]
print("Sum: ", sum(x0))
print("Score: ", score(x0))
for c in range(9):
for p in range(x * y):
s = 0
for v in range(len(dist)):
s += x0[len(dist) * p + v]
print("Pixel", p, ", Sum:", s)
for c in range(len(dist)):
s = 0
for i, v in enumerate(x0):
if i % 9 == c:
if i % (len(dist)) == c:
s += v
print("Crop ", c, ", Sum: ", s)
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment