Given two binary images of the same dimensions,
generate an interpolated image that sits somewhere
in between, as specified by the weight.
For each binary image, the edges are found
and then each pixel is assigned a distance to the nearest edge.
Inside, distance values are positive; outside, negative.
Then both processed images are compared, and wherever
the weighted sum is larger than zero, the result image
gets a pixel set to true (or white, meaning inside).
A weight of zero means that the first image is not present at all
in the interpolated image;
a weight of one means that the first image is present exclusively.
The code was originally created by Johannes Schindelin
in the VIB's vib.BinaryInterpolator class, for ij.ImagePlus.