ix, iy = np.argwhere((Ax == Bxmin) & (Ay == Bymin))[0]
assert np.all(Ax[ix:ix + Bx.shape[0], iy:iy + Bx.shape[1]] == Bx)
assert np.all(Ay[ix:ix + Bx.shape[0], iy:iy + Bx.shape[1]] == By)
Where do two 2-D arrays begin to overlap each other?