def shrink_sides(image, ts=0, bs=0, ls=0, rs=0):
    """Shrinks/crops the image through shrinking each side of the image.
    params:
        image: A numpy ndarray, which has 2 or 3 dimensions
        ts: An integer, which is the amount to shrink the top side
            of the image
        bs: An integer, which is the amount to shrink the bottom side
            of the image
        ls: An integer, which is the amount to shrink the left side
            of the image
        rs: An integer, which is the amount to shrink the right side
            of the image
    return: A numpy ndarray, which has the same number of dimensions as image
    """
    return image[ts:image.shape[0] - bs, ls:image.shape[1] - rs]