def integral_image(image):
    """Create an integral image on the first 2 dimensions from the input.
    Args:
        image -- ndarray with ndim >= 2
    Returns an integral image where every location i,j is the cumulative sum
    of all preceeding pixels.
    """
    return image.cumsum(1).cumsum(0)