def getIIsum(data, U, B):
    """
    Compute summed area as:
       A=U          Bi=U[0],B[1]
        +----------+
        |          |
        |          |
        +----------+
       C=B[0],U[1]  D=B

    \sum = I(D) - I(A) + I(Bi) + I(C)
    """
    if (U == B):
        return data[U]
    else:
        return (data[B] + data[U]) - (data[U[0], B[1]] + data[B[0], U[1]])