* A somewhat tricky function to approximate the distance to an edge in a * certain pixel, with consideration to either the local gradient (gx,gy) * or the direction to the pixel (dx,dy) and the pixel greyscale value a. * The latter alternative, using (dx,dy), is the metric used by edtaa2(). * Using a local estimate of the edge gradient (gx,gy) yields much better * accuracy at and near edges,