def cut(img, c, **kargs):
    """
    Clip / Crop a numpy array

    Parameters
    ----------
    img : 2D numpy array
        The input image array
    c : list [llx, lly, urx, ury]
        the lower-left (ll) and upper-right (ur) coordinates used for the cropping
    """
    from .utils.geometry import Bbox
    if kargs.get('debug', False):
        print('cut in x', c[0], '->', c[2], ' - in y', c[1], '->', c[3])
    if isinstance(c, Bbox):
        c = [c.left, c.bottom, c.right, c.top]
    if c[3] < c[1]:
        c = [c[0], c[3], c[2], c[1]]
    if c[2] < c[0]:
        c = [c[2], c[1], c[0], c[3]]
    if c[2] - c[0] == img.shape[1] and c[3] - c[1] == img.shape[0]:
        raise Exception('Reshaping the same array again?')
    return img[c[1]:c[3], c[0]:c[2]]
