Dynamic programming
Evaluate best cumulative cost at each pixel
0
0
0
0
0
1
1
1
1
1