Factor some stuff and write edge img
Average tensor from edge endpoints
6-point stencil test
Further work on Boykov-Kolmogorov