Autofocus: gradient descent
The original autofocus algorithm was not entirely clear: my rewrite attempt was worse than the original.
This is a rewrite that replaces it with a gradient descent version.
Probably not immediately clearer than the original and not strictly more successful, but more explained.
Adding as a WIP: pieces of this will be necessary to restructure millipixels in general.
Edited by Dorota Czaplejewicz