This function computes the area of the overlap between the two
windows A and B.
If one of the windows is a binary mask, then both windows
are converted to masks on the same grid, and the area is
computed by counting pixels. Otherwise, the area is computed
analytically (using the discrete Stokes theorem).